Back to the Gazebo environment. Pretty straightforward. The sample files from the book are copied in, so that saves a lot of typing. It’s worth reading through the launch files, etc. to understand what they’re doing.
Note that if you’re using the book’s files, when you run the rviz launch the first time you won’t see what’s shown on p 258, but rather what’s on p 263, since both models are already included.
One thing that is confusing is why the camera and the distance_sensor_solid have their origin at the robot’s origin (base_link). It’s pointed out that if you do that the solid model will block the sensor rays, so you have to build a separate sensor from the visual model. But with the camera at the origin, you also get the view blocked (that’s show in the pictures, but it’s a little hard to see. Here is a better picture:
This really annoyed me, so I played around with moving the origin (learning a fair bit about how the urdf works. If you move the origin of the joint, then you have to also change the coordinates for the visual, etc. I ended up just moving the camera joint to where the visual link had been located. Still get some obstruction from the virtual lens housing, but still a better picture I think.
I’ve attached my version of the gazebo file. I’m sure I could get rid of the rings, but would have to tweak where the visual is located with regard to the joint, so I didn’t bother.
If you want to use the modified gazebo file, be sure to first save a copy of your original so you can revert back, and then change the filename on the modified file.
Also note that on p264 the topic isn’t “/gopigo/distance_sensor” but “gopigo_distance”.
More to come as I get into the Navigation section of the chapter.
modified_gopigo3_basic.gazebo.txt (9.3 KB)