-
Notifications
You must be signed in to change notification settings - Fork 83
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ROS2 example #45
Comments
ROS2 support is pretty rough right now, mostly because I don't actually use it. I just tried a simple shell for foxy:
but was unable to get even
I don't know enough about ROS2 to fix this easily, but I think it might be due to a missing dependency somewhere. What specific problem did you run into? |
Adding From https://github.com/ros2/rmw_fastrtps#two-different-rmw-implementations
With a local version with ifconfig fixed, the following lets me run the turtlsim example with foxy. Note, it's using niv to manage the overlay and using a local nix-ros-overlay that has python3-ifconfig installed to fix ros2doctor. That still needs to make its way into { sources ? import ./nix/sources.nix }: # import the sources
let
overlay = _: pkgs: {
niv = import sources.niv {}; # use the sources :)
};
pkgs = import sources.nixpkgs {};
nix-ros-overlay = import sources.nix-ros-overlay {};
ros = nix-ros-overlay.rosPackages.foxy;
in
pkgs.mkShell {
buildInputs = with ros; [
pkgs.glibcLocales
(buildEnv {
paths = [
ros-base
rmw-fastrtps-dynamic-cpp
turtlesim
rviz2
];
})
];
# HACK: This is necessary right now as the equivalent of source /opt/ros/foxy/setup.sh
shellHook = ''
source $(echo $buildInputs | sed 's/ /\n/g' | tail -n1)/share/*/local_setup.bash
'';
ROS_VERSION = 2;
ROS_PYTHON_VERSION = 3;
ROS_DISTRO = "foxy";
# This seems to be necessary to dynamically parse the types for (de)serialization
RMW_IMPLEMENTATION = "rmw_fastrtps_dynamic_cpp";
} |
Most of those hacks in your shell shouldn't be needed now, as I have fixed the environment setup when using This happens because I source the ament generated I added a very simple example so show how you need to set |
A basic flake version of the wisdom shared here is, {
description = "Testing ROS on NixOS";
inputs = {
flake-utils.url = "github:numtide/flake-utils";
ros-flake.url = "github:lopsided98/nix-ros-overlay";
};
outputs = { self, nixpkgs, flake-utils, ros-flake }:
flake-utils.lib.eachDefaultSystem (system:
let pkgs = nixpkgs.legacyPackages.${system};
ros = ros-flake.packages.${system}.foxy;
in
{
devShell = pkgs.mkShell {
buildInputs = [ ros.turtlesim
ros.ros2run
ros.rmw-fastrtps-dynamic-cpp ];
RMW_IMPLEMENTATION = "rmw_fastrtps_dynamic_cpp";
};
}
);
} Given that A hearty thanks to everyone who has worked on this, particularly @lopsided98. This is such a huge leap forward! |
Hey there! Just wanted to drop a note, that Greetings 👋 |
For example (lopsided98#45): ``` postBuild = '' rosWrapperArgs+=(--set-default RMW_IMPLEMENTATION rmw_fastrtps_dynamic_cpp) ''; ```
For example (#45): ``` postBuild = '' rosWrapperArgs+=(--set-default RMW_IMPLEMENTATION rmw_fastrtps_dynamic_cpp) ''; ```
Could someone provide an example on how to use this overlay with ROS2 please ?
The text was updated successfully, but these errors were encountered: