Here is an example of obtaining occupancy grid from sensory data of turtlebot robot.
1.First you need to install all dependencies for gazebo and turtlebot and octomap server:
1 |
sudo apt-get install ros-kinetic-gmapping ros-kinetic-turtlebot-gazebo ros-kinetic-turtlebot-simulator ros-kinetic-turtlebot-teleop |
2. Launch gazebo in a simulated environment:
1 |
roslaunch turtlebot_gazebo turtlebot_world.launch |
3.Launch RVIZ to view the published data
1 |
roslaunch turtlebot_rviz_launchers view_robot.launch |
3.Move your robot via keyboard:
1 |
roslaunch turtlebot_teleop keyboard_teleop.launch |
to learn how to move the robot with your joystick controller please follow my other tutorial on that here
4. Create a txt file and save it as octomap_turtlebot.launch. Then paste the following lines in that:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 |
<launch> <node pkg="octomap_server" type="octomap_server_node" name="octomap_server"> <param name="resolution" value="0.05" /> <param name="frame_id" type="string" value="odom" /> <!-- maximum range to integrate (speedup!) --> <param name="sensor_model/max_range" value="5.0" /> <!-- data source to integrate (PointCloud2) --> <remap from="cloud_in" to="/camera/depth/points" /> </node> </launch> |
and call it by
1 |
roslaunch octomap_turtlebot.launch |
5.Now in the rviz add an OccupancyMap and view the octomap. Of course, you need to remove the floor first 🙂
Hi, im a student from de UC3M university of Madrid. Im implementing something like that but i dont know how to vinculate gazebo with the Octomap occupancy. I’m trying to do a algorithm for obstacle avoidance of a robot manipulator then i need the info about the occupancy cells. If you got some info that can help me i will appreciate a lot.
Best Regards.
Hi, Gabriel, I have added some description, please let me know if need more help.
Hi, i alredy got gazebo rviz and octomap working. But i do not how if you take the info from the “occupied_cells_vis_array” and use that data, cause with Matlab i obtain a Marker and dont know how handle that info. Also im now trying with the PR2, if you have some info about that email me.
Best regards.
[…] Bu siteyi takip ederek yaptığım tutorialda aşağıdaki görüntü oluşmaktadır. […]