This is a self-learning project of SLAM using simulated robot in ROS and Gazebo environment.
It mainly focuses on building and implementing differnt path planning methods from scratch.
Built planning algorithm:
$ sudo apt-get install ros-noetic-joy ros-noetic-teleop-twist-joy ros-noetic-teleop-twist-keyboard ros-noetic-amcl ros-noetic-map-server ros-noetic-move-base ros-noetic-urdf ros-noetic-xacro ros-noetic-rqt-image-view ros-noetic-slam-gmapping ros-noetic-dwa-local-planner ros-noetic-joint-state-publisher-gui
In this learning repository, I biult a two-wheel robot car with a lidar sensor.
After building the model, export it as urdf file using this github repository.
$ roslaunch wheelbot_description gazebo.launch
To control the robot with keyboard
$ rosrun teleop_twist_keyboard teleop_twist_keyboard.py
All plugins can be found here.
Add plugins in wheelbot.gazebo
- Differential drive controller
- Laser sensor (non-gpu version)
Edit gazebo.launch
<arg name="paused" value="false"/>
Save the world as Indoor_world.world in wheelbot_description/worlds/
Edit gazebo.launch
<node name="joint_state_publisher" pkg="joint_state_publisher" type="joint_state_publisher"/>
<node name="robot_state_publisher" pkg="robot_state_publisher" type="robot_state_publisher"/>
<arg name="world_file" value="$(find wheelBot_description)/worlds/Indoor_world.world"/>
$ roslaunch wheelBot_description gazebo.launch
$ rosrun gmapping slam_gmapping scan:=/rrbot/laser/scan (Used for mapping)
$ rosrun teleop_twist_keyboard teleop_twist_keyboard.py (Control robot movement through keyboard)
$ rosrun map_server map_saver -f Indoor_world_map (Save map)
Open a new package called navigation and prepare files inside.
In common_costmap.yaml, set robot footprint:
footprint: [[-0.1, -0.135], [-0.1, 0.135], [0.1, 0.135], [0.1, -0.135]];
More information here:
ros navigation
ros navigation notebook
odom frame explanation 1
odom frame explanation 2
costmap_2D
occupancy grid
I add my global planner as a plugin following this ros tutorial.
Set different planning methods in movebase.launch
<param name="base_global_planner" value="astar_planner/AstarPlanner"/>
Other information regarding global_planner can be found here.
$ roslaunch wheelBot_description gazebo.launch
$ roslaunch navigation navigation.launch
