ekf_localization_node publishes /odom->husky_1/base_link transform instead of husky_1/odom->/husky_1/base_link transform
I have an arg
named husky_ns
defined in my launch file. I have set it to husky_1
.
Using the ekf_localization_node
(from the robot_localization package), I want to publish the husky_1/odom
to /husky_1/base_link
transform on the tf
tree.
I have tried the following variations inside my launch
file to achieve the same -
Variation One
<node pkg="robot_localization" type="ekf_localization_node" name="ekf_localization" ns="$(arg husky_ns)">
<rosparam command="load" file="$(find bot_mapper)/config/localization.yaml" subst_value="true" />
</node>
This variation produces /odom
to /base_link
transform on the tf
tree.
Variation Two
<node pkg="robot_localization" type="ekf_localization_node" name="ekf_localization" >
<param name="tf_prefix" value="$(arg husky_ns)" />
<rosparam command="load" file="$(find bot_mapper)/config/localization.yaml" subst_value="true" />
</node>
This variation does not add any new transform to the tf
tree.
This is how my localization.yaml
file looks -
odom_frame: odom
base_link_frame: base_link
world_frame: odom
two_d_mode: true
frequency: 50
odom0: husky_velocity_controller/odom
odom0_config: [false, false, false,
false, false, false,
true, true, true,
false, false, true,
false, false, false]
odom0_differential: false
odom0_queue_size: 10
imu0: imu/data
imu0_config: [false, false, false,
true, true, true,
false, false, false,
true, true, true,
false, false, false]
imu0_differential: true
imu0_queue_size: 10
imu0_remove_gravitational_acceleration: true
FYI tf_prefix does not look to be a parameter in robot_localization so idk what that is doing in your "second" config.
I don't know if this will translate to the tf tree, but in general if you have a husky_1 and husky_2 you should be using the group tag with the "ns" attribute to separate the nodes/topics/parameters between the two
@JackB There was a typo in my variation one. I have updated variation one. (I had missed to add
ns=$(arg husky_ns)
)So, the bottom line is when I include the
ns="$(arg husky_ns)"
in the node tag,ekf_localization_node
does prodcue a transform, but from/odom
to/base_link
. When I do not includens=$(arg husky_ns)
, no transform is published by theekf_localization_node
.When I modify the
base_link_frame
param
inlocalization.yaml
frombase_link
to$(arg husky_ns)/base_link
(in variation one), I get this constant warning in my terminal and no transform is published on thetf
tree -@JackB how did you figure out whether
tf_prefix
is a paramter inekf_localization_node
?Look at the docs robot_localization, they are all listed therer
I am not sure if I understrand your problem however are you trying to remap it ? if yes you can use the following code in your launch file
<remap from="odometry/filtered" to=""/> <remap from="accel/filtered" to=""/>
in addtion, after you launch your nodes you can use "rosrun rqt_tf_tree rqt_tf_tree" in order to generate the trees and see if the relations are correct or not
I am trying to make
ekf_localization_node
publishhuky_1/odom -> /husky_1/base_link
transform. It currently publishes a transform from/odom -> /base_link
.Does that make sense?
@JackB I did manage to make the
ekf_localization_node
publish the/husky_1/odom -> /husky_1/base_link
transform. How do I make sure that the transform being published by theekf_localization_node
is correct i.e. the bot is being localized correctly?