ros-planning / navigation

ROS Navigation stack. Code for finding where the robot is and how it can get somewhere else.
2.34k stars 1.79k forks source link

move_base local planner deviates significantly from global planner path #1068

Closed derektan95 closed 3 years ago

derektan95 commented 3 years ago

Hi ROS community,

I am in need for some help with a project involving the use of move_base package with Ubuntu 16.04, ROS Kinetic. I have looked through most of the other issues with move_base that others have faced, but I did not encounter any similar issues in the forum. Help is greatly appreciated!

I am currently running this on a robot dog which I recently owned (Unitree A1). This robot has an internal IMU which allows me to derive odometry base_link - odom tf as well as to publish ‘/odom’ message, using this ROS tutorial here (link). In fact, I used this, along with laserscan from a 2D Lidar, for HectorSLAM and AMCL package and it worked well. I am also able to teleops the robot dog using the Teleops Twist Keyboard package. Here is a rough image of the tf of the system (Note: This is not the latest diagram. I have attempted to keep all nodes publishing at 10Hz).

tf frames: https://drive.google.com/file/d/1mC1M4bUQD_Oex7u7pYbn0kgCXHMigf9E/view?usp=sharing

Successful AMCL video using teleops: https://youtu.be/BET4nThOA5E

I have spent a long time attempting to tune the move_base parameters for this package. While the global planner seems to do its job of planning a relatively straight path from start to goal pose, the local planner is causing the robot to move in very unpredictable manner, often deviating from the global path. Here are some videos of RVIZ describing the issue. I have mapped an office environment using a RPLidar, and have initialized the AMCL package with origin: x=0, y=0, theta=0 (At the origin where I started mapping, facing Eastwards). In all of these videos, the arrows corresponds well with the real (observed) location of the robot. The video is lagging because I am viewing rviz on my personal laptop, remotely from the ROS nodes running in the robots.

Failed Attempt 1: https://youtu.be/zjztpArHyRk As you could notice, the robot seem to do wierd rotations at the starting pose before hitting a dead-end that is deviating even further from the goal pose.

Failed Attempt 2: https://youtu.be/CUEi0Uyg1lg You would notice that the robot spins off the path and faces a wall again.

Successful Attempt 3: https://youtu.be/IDlVw3i-xfI Out of about many attempts today, only 1 of them seem to work relatively well. Even so, it seems to deviate from the goal pose once it is close to it.

I have looked through most of the other posts regarding issues with move_base. There was a post explaining how to resolve the issue of robots moving in random circles (link). However from the 2nd video (failed attempt), you could see that I displayed the axis for map coordinate system. I have looked through the coordinate system for odom, base_link and laser, and all of them are facing the same way (x facing Eastwards, y facing northwards, z facing out of the plane). So this ensures that my robot’s base_link tf is oriented in the right direction.

In addition, I made sure that the odom message derived from IMU correlates with the ‘/dog_cmd_vel’ sent by the move_base node well. I have also looked through other common troubleshooting guides (troubleshooting guide) but failed to derive anything meaningful to it. I have also attempted to use DWA Planner instead of the default trajectory planner but to no avail.

I wonder if anyone has any other insights to this issue? Would be great if we could consider potential issues which I may have overlooked. Help is greatly appreciated, thank you very much.

move_base.launch

--> **base_local_planner_params.yaml** (p.s. the robot is holonomic, but I chose to simplify things by removing the strafing functionality) controller_frequency: 10 TrajectoryPlannerROS: # Robot Config Params acc_lim_x: 0.1 acc_lim_y: 0.1 acc_lim_theta: 0.05 max_vel_x: 0.2 min_vel_x: 0.1 max_vel_theta: 0.1 min_vel_theta: -0.1 min_in_place_vel_theta: 0.0 # 0.2 escape_vel: -0.1 holonomic_robot: false # y_vels: [-0.2, -0.1, 0.1, 0.2] # Goal Tolerance Params yaw_goal_tolerance: 0.2 xy_goal_tolerance: 0.1 latch_xy_goal_tolerance: false # Forward Simulation Params sim_time: 1.0 sim_granularity: 0.025 angular_sim_granularity: 0.025 vx_samples: 14.0 vx_samples: 14.0 vtheta_samples: 20.0 # Trajectory Scoring Params pdist_scale: 0.6 gdist_scale: 0.8 occdist_scale: 0.02 **costmap_local_params.yaml** map_type: costmap obstacle_range: 2.0 raytrace_range: 3.0 transform_tolerance: 0.5 robot_radius: 0.25 inflation_radius: 0.3 cost_scaling_factor: 1.0 observation_sources: laser_scan_sensor laser_scan_sensor: {sensor_frame: laser, data_type: LaserScan, topic: /scan_filtered, marking: true, clearing: true} **global_costmap_params:** global_costmap: global_frame: map robot_base_frame: base_link update_frequency: 5.0 publish_frequency: 5.0 width: 20.0 height: 20.0 resolution: 0.05 static_map: true rolling_window: false **local_costmap_params.yaml** local_costmap: global_frame: odom #odom robot_base_frame: base_link update_frequency: 5.0 publish_frequency: 5.0 width: 10.0 height: 10.0 resolution: 0.05 static_map: false rolling_window: true **amcl.launch**
DLu commented 3 years ago

Closing in favor of the discussion here: https://answers.ros.org/question/367962/move_base-local-planner-deviates-significantly-from-global-planner-path/