Big bot is a six-wheeled robot used to generate a 3D map simulation of a V-shaped cave structure
- teleop_twist_keyboard package; source: http://wiki.ros.org/teleop_twist_keyboardhttp://wiki.ros.org/teleop_twist_keyboard
- ouster_example package; source: https://github.com/ouster-lidar/ouster_example
- octomap_server package; source: https://github.com/OctoMap/octomap_mapping
-
git clone the package into your catkin_ws/src (or whatever you named your ros workspace) using the following line in the terminal
git clone https://github.com/AntarCreates/big_bot_description.git
-
Build the workspace using
catkin_make
-
Source the bash file using
source devel/setup.bash
-
Run the following command to bring up Big bot in gazebo
roslaunch big_bot_description gazebo.launch
-
This should bring up the robot in the Gazebo interface as depicted below-
- Press the "insert" option in gazebo
- If you have everything set up adequately, you should find two objects by the following names under the "models used" folder on the left plane inside gazebo
- Cave Corner 01 Type B
- cave_straight_01
- Drag and drop the models to generate your desired shape. I went for a V-shaped one like the image attached below:
The procedure can be subdivided into five (5) separate steps
- Initialize visualization
- Editing the octomap_mapping.launch file
- Running the octomap node to start generating 3D map
- Running the teleop_twist_keyboard.py node to drive the bot as the map is being generated, and
- Saving the generated 3D map
-
To viaualize the process, we'll use RViz, the default ROS visualizer. Open a new tab in the terminal and run the following line:
roslaunch big_bot_description display.launch
This should bring-up RViz, and you should find various options like robot model, Tf, etc. I recommend to uncheck the robot model box, as doing so keeps the map visualization cleaner.
note: In case you don't have your system set up for removing the irritating need for sourcing it each time a new terminal is opened, you must run
source devel/setup.bash
every time you open a new tab in the terminal, which you will be doing a lot in the next few steps
- Find the octomap_server package in your system using
rospack find octomap_server
. It should give you a path to its file location. - copy the path and open the file location (GUI) using
nautilus <your copied path>
- Find and open the octomap_mapping.launch file in the launch folder and edit the following lines as below:
<param name="frame_id" type="string" value="odom" />
<remap from="cloud_in" to="/depth/points" />
Now this is quite a critical phase so be a bit more cautious
-
Start the octomapping process by running the following line in a separate terminal tab ( Don't forget to source the bash!)
roslaunch octomap_server octomap_mapping.launch
-
In RViz press "Add" then "Add by topic" and press on "MarkerArray" as depicted in the snap below and set the fixed frame to be "odom":
- By this time you should see blue cubes forming up along the red lidar rays near the big bot in the RViz window. That means the octomap is running! Good job!
note: The octomap terminal may give you a warning with something like "octree is empty.Nothing to publish". You can ignore that as long as your mapping process is running.
- Now all you have to do is drive the bot through your desired path using keyboard inputs
- Run
rosrun teleop_twist_keyboard teleop_twist_keyboard.py
in a separate terminal tab to drive the robot using keyboard inputs (e.g., "i" for forward, "," for backward, etc.)
If everything works as expected, you should see a similar process as depicted in the following clip:
3D_cave.1.1.mp4
-
If you made it this far, you are basically done! Congratulations! Now just save the map using the following line in a separate terminal in a desired directory ( don't forget to source the bash):
rosrun octomap_server octomap_saver -f <name of your map>.bt
-
To load or open the saved map, close the RViz window using
Ctrl+c
in the corresponding terminal tab and relaunch it usingrosrun rviz rviz
-
Add MarkerArray subscribing to the similar topic as before and set the fixed frame to be "Odom"
-
Run the following command in the terminal tab
rosrun octomap_server octomap_server_node <name of your map>.bt
-
This should bring up the map in RViz window that you can rotate as you wish