diff --git a/README.md b/README.md index 7517b3a552..e691ab1f54 100644 --- a/README.md +++ b/README.md @@ -30,6 +30,19 @@ roslaunch turtlebot3_gazebo turtlebot3_world.launch roslaunch turtlebot3_teleop turtlebot3_teleop_key.launch ``` +Turtlebot 3 simulation in Gazebo on humble distro: +``` +nix-shell \ + -I nix-ros-overlay=https://github.com/lopsided98/nix-ros-overlay/archive/master.tar.gz \ + --option extra-substituters 'https://ros.cachix.org' \ + --option trusted-public-keys 'cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY= ros.cachix.org-1:dSyZxI8geDCJrwgvCOHDoAfOm5sV1wCPjBkKL+38Rvo=' \ + '' +# If not on NixOS, nixGL (https://github.com/guibou/nixGL) is needed for OpenGL support +ros2 launch turtlebot3_gazebo turtlebot3_world.launch.py +# Spawn a new nix-shell in a new terminal and then: +ros2 run turtlebot3_teleop teleop_keyboard +``` + ### Flakes With [Flakes enabled][flake], the equivalent of the above for noetic distro is: @@ -38,6 +51,12 @@ nix develop github:lopsided98/nix-ros-overlay#example-noetic-turtlebot3-gazebo # Then use roslaunch commands as above ``` +With [Flakes enabled][flake], the equivalent of the above for humble distro is: +``` +nix develop github:lopsided98/nix-ros-overlay#example-humble-turtlebot3-gazebo +# Then use ros2 commands as above +``` + Using the overlay in your `flake.nix`-based project could look like this: diff --git a/examples/humble-turtlebot3-gazebo.nix b/examples/humble-turtlebot3-gazebo.nix new file mode 100755 index 0000000000..a01e5a71de --- /dev/null +++ b/examples/humble-turtlebot3-gazebo.nix @@ -0,0 +1,23 @@ +# Run: +# ros2 launch turtlebot3_gazebo turtlebot3_world.launch.py +# ros2 run turtlebot3_teleop teleop_keyboard + +{ pkgs ? import ../. {} }: +with pkgs; +with rosPackages.humble; +with pythonPackages; + +mkShell { + buildInputs = [ + glibcLocales + (buildEnv { paths = [ + ros-base + turtlebot3-teleop + turtlebot3-gazebo + ]; }) + ]; + + ROS_HOSTNAME = "localhost"; + ROS_MASTER_URI = "http://localhost:11311"; + TURTLEBOT3_MODEL = "burger"; +}