examples/humble-turtlebot3-gazebo: Add an example using Humble distro

This commit adds an turtlebot3 example to use with humble ROS distro.

Signed-off-by: Rodrigo M. Duarte <rodrigo.duarte@ossystems.com.br>
This commit is contained in:
Rodrigo M. Duarte 2025-04-02 17:11:26 -03:00
parent 948e5d1d7c
commit ab65836ccc
2 changed files with 42 additions and 0 deletions

View file

@ -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=' \
'<nix-ros-overlay/examples/humble-turtlebot3-gazebo.nix>'
# 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:
<!-- The following comment is for https://github.com/zimbatm/mdsh -->

View file

@ -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";
}