Navigation stack and robot_localization integration problems

asked 2019-10-08 06:35:13 -0500

enthusiast.australia gravatar image

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 robot_localization, 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 robot_localization, 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>

Ekf_template launch file for robot_localization

<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 ...
(more)
edit retag flag offensive close merge delete

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?

Humpelstilzchen gravatar imageHumpelstilzchen ( 2019-10-08 15:05:46 -0500 )edit

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?

enthusiast.australia gravatar imageenthusiast.australia ( 2019-10-08 17:27:56 -0500 )edit

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.

Humpelstilzchen gravatar imageHumpelstilzchen ( 2019-10-09 00:22:34 -0500 )edit

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

enthusiast.australia gravatar imageenthusiast.australia ( 2019-10-09 04:35:00 -0500 )edit

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

Humpelstilzchen gravatar imageHumpelstilzchen ( 2019-10-09 11:37:43 -0500 )edit

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 ...

enthusiast.australia gravatar imageenthusiast.australia ( 2019-10-10 06:33:07 -0500 )edit

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.

Humpelstilzchen gravatar imageHumpelstilzchen ( 2019-10-10 11:10:24 -0500 )edit