The local planning algorithm of the Mirte Master robot. Dynamic Window Approach is used to avoid static and dynamic obstacles (DWA) in ROS. The setup involves handling sensor data for obstacle avoidance and publishing velocity commands to control the robot.
- Global Path Publishing: The global path is generated and published by the global path planner.
- Local Costmap Updates: LiDAR data is used to update the local costmap for obstacle detection.
- Local Planner (DWA): The local planner generates velocity commands to follow the global path while avoiding obstacles.
- Robot Motion Execution: The robot executes the velocity commands.
- Feedback and Adjustment: Odometry data is used to adjust the path and ensure accurate navigation. (Using SLAM later as improved localization)
To create a new package with the necessary dependencies, use the following commands:
cd ~/catkin_ws/src
catkin_create_pkg mirte_local_planner rospy std_msgs geometry_msgs nav_msgs move_base
Navigate to your catkin workspace, build the workspace, and source the setup file:
cd ~/catkin_ws
catkin build
source devel/setup.bash
Before launching the local planner, make sure that there is a map
and that amcl
is launched.
Central Launch Tester
roslaunch mirte_local_planner central_launch_tester.launch
Load a Preconfigured RViz Setup:
rviz -d ~/catkin_ws/src/mirte_local_planner/config/mirte_local_planner.rviz
Topic: /global_path
Message Type: nav_msgs/Path
- Description: The global path generated by the global planning algorithm is published to this topic.
Topic: /scan
Message Type: sensor_msgs/LaserScan
- Description: LiDAR sensor publishes laser scan data to detect obstacles.
Topic: /odom
Message Type: nav_msgs/Odometry
- Description: Provides odometry information for the robot's current position and velocity.
Topic: /move_base/local_costmap/costmap
Message Type: nav_msgs/OccupancyGrid
- Description: The local costmap is updated with obstacle information.
Topic: /cmd_vel
Message Type: geometry_msgs/Twist
- Description: The DWA local planner publishes velocity commands to this topic.
Topic: /cmd_vel
Message Type: geometry_msgs/Twist
- Description: The robot's motor controller subscribes to this topic to receive velocity commands.
Topic: /odom
Message Type: nav_msgs/Odometry
- Description: Provides continuous feedback on the robot's position and velocity.
Service: /move_base/clear_costmaps
Service Type: std_srvs/Empty
- Description: Clears the global and local costmaps to remove stale obstacle information.
Create a new ROS package if not already created:
cd ~/catkin_ws/src
catkin_create_pkg mirte_local_planner rospy std_msgs geometry_msgs nav_msgs sensor_msgs tf
roslaunch mirte_local_planner central_launch_tester.launch