GoPiGo3 ROS Simulation Progress

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
1 Like

Until it stopped and I don’t know what magic I deleted …

1 Like

But, it worked.

That’s 99% of the solution right there.

Now you get to play “Where’s Waldo” and figure out what you did that was significant.

Like with the display stuff I’m working on.  One instance works and one doesn’t.

Once you have an inflection point like that, the problem will crack wide open.

1 Like

I ran a programming marathon and after finishing I cleaned up the massive trash left scattered along the route.

Some of that trash must have been treasure.

I was aware of a massive push to transition folks off Gazebo Classic, but not that the EOL is in 3 months. (Only discovered that in researching how to best answer your “What is Turtlebot3 Gazebo” question.)

Sort of shatters my enthusiasm for the sim part of this marathon, but the turtlebot3/gpg3_navigation package will probably work with the physical GoPi5Go-Dave so not all will be wasted.

It would be better engineering to test all my Dave robot software changes in a sim world, rather than dumping them on Dave untested, but usually the worst that has happened so far, is Dave’s safetyShutdown program jumping into action. Perhaps as Dave begins to adventure beyond his dock, I will need to strengthen his ROS code to react to the stalled motors flag he is already publishing. The navigation package has alternate path replanning after an “obstacle impact” reaction.

A long time ago I investigated using the GoPiGo3 stalled motor flag as virtual bumpers. Maybe time to revisit. I may actually have seen similar code in the Tutlebot3 code.

1 Like