The Hands On ROS Programming with GoPiGo3 book provided a GoPiGo3 model file and walked the reader through using the ROS 1 Gazebo simulation world. When I was loosely following that book to develop a ROS 2 GoPiGo3 driver, I was not able to simulate the GoPiGo3 in the ROS 2 Gazebo application.
New approach: First step has been to “lift” the Apache licensed open source Turtlebot3 code, changing:
- every “turtlebot3” to “gpg3”,
- every TURTLEBOT3 to GPG3,
- every TB3 and tb3 to GPG3 and gpg3,
- every “burger” to “gopigo3”
- and wheelbase to 117mm, wheel radius to 33.25mm
to create GoPiGo3 packages:
- gpg3_fake_node
- gpg3_msgs
- gpg3_simulations
- gpg3_gazebo
- gpg3_cartographer
- gpg3_navigation2
IT WORKED! (cannot tell it is a GoPiGo3 but I have to type “turtlebot3_” anymore)
GPG3_MODEL: gopigo3
WORLDS: gpg3_world.world gpg3_house.world empty_world.world
MAPS: gpg3world.yaml floorplan.map.yaml (not gpg3_house floorplan)
### Launch gpg3_gazebo
ros2 launch gpg3_gazebo gpg3_world.launch.py
### Launch cartographer to make map
ros2 launch gpg3_cartographer cartographer.launch.py
### To save a new map
ros2 run nav2_map_server map_saver_cli -f maps/my_new_map
### Launch gpg3 navigation and use sim time
(ctrl-shift o to split Terminator terminal)
ros2 launch gpg3_navigation2 navigation2.launch.py use_sim_time:=True map:=maps/gpg3world.yaml
- in Rviz2
- click 2D Pose Estimate button and click/point approximately where bot is and heading
- click "Nav2 Goal" button and click/point a goal
- Waypoint Following or Nav Through Poses
On the Rviz2 Navigation pane, select "Waypoint/Nav Through Poses Mode"
Click Nav2 Goal, set a goal, repeat for a couple goals,
then Click "Start Nav Through Poses" or "Start Waypoint Following"
Next steps for the sim:
- Learn how to change the turtlebot3_world to a simpler rectangular world
- Try Keith’s Finmark model
- Try editing one of the Turtlebot3 model to look like a GoPiGo3
Next steps for GoPiGo3-Dave:
- Try the navigation with the real GoPi5Go-Dave and the floorplan of my house I built for Create3-WaLI