Ask Your Question
0

speed up rosbot navigation with teb local planner

asked 2021-04-26 13:10:27 -0500

Eman.m gravatar image

updated 2021-04-26 20:14:29 -0500

Hi

I have a powerful server (32GB RAM) running ubuntu 16.04 and ROS Kinetic.

I am using navFn and teb local palnner to navigate husarion Rosbot2 carlike robot.

I set all required parameters, however the the rosbot2 seems crawling, how can I get fast navigatio.

Below the settings:

move_rosbot2.launch

<launch>
    <arg name="use_rosbot" default="false"/>
    <arg name="use_gazebo" default="true"/>
    <param if="$(arg use_gazebo)" name="use_sim_time" value="true"/>
<!-- Bring the ROSbot model and show it in Gazebo and in Rviz  -->
    <include file="$(find rosbot_description)/launch/rosbot_rviz.launch"/>
<!-- Map server -->
    <arg name="map_file" default="$(find rosbot_navigation)/maps/willowgarage-refined.yaml"/>
    <node name="map_server" pkg="map_server" type="map_server" args="$(arg map_file)" />
<!--- tf -->
    <node unless="$(arg use_rosbot)" pkg="tf" type="static_transform_publisher" name="map_odom_tf" args="0 0 0 0 0 0 map odom 100" /> 
    <node if="$(arg use_rosbot)" pkg="tf" type="static_transform_publisher" name="base_link_to_laser" args="0 0 0 3.14 0 0 base_link laser 100" />

    <node pkg="joint_state_publisher" type="joint_state_publisher" name="joint_state_publisher">
    <param name="publish_frequency" type="double" value="30.0" />
    </node>
<!--- Localization: Run AMCL -->
  <node pkg="amcl" type="amcl" name="amcl" output="screen">
        <remap from="scan" to="/scan"/>
        <rosparam file="$(find rosbot_navigation)/config/amcl.yaml" command="load" />

    </node>
<!-- Move base -->
    <node pkg="move_base" type="move_base" name="move_base" output="screen">
        <param name="base_global_planner" value="navfn/NavfnROS"/>
        <param name="base_local_planner" value="teb_local_planner/TebLocalPlannerROS" /> 
        <param name="controller_frequency" value="30.0"/> <!-- default is 20.0 -->
        <rosparam file="$(find rosbot_navigation)/config/costmap_common_params.yaml" command="load" ns="global_costmap" />
        <rosparam file="$(find rosbot_navigation)/config/costmap_common_params.yaml" command="load" ns="local_costmap" />
        <rosparam file="$(find rosbot_navigation)/config/local_costmap_params.yaml" command="load" />
        <rosparam file="$(find rosbot_navigation)/config/global_costmap_params.yaml" command="load" />
        <rosparam file="$(find rosbot_navigation)/config/teb_local_planner_params.yaml" command="load" />
    </node>
</launch>

amcl.yaml

use_map_topic: true

odom_frame_id: "odom"
base_frame_id: "base_link"
global_frame_id: "map"

initial_pose_x : 0
initial_pose_y : 0

## Publish scans from best pose at a max of 10 Hz
odom_model_type: "diff"
odom_alpha5: 0.1
gui_publish_rate: 10.0
laser_max_beams: 60
laser_max_range: 12.0
min_particles: 500
max_particles: 2000
kld_err: 0.05
kld_z: 0.99
odom_alpha1: 0.2
odom_alpha2: 0.2
## translation std dev, m 
odom_alpha3: 0.2
odom_alpha4: 0.2
laser_z_hit: 0.5
aser_z_short: 0.05
laser_z_max: 0.05
laser_z_rand: 0.5
laser_sigma_hit: 0.2
laser_lambda_short: 0.1
laser_model_type: "likelihood_field" # "likelihood_field" or "beam"
laser_likelihood_max_dist: 2.0
update_min_d: 0.25
update_min_a: 0.2

resample_interval: 1

## Increase tolerance because the computer can get quite busy 
transform_tolerance: 1.0
recovery_alpha_slow: 0.001
recovery_alpha_fast: 0.1

