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

dynamically change the source of transformation(tf)

asked 2015-09-30 16:38:03 -0500

Naman gravatar image

updated 2015-10-22 09:41:32 -0500

Hi all,

I have a mobile robot with different sensors on it like Rotary Encoders, IMU, Kinect, Hokuyo Lidar and Ultrawide band. I am using robot_pose_ekf to get the odom_combined -> base_footprint transformation and I have a fixed transformation from base_footprint -> base_link. I have two sources of map->odom_combined transformation : amcl and robot_localization (running with world_frame as map) with inputs from Rotary encoders(odometry data), IMU (They are in the odom_combined frame) and UWB sensor (Its in the map_frame). Now, I have a condition and when it is satisfied, I want to use amcl and when another condition is satisfied, I want to use robot_localization. For example when the robot is in a corridor, I want to use amcl because Laser scan is available whereas if the robot is in a big hall where there is no laser scan because there are no walls within the range of the Hokuyo Lidar (Its range is 5m), I want to use robot_localization (which uses Ultrawide band sensor). So, I want to dynamically change which map->odom_combined transformation source I am using based on my criterion. What is the best way to do something like this?

Update 1:
a) If I give amcl output as input to robot_localization and in the case when I am not broadcasting amcl (meaning the values on the /amcl_pose topic are not changing), will robot_localization ignore amcl and continue without it? The same thing goes with UWB sensor.
b) Also, I am getting absolute pose measurements from amcl and UWB sensor, can I set both of their differential parameters as false? Most of the time, I will be using only one of the inputs (either UWB or amcl) but there is definitely a possibility that there will be times, I will be using both. The problem with setting differential for one of them as true is that when I am using only that particular input, I have no absolute measurement as input to robot_localization. Also, in that case I can not set initial pose of the robot.

Update 2:

Are you saying that amcl stops sending messages when its output is not changing?

No, I meant under the condition when I don't have to use amcl, I can tell amcl not to publish anything on the amcl_pose topic and yes, I will always have wheel odometry and IMU data.

To be more clear, I have 4 inputs to the second instance of robot_localization (first instance takes wheel odometry and IMU data and gives odom->base_link tf) : wheel odometry, IMU, UWB sensor and AMCL. The reason I said that I want both UWB and AMCL as absolute (not differential) because in cases where I am using only one of them and it is differential (For example if AMCL differential = true and I am using wheel odometry, IMU and AMCL, then differential for all 3 sources is true), then I don't have any absolute source of pose measurement (I am not sure whether this is okay or not) to ... (more)

edit retag flag offensive close merge delete


Hi, I also want to do something similar. Were you able to figure it out? TIA

JonathanGill gravatar image JonathanGill  ( 2015-10-08 13:32:42 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted

answered 2015-10-16 07:26:06 -0500

Tom Moore gravatar image

updated 2015-10-22 08:01:53 -0500

Perhaps you should let robot_localization always publish that transform, and just feed it the amcl output as its input. Then, you can modify the amcl source to look for the condition you mentioned, and only broadcast its output when that condition is (or is not) satisfied.

EDIT in response to update 1:

(a) Are you saying that amcl stops sending messages when its output is not changing? Yes, the EKF/UKF will continue to estimate your vehicle's state, but I would make sure that some other sensor is providing measurements during those outings, even if it's just wheel encoder odometry. (b) If you have two sources of pose information coming in and differential mode is off, then you need to make sure their covariances are set accordingly. If the sensors disagree strongly on your pose and they both are under-reporting their covariances, then you're going to see the filter output jump back and forth between them as it receives measurements.

edit flag offensive delete link more


Thanks @Tom Moore for the answer.. I have updated my original question.. Can you have a look.. TIA!

Naman gravatar image Naman  ( 2015-10-16 09:02:57 -0500 )edit

Question Tools



Asked: 2015-09-30 16:38:03 -0500

Seen: 730 times

Last updated: Oct 22 '15