Posting on some results related to working with Gazebo + RViz. The task at hand was importing a new world model into gazebo, building a map, and using localization and navigation packages to allow for the Turtlebot to navigate to a given target. I am currently working on a larger project, as part of my work at Idein Inc. which requires data generated from simulation, thus my venture into Gazebo + RViz.
The general feeling I have is that RViz + Gazebo is not so friendly to a new comer, and requires a decent amount of head banging to get things to work. That said, since we are dealing with a lot of moving parts, the complexity of the system and the API should be somewhat expected. To consider that this is the case after ALOT has already been abstracted is quite impressive.
Gazebo has a build
which allows one to create a “world”. This will clearly come in use at some
point later, but considering the time constraints, instead of creating a new
world model, I relied on models created by erlerobot found
model.sdf were placed into a directory called
this was placed in
circuit2.world file was placed in the
/worlds directory under a ros package that I created called
allows for easier access by other programs.
Now that we have a world environment we can generate a map.
generate_map.launch, was constructed to handle the launch of files related to teleop, gmapping, and RViz.
After a painstakingly manual task of teleoping the turtlebot around, we get two
.pgm image, and a
.yaml file referencing the
.pgm image. In
term of steps:
$ roslaunch generate_map.launch
Use the teleop keypad to move around the map. You can confirm the construction of the map in RViz which should have loaded as a result of roslaunch.
Once you are satisfied with the constructed map, run map_server.
$ rosrun map_server map_saver -f <file_name_to_save_to>
You should now see the previously mentioned files generated.
This is really all we need to see the turtlebot in action, localizing and navigating its way based on the generated map and given target.
$ rosrun turtlepi_localize.launch map_file:=<location_of_.yaml_file>
Not sure for others, but it took awhile for the map to load and set up which in the meantime ROS was streaming the following warning:
[ WARN] …:Timed out waiting for transform from base_footprint to map to become available before running costmap, tf error:…
Setting the Global options-> Fixed Frame from
base_link resolved the
issue. (Though subsequently flipping back made the localization and navigation
task function seemingly better)
I am just happy I got this working, but clearly a lot of road blocks ahead.