This is a video demonstration of mapping of the turtlebot's environment.
map_animation.py
subsribes to the /odom
topic to localize the robot's position and /scan
topic to map the obstacles.
This obstacle mapping is then converted to a binary occupancy grid for further use.
Setting up your environment
- Clone this repository into your
catkin_workspace
- Run
cd catkin_ws && catkin_make
- Roscore
roscore
- Export your turtlebot model.
EXPORT TURTLEBOT3_MODEL=waffle
- Loading up your gazebo
roslaunch obstacle_detection_mapping automation_task.launch
- Run
rosrun teleop_twist_keyboard teleop_twist_keyboard.py
Running the scripts
roscd obstacle_detection_mapping/scripts
- Making the files executable
2.1
chmod +x map_animation.py
2.2chmod +x occupancy_grid.py
- Run the mapping script
rosrun obstacle_detection_mapping map_animation.py
This will do your job, if in case you want to see the live occupancy grid plot, execute the commandrosrun <package_name> occupancy_grid.py
The occupancy grids co-ordinates can also be obtained with the commandrosservice call /get_obstacles_grid
Hope you have fun running this and is useful to you!