Robotics StackExchange | Archived questions

Navigation stack and robot_localization integration problems

Hello. I am working on turtlebot burger with kineic and ubuntu 16.04. I made a map myself, instead of gmapping or some sensor, provided it to map server. Then i want to merge the positioning data from my external sensor and odometry using robotlocalization, which is also give right filtered odomtery. Now i am configuring my files and environment but something is wrong. I have tried alot and already some questions throughtout the time, i am stuck. So, now i am providing all my files of navigation stack, map server and robotlocalization, please help me in correctly configuring the data.

First the launch files. Map launch file:

<launch>
  <arg name="map_file" default="$(find provide_map)/maps/map.yaml"/>
  <!-- Run the map server -->
  <node name="map_server" pkg="map_server" type="map_server" args="$(arg map_file)" >
    <param name="frame_id" value="odom"/>
 </node>
</launch>

Ekftemplate launch file for robotlocalization

<launch>
  <node pkg="robot_localization" type="ekf_localization_node" name="ekf_se" clear_params="true">
    <rosparam command="load" file="$(find robot_localization)/params/ekf_template.yaml" />
    <!--  Placeholder for output topic remapping
    <remap from="odometry/filtered" to=""/>
    <remap from="accel/filtered" to=""/>
    -->
  </node>
</launch>

turtlebot navigation launch

<launch>
  <!-- Arguments -->
  <arg name="model" default="$(env TURTLEBOT3_MODEL)" doc="burger"/>
  <arg name="open_rviz" default="true"/>
  <arg name="move_forward_only" default="false"/>
  <!-- Turtlebot3 -->
  <include file="$(find turtlebot3_bringup)/launch/turtlebot3_remote.launch">
    <arg name="model" value="$(arg model)" />
  </include> 
  <!-- rviz -->
  <group if="$(arg open_rviz)"> 
    <node pkg="rviz" type="rviz" name="rviz" required="true"
          args="-d $(find turtlebot3_navigation)/rviz/turtlebot3_navigation.rviz"/>
  </group>

Move_base launch

<launch>
  <!-- Arguments -->
  <arg name="model" default="$(env TURTLEBOT3_MODEL)" doc="model type [burger, waffle, waffle_pi]"/>
  <arg name="cmd_vel_topic" default="/cmd_vel" />
  <arg name="odom_topic" default="odom" />
  <arg name="move_forward_only" default="false"/>

  <!-- move_base -->
  <node pkg="move_base" type="move_base" respawn="false" name="move_base" output="screen">
    <param name="base_local_planner" value="dwa_local_planner/DWAPlannerROS" />
    <rosparam file="$(find turtlebot3_2dnav)/param/costmap_common_params_$(arg model).yaml" command="load" ns="global_costmap" />
    <rosparam file="$(find turtlebot3_2dnav)/param/costmap_common_params_$(arg model).yaml" command="load" ns="local_costmap" />
    <rosparam file="$(find turtlebot3_2dnav)/param/local_costmap_params.yaml" command="load" />
    <rosparam file="$(find turtlebot3_2dnav)/param/global_costmap_params.yaml" command="load" />
    <rosparam file="$(find turtlebot3_2dnav)/param/base_local_planner_params.yaml" command="load" />
    <rosparam file="$(find turtlebot3_2dnav)/param/dwa_local_planner_params_$(arg model).yaml" command="load" />
    <remap from="cmd_vel" to="$(arg cmd_vel_topic)"/>
    <remap from="odom" to="$(arg odom_topic)"/>
    <param name="DWAPlannerROS/min_vel_x" value="0.0" if="$(arg move_forward_only)" />
  </node>
</launch>

</launch>

Now the yaml files:::

map.yaml

image: /home/shairi/catkin_ws/src/provide_map/maps/map.pgm
resolution: 0.050000
origin: [-15,-30,0.000]
negate: 0
occupied_thresh: 0.65
free_thresh: 0.196

ekf template yaml

frequency: 30
sensor_timeout: 10
two_d_mode: true
transform_time_offset: 0.0
transform_timeout: 0.0
print_diagnostics: true
debug: false
debug_out_file: /path/to/debug/file.txt
publish_tf: true
publish_acceleration: false
map_frame: map            # Defaults to "map" if unspecified
odom_frame: odom            # Defaults to "odom" if unspecified
base_link_frame: base_link # Defaults to "base_link" if unspecified
world_frame: odom           # Defaults to the value of odom_frame if unspecified

odom0: odom
odom0_config: [false, false,  false,
               false, false, true,
               false, false, false,
               false, false, false,
               false, false, false]

odom0_queue_size: 2
odom0_nodelay: false
odom0_differential: false
odom0_relative: false
odom0_pose_rejection_threshold: 5
odom0_twist_rejection_threshold: 1

odom1: odom1
odom1_config: [true, true, false,
               false, false, false,
               false, false, false,
               false, false, false,
               false, false, false]
