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

robot_localization/ekf_localization when working with namespaces

asked 2016-03-12 10:52:03 -0600

Omer gravatar image


I am working on Clearpath's Jackal now and trying to spawn it on a Gazebo world with another robot. For that (as far as I understand) I need to use namespaces (one for each robot). I have taken the original launch files provided by Clearpath and tried to modify them. I have noticed that in jackal_control/control.launch they launch the ekf_localization node. When I comment out this line - everything works, but when it's not commented, things don't work.

The bottom line of my question: what do I need to do in order to work with the ekf_localization node in a namespace? I tried to simply wrap it in a namespace and it didn't work. I tried to define a tf_prefix and it also didn't help.


edit retag flag offensive close merge delete


Perhaps you could give us more detail? When you say it "doesn't work," what do you mean?

Tom Moore gravatar image Tom Moore  ( 2016-03-13 12:25:51 -0600 )edit

Either one of two things happens: my Gazebo world doesn't open or it does open and gets hung a few seconds later (when I'm trying to change the field of view)

Omer gravatar image Omer  ( 2016-03-14 16:50:59 -0600 )edit

I'm sorry, do you mean to say that you're not having trouble with robot_localization, but with Gazebo?

Tom Moore gravatar image Tom Moore  ( 2016-03-20 17:21:59 -0600 )edit

1 Answer

Sort by ยป oldest newest most voted

answered 2016-03-12 12:16:46 -0600

Hi Omer,

What I understand from your question is that you want to launch two instances of robot_localization for two different robots by launching then under different name_spaces.

To launch the robot_localization node under a name_space you can use <group> tag or you can pass argument __ns (args="__ns=name_space"). After this your launch file would include:

<node ns="bot1" pkg="robot_localization" type="ekf_localization_node" name="ekf_localization">
  <rosparam command="load" file="$(find jackal_control)/config/robot_localization_bot1.yaml" />
<node ns="bot2" pkg="robot_localization" type="ekf_localization_node" name="ekf_localization">
 <rosparam command="load" file="$(find jackal_control)/config/robot_localization_bot2.yaml" />

after this you would need to modify your yaml files accordingly,

frequency: 50
odom0: /jackal_velocity_controller/odom   #odom source for respective robot
odom0_config: [false, false, false,
false, false, false,
true, true, true,
false, false, true,
false, false, false]
odom0_differential: false
imu0: /imu/data #imu source for respective bot
imu0_config: [false, false, false,
true, true, true,
false, false, false,
true, true, true,
false, false, false]
imu0_differential: false
odom_frame: odom  # fixed frame for robot (this can be same for both)
base_link_frame: base_link #fixed frame for robot (this should be diffenret for both)
world_frame: odom #again same is fine

make sure that you publish static transforms between IMU frame and baselink for both the robots

Hope this helps.

edit flag offensive delete link more


Thanks Sudeep. I have tried what you suggested but it still doesn't work. By the way, what changes do I need in the yaml file?

Omer gravatar image Omer  ( 2016-03-12 14:33:23 -0600 )edit

As mentioned in Answer, major changes would be odom0, imu0, odom_frame, base_link_frame, world_frame @Omer

Sudeep gravatar image Sudeep  ( 2016-03-13 05:05:04 -0600 )edit

Question Tools


Asked: 2016-03-12 10:52:03 -0600

Seen: 922 times

Last updated: Mar 12 '16