ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
0

robot_localization not publishing map -> odom transformation

asked 2020-04-10 07:52:55 -0500

doekaschi gravatar image

Hello everyone,

I am trying to set up the localization pipline for my custom robot using the robot_localization package and gazebo. I am simulating a robot that has an IMU, Wheel Odometry and GPS in gazebo. I want to configure robot_localization so it publishes the odom -> base_link and map -> odom transformations. Currently, only the odom -> base_link is being published, although I also configured the map -> odom location node, including a navsat_transform_node to fuse the GPS.

This is the launchfile that I am using to start the localizations:

<launch>
  <!-- Node that publishes the odom -> base_link transform -->
  <node pkg="robot_localization" type="ekf_localization_node" name="ekf_local" ns="/mowro/localisation/" clear_params="true">
    <rosparam command="load" file="$(find mowro_tf)/config/ekf_template.yaml" />
    <remap from="odometry/filtered" to="/mowro/localisation/local/odometry/filtered"/>
  </node>

  <!-- Node that generates transforms gps coordinates -->
  <node pkg="robot_localization" type="navsat_transform_node" name="navsat_transform" ns="/mowro/" respawn="true">
    <param name="magnetic_declination_radians" value="0"/>
    <param name="yaw_offset" value="0"/>
    <param name="broadcast_utm_transform" value="false"/>
    <param name="publish_filtered_gps" value="false"/>

    <remap from="/mowro/imu/data" to="/mowro/imu" />
    <remap from="/mowro/gps/fix" to="/mowro/gps" />
    <remap from="/mowro/odometry/filtered" to="/mowro/localisation/local/odometry/filtered" />

  </node>

  <!-- Node that publishes the map -> odom transform -->
  <node pkg="robot_localization" type="ekf_localization_node" name="ekf_global" ns="/mowro/localisation/" clear_params="true">
    <rosparam command="load" file="$(find mowro_tf)/config/ekf_template_map.yaml" />

    <remap from="/mowro/localisation/odometry/filtered" to="/mowro/localisation/global/odometry/filtered" />
  </node>
</launch>

This is my configuration file for the odom -> base_link localization node:

frequency: 30
sensor_timeout: 0.1
two_d_mode: true
transform_time_offset: 0.5
transform_timeout: 0.0
print_diagnostics: true
debug: false

publish_tf: true
publish_acceleration: false
map_frame: map      
odom_frame: mowro/odom          
base_link_frame: base_link 
world_frame: mowro/odom  

odom0: /mowro/odom
odom0_config: [true,  true,  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

use_control: true
stamped_control: false
control_config: [true, false, false, false, false, true]
acceleration_limits: [1.3, 0.0, 0.0, 0.0, 0.0, 3.4]
deceleration_limits: [1.3, 0.0, 0.0, 0.0, 0.0, 4.5]
acceleration_gains: [0.8, 0.0, 0.0, 0.0, 0.0, 0.9]
deceleration_gains: [1.0, 0.0, 0.0, 0.0, 0.0, 1.0]

[Covariance matrices have been left out to improve readability]

This is my configuration file for the map -> odom localization node:

frequency: 30
sensor_timeout: 0.1
two_d_mode: true
transform_time_offset: 0.5
transform_timeout: 0.0
print_diagnostics: true
debug: false
publish_tf: true
publish_acceleration: false

map_frame: map
odom_frame: mowro/odom
base_link_frame: base_link
world_frame: map

odom0: /mowro/odometry/gps
odom0_config: [true,  true,  false,
               false, false, false,
               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

use_control: false
stamped_control: false
control_timeout: 0.2
control_config: [true, false, false, false, false, true]
acceleration_limits: [1 ...
(more)
edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2020-04-10 09:46:28 -0500

Dragonslayer gravatar image

Hi, have a look here ->link text

ekf node is used for sensorfusion, you only pass in one source odom in one case gps in another. You can just use odom topic for whatever you use the output of the ekf node in your case, or fuse it with IMU data. Fusing gps with odom is a whole topic on its own (you might already know this link text ).Sensorfusion is made to get higher quality data in general. The localization you seem to be looking for is usually published by nodes like acml, rtabmap etc. (have a read here: link text there output is used to correct odom errors that accumulate over time, this approaches should be more accurate then gps by a lot, also Iam not sure gazebeo simulates gps at all (hector_gazebo_plugin, seems to do the trick for some). Base_footprint should be connected to base_link its a flat 2d projection of base_link (for 2d navigation), might not even be nessesary in your case ("base_footprint provides a fairly stable 2D planar representation of the humanoid even while walking and swaying with the base_link.") link text. Finally you need a node to serve a map, as there can be no transform without one. (link text) The map you start in gazebo is not the map the robot gets but only the simulated environment the robot has no clue of, before he maps it himself. Without a map the robot has no space to operate in and in general it doesnt even need to have been maped, just an empty grid map served by a map_server could be enough depending on what you are after. All the best.

edit flag offensive delete link more

Comments

Hello, thank you for your response. To simulate GPS with Gazebo I use the hector gazebo plugin as you already mentioned. I know that the location estimation node is not made for "fusing" sensor data with only one input, but I want to simulate other sensors later on and want to include them, this was just my try to get a minimal working example. I though, using only one input per localization node is no problem, or is it? And I also thought that it would be possible to publish a transform from /map to /odom without having a map server running, because I am able to publish a static transform from /map to /odom, or am I wrong there, too?

Thanks a lot for your response.

doekaschi gravatar image doekaschi  ( 2020-04-10 10:52:44 -0500 )edit

I see, maybe its even as simple as changing the node order in the launch file. You start the map->odom after the others. I have never seen such an approach without a slam or localization node. I would try to just publish an empty map via map_server, sooner or later you are likely to do slam or localization anyway i assume. Also a try with a static transform instead of the ekf map->odom might be worth it.

<launch>

<node pkg="tf" type="static_transform_publisher" name="map_to_odom_transformer" args="0 0 0 0 0 0 0 /map /mowro/odom 100"/>

</launch>

best regards

Dragonslayer gravatar image Dragonslayer  ( 2020-04-10 14:55:23 -0500 )edit

Question Tools

1 follower

Stats

Asked: 2020-04-10 07:52:55 -0500

Seen: 1,249 times

Last updated: Apr 10 '20