odom1_differential: false
odom1_relative: false
odom1_queue_size: 2
odom1_pose_rejection_threshold: 5
odom1_twist_rejection_threshold: 1
odom1_nodelay: false
use_control: false
stamped_control: false
control_timeout: 0.2
control_config: [false, false, false, false, false, false]
acceleration_limits: [0, 0.0, 0.0, 0.0, 0.0, 0]
deceleration_limits: [0, 0.0, 0.0, 0.0, 0.0, 0]
acceleration_gains: [0.5, 0.0, 0.0, 0.0, 0.0, 0.5]
deceleration_gains: [0.5, 0.0, 0.0, 0.0, 0.0, 0.5]

process_noise_covariance: [0.05, 0,    0,    0,    0,    0,    0,     0,     0,    0,    0,    0,    0,    0,    0,
                           0,    0.05, 0,    0,    0,    0,    0,     0,     0,    0,    0,    0,    0,    0,    0,
                           0,    0,    0.06, 0,    0,    0,    0,     0,     0,    0,    0,    0,    0,    0,    0,
                           0,    0,    0,    0.03, 0,    0,    0,     0,     0,    0,    0,    0,    0,    0,    0,
                           0,    0,    0,    0,    0.03, 0,    0,     0,     0,    0,    0,    0,    0,    0,    0,
                           0,    0,    0,    0,    0,    0.06, 0,     0,     0,    0,    0,    0,    0,    0,    0,
                           0,    0,    0,    0,    0,    0,    0.025, 0,     0,    0,    0,    0,    0,    0,    0,
                           0,    0,    0,    0,    0,    0,    0,     0.025, 0,    0,    0,    0,    0,    0,    0,
                           0,    0,    0,    0,    0,    0,    0,     0,     0.04, 0,    0,    0,    0,    0,    0,
                           0,    0,    0,    0,    0,    0,    0,     0,     0,    0.01, 0,    0,    0,    0,    0,
                           0,    0,    0,    0,    0,    0,    0,     0,     0,    0,    0.01, 0,    0,    0,    0,
                           0,    0,    0,    0,    0,    0,    0,     0,     0,    0,    0,    0.02, 0,    0,    0,
                           0,    0,    0,    0,    0,    0,    0,     0,     0,    0,    0,    0,    0.01, 0,    0,
                           0,    0,    0,    0,    0,    0,    0,     0,     0,    0,    0,    0,    0,    0.01, 0,
                           0,    0,    0,    0,    0,    0,    0,     0,     0,    0,    0,    0,    0,    0,    0.015]


initial_estimate_covariance: [0.2, 0,    0,    0,    0,    0,    0,    0,    0,    0,     0,     0,     0,    0,    0,
                              0,    0.2, 0,    0,    0,    0,    0,    0,    0,    0,     0,     0,     0,    0,    0,
                              0,    0,    1e-9, 0,    0,    0,    0,    0,    0,    0,     0,     0,     0,    0,    0,
                              0,    0,    0,    1e-9, 0,    0,    0,    0,    0,    0,     0,     0,     0,    0,    0,
                              0,    0,    0,    0,    1e-9, 0,    0,    0,    0,    0,     0,     0,     0,    0,    0,
                              0,    0,    0,    0,    0,    0.2, 0,    0,    0,    0,     0,     0,     0,    0,    0,
                              0,    0,    0,    0,    0,    0,    1e-9, 0,    0,    0,     0,     0,     0,    0,    0,
                              0,    0,    0,    0,    0,    0,    0,    1e-9, 0,    0,     0,     0,     0,    0,    0,
                              0,    0,    0,    0,    0,    0,    0,    0,    1e-9, 0,     0,     0,     0,    0,    0,
                              0,    0,    0,    0,    0,    0,    0,    0,    0,    1e-9,  0,     0,     0,    0,    0,
                              0,    0,    0,    0,    0,    0,    0,    0,    0,    0,     1e-9,  0,     0,    0,    0,
                              0,    0,    0,    0,    0,    0,    0,    0,    0,    0,     0,     1e-9,  0,    0,    0,
                              0,    0,    0,    0,    0,    0,    0,    0,    0,    0,     0,     0,     1e-9, 0,    0,
                              0,    0,    0,    0,    0,    0,    0,    0,    0,    0,     0,     0,     0,    1e-9, 0,
                              0,    0,    0,    0,    0,    0,    0,    0,    0,    0,     0,     0,     0,    0,    1e-9]

base local planner param

TrajectoryPlannerROS:

# Robot Configuration Parameters
  max_vel_x: 0.1
  min_vel_x: 0.08
  max_vel_theta:  1.0
  min_vel_theta: -1.0
  min_in_place_vel_theta: 1.0
  acc_lim_x: 0.1
  acc_lim_y: 0.0
  acc_lim_theta: 0.6
# Goal Tolerance Parameters
  xy_goal_tolerance: 0.4
  yaw_goal_tolerance: 0.2
