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: 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. There is a lag seen because I am viewing RViz on a server that is remote from the robot.
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
<!-- MOVE BASE node: Specify goal position on map for bot to navigate to. Includes path planning module. -->
<node name="move_base" pkg="move_base" type="move_base" respawn="false" output="screen">
<remap from="scan" to="/scan_filtered"/>
<remap from="cmd_vel" to="/dog_cmd_vel"/>
<param name="base_global_planner" value="navfn/NavfnROS" />
<param name="base_local_planner" value="base_local_planner/TrajectoryPlannerROS"/> -->
<!-- Load Config files -->
<rosparam file="$(find my_robot_nav)/config/costmap_common_params.yaml" command="load" ns="global_costmap" />
<rosparam file="$(find my_robot_nav)/config/costmap_common_params.yaml" command="load" ns="local_costmap" />
<rosparam file="$(find my_robot_nav)/config/local_costmap_params.yaml" command="load" />
<rosparam file="$(find my_robot_nav)/config/global_costmap_params.yaml" command="load" />
<rosparam file="$(find my_robot_nav)/config/base_local_planner_params.yaml" command="load" />
</node>
</launch>
base_local_planner_params.yaml
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: 5.0
vtheta_samples: 20.0
# Trajectory Scoring Params
pdist_scale: 0.3 # 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
<launch>
<!-- MAP SERVER node: locate map and send out map data for localization -->
<arg name="map_file" default="$(find my_robot_nav)/maps/stels_office_lvl3.yaml"/>
<node name="map_server" pkg="map_server" type="map_server" args="$(arg map_file)" />
<!-- Adaptive Monte Carlos Localization (AMCL) node: Subscribe to topics for localization -->
<node name="amcl" pkg="amcl" type="amcl" output="screen">
<remap from="scan" to="/scan_filtered"/>
<param name="base_frame_id" value="base_link"/>
<param name="odom_frame_id" value="odom"/>
<param name="global_frame_id" value="map"/>
<!-- If you choose to define initial pose here -->
<param name="initial_pose_x" value="0"/> <!--Center of Map-->
<param name="initial_pose_y" value="0"/> <!--Center of Map-->
<param name="initial_pose_a" value="0"/> <!--Center of Map-->
<param name="initial_cov_xx" value="0.05*0.05"/>
<param name="initial_cov_yy" value="0.05*0.05"/>
<param name="initial_cov_aa" value="(3.14/192)*(3.14/192)"/>
<!--<param name="initial_cov_xx" value="0.25*0.25"/> -->
<!--<param name="initial_cov_yy" value="0.25*0.25"/> -->
<!--<param name="initial_cov_aa" value="(3.14/24)*(3.14/24)"/> -->
<!-- Limits on particles used in AMCL -->
<param name="min_particles" value="50"/>
<param name="max_particles" value="1000"/>
<!-- AMCL Update Rate (d = translational, a = rotational) -->
<param name="update_min_d" value="0.001"/>
<param name="update_min_a" value="0.001"/>
<!-- <param name="update_min_d" value="0.01"/> -->
<!-- <param name="update_min_a" value="0.01"/> -->
<!-- Laser settings -->
<param name="laser_min_range" value="-1.0"/> <!-- Use LaserScan Msg's min range -->
<param name="laser_max_range" value="-1.0"/> <!-- Use LaserScan Msg's max range -->
<param name="laser_min_beams" value="30"/>
<param name="laser_z_hit" value="0.95"/>
<param name="laser_z_rand" value="0.05"/>
<param name="laser_model_type" value="likelihood_field"/>
<!-- Odometry Settings - alpha = noise error (Assume ~0.5cm error) -->
<param name="odom_model_type" value="diff-corrected"/>
<param name="odom_alpha1" value="0.005"/>
<param name="odom_alpha2" value="0.005"/>
<param name="odom_alpha3" value="0.005"/>
<param name="odom_alpha4" value="0.005"/>
</node>
Originally posted by tootyboi95 on ROS Answers with karma: 21 on 2020-12-17
Post score: 2