costmap_common_params.yaml

footprint: [[0.12, 0.14], [0.12, -0.14], [-0.12, -0.14], [-0.12, 0.14]]
transform_tolerance: 0.2
map_type: costmap

obstacle_layer:
 enabled: true
 obstacle_range: 3.0
 raytrace_range: 3.5
 inflation_radius: 0.2
 track_unknown_space: false
 combination_method: 1

 observation_sources: laser_scan_sensor
 laser_scan_sensor: {data_type: LaserScan, topic: scan, marking: true, clearing: true}

inflation_layer:
  enabled: true
  cost_scaling_factor: 10.0 # exponential rate at which the obstacle cost drops off (default ...
(more)
edit retag flag offensive close merge delete

Comments

I have increased

dt_ref: 1.0 # was 0.3

cmd_angle_instead_rotvel: False # was Ture

It moves a little faster, but still seems crawling

Eman.m gravatar image Eman.m  ( 2021-04-26 17:21:30 -0500 )edit

is there any settings related to Gazebo?

Eman.m gravatar image Eman.m  ( 2021-04-26 18:16:35 -0500 )edit

Hi @Eman.m,

For me, increasing these parameters solved the issue: max_vel_theta, acc_lim_x, acc_lim_theta. You can find them in the "Robot" tab using rqt reconfigure. Once you are satisfied with the results, you can go add them to your .yaml file.

FrancoisVanEeden gravatar image FrancoisVanEeden  ( 2021-05-27 10:27:49 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted
0

answered 2021-04-30 10:18:55 -0500

Hi there Eman.m,

I can think of two reasons the vehicle could be moving slowly:

  1. The vehicle controller parameter velocity limits,
  2. or the teb_local planner parameters.

Try to echo the /cmd_vel topic and see what value is being sent. If the value being sent is greater than the actual velocity, the issue is the vehicle controller settings. You will probably have to edit the vehicle controller's .yaml file. If the value is equal to the vehicle speed, then the issue is the teb_local_planner parameter. You can experiment with its parameters by running rqt_reconfigure when the robot is running. Just be careful and remember velocities are in [m/s]. Start with small values when you are testing.

edit flag offensive delete link more

Comments

Many thanks @FrancoisVanEeden for your help.

Regarding the case if /cmd_vel > actual velocity:

1- what do you mean by "actual velocity" and "the vehicle controller settings" ? where can I find them?

2- "the vehicle controller's .yaml file" is it teb_local_planner_params.yaml ?

Regarding the case if /cmd_vel = the vehicle speed:

3- what do you mean by "the vehicle speed", do you mean "max_vel_x" parameter's value in teb_local_planner_params.yaml ?

4- Does "max_vel_x" is the only parameter that I need to tune when running rqt_reconfigure?

Eman.m gravatar image Eman.m  ( 2021-05-03 14:31:59 -0500 )edit

Sorry, I thought it was a real robot. It should be "simulated velocity".

  1. Check the velocity with a gazebo service call: rosservice call /gazebo/get_model_state "{ model_name: 'NAME', relative_entity_name: 'world'}" Replace NAME with the robot model name from gazebo. This is in the world frame: test along the x or y axis.

  2. The vehicle's controller gets data on the .../cmd_vel topic. The prefix depends on your setup. To search for it: rostopic list | grep -e 'cmd_vel' or use rqt_graph: rosrun rqt_graph rqt_graph. teb_local_planner (move_base) publishes to .../cmd_vel and the vehicle controller subscribes to that. For simulations, gazebo simulates the vehicle controller and is the one subscribing to cmd_vel. You can look for the correct yaml file by tracing through the launch files. Do you have a URL to the source files for the simulation?

  3. Yes, this is also what rqt_reconfigure changes at runtime.

  4. I don't know. I will let ...

(more)
FrancoisVanEeden gravatar image FrancoisVanEeden  ( 2021-05-09 08:46:26 -0500 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

3 followers

Stats

Asked: 2021-04-26 13:10:27 -0500

Seen: 98 times

Last updated: Apr 30