# Differential-drive robot configuration
  holonomic_robot: false
# Forward Simulation Parameters
  sim_time: 0.8
  vx_samples: 18
  vtheta_samples: 20
  sim_granularity: 0.05

costmap commomn param

obstacle_range: 0.3
raytrace_range: 0.6

footprint: [[-0.105, -0.105], [-0.105, 0.105], [0.041, 0.105], [0.041, -0.105]]
#robot_radius: 0.105

inflation_radius: 1.0
cost_scaling_factor: 3.0
plugins: 
 - {name: static_layer,            type: "costmap_2d::StaticLayer"}

static_layer:
    map_topic: /map

dwa local planner

DWAPlannerROS:
# Robot Configuration Parameters
  max_vel_x: 0.5
  min_vel_x: 0.0
  max_vel_y: 0.0
  min_vel_y: 0.0
# The velocity when robot is moving in a straight line
  max_trans_vel:  0.5
  min_trans_vel:  0.1
  max_rot_vel: 2.75
  min_rot_vel: 1.37
  acc_lim_x: 2.5
  acc_lim_y: 0.0
  acc_lim_theta: 3.2 
# Goal Tolerance Parametes
  xy_goal_tolerance: 0.4
  yaw_goal_tolerance: 0.17
  latch_xy_goal_tolerance: false
# Forward Simulation Parameters
  sim_time: 1.5
  vx_samples: 20
  vy_samples: 0
  vth_samples: 40
  controller_frequency: 10.0
# Trajectory Scoring Parameters
  path_distance_bias: 32.0
  goal_distance_bias: 20.0
  occdist_scale: 0.05
  forward_point_distance: 0.325
  stop_time_buffer: 0.2
  scaling_speed: 0.25
  max_scaling_factor: 0.2
# Oscillation Prevention Parameters
  oscillation_reset_dist: 0.05
# Debugging
  publish_traj_pc : true
  publish_cost_grid_pc: true
  global_frame_id: odom

Global costmap param:

global_costmap:
  global_frame: odom
  robot_base_frame: base_footprint
  update_frequency: 5
  publish_frequency: 4
  transform_tolerance: 1
  static_map: true

Local costmap param:

local_costmap:
  global_frame: odom
  robot_base_frame: base_footprint
  update_frequency: 5
  publish_frequency: 4
  transform_tolerance: 1 
  static_map: false  
  rolling_window: true
  width: 5
  height: 5
  resolution: 0.03

Move base params:

shutdown_costmaps: false
controller_frequency: 5.0
planner_patience: 5.0
controller_patience: 3.0
conservative_reset_dist: 3.0
planner_frequency: 1
oscillation_timeout: 10.0
oscillation_distance: 0.2

A screenshots of rviz: As the bot keeps oscillating its position: image description image description

And tf tree:: image description

Asked by enthusiast.australia on 2019-10-08 06:35:13 UTC

Comments

Any particularly reason why you set both odom sources differential and relative to true while the documentation states that it is a possible source of oscillations?

Also: Who is publishing the tf from odom to base_link? robot_localization, the turtlebot3 node or both?

Asked by Humpelstilzchen on 2019-10-08 15:05:46 UTC

Currently what i observe is tf from odom to base_link is produced by both. This is what bothers me. I want just robot_localization to produce the tf tree as it is providing me the positioning information from both odometry and my exernal sensor. About first part of your comment, differential and relative for odom0 and odom1 both are false. Are they not? Or i am misunderstanding something?

Asked by enthusiast.australia on 2019-10-08 17:27:56 UTC

ok lets do one thing at a time. First you should make sure that you have only one publisher for each transformation or else once they deviate from one another you will the jumping between both positions. For tb3 I believe the transformation is provided by the OpenCR board, so it should be disabled in its firmware.

Asked by Humpelstilzchen on 2019-10-09 00:22:34 UTC

I am not sure how can i do that. Can you explain a little how to do that?

Asked by enthusiast.australia on 2019-10-09 04:35:00 UTC

I actually don't know that since I do not own an original tb3. But I would try to remove the line with tf_broadcaster.sendTransform(odom_tf); in turtlebot3_core.ino

Asked by Humpelstilzchen on 2019-10-09 11:37:43 UTC

When i go to raspberry pi of robot, i find this folder for OpenCR board, but i can only see the files and not able to edit. Any suggestions?

Burger_turtlebot3_core.ino.bin

This is the file, right? I am sorry, i am not very good in this, that's why ...

Asked by enthusiast.australia on 2019-10-10 06:33:07 UTC

ok this could take a little while. First you need an IDE for this. See (6.3.1.2 (Alternative) Arduino IDE You need top open and modify the file there.

Asked by Humpelstilzchen on 2019-10-10 11:10:24 UTC

Did you figure this out, or is this still an open question?

Asked by Tom Moore on 2020-01-02 05:06:35 UTC

Answers