dynamically change the source of transformation(tf)
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 ...
Hi, I also want to do something similar. Were you able to figure it out? TIA