Ask Your Question
0

Warnings with base_link in namespace for robot_localization

asked 2021-04-05 16:22:34 -0500

pointsnadpixels gravatar image

updated 2021-04-06 09:07:51 -0500

tryan gravatar image

Hello,

<group if="$(arg enable_ekf)" > 
  <node pkg="robot_localization" type="ekf_localization_node" name="ekf_localization"  >
    <rosparam command="load" file="$(arg ekf_yaml_path)" />
    <param name="map_frame"       value="map"/>
    <param name="odom_frame"      value="$(arg ns)/odom"/>
    <param name="base_link_frame" value="$(arg ns)/base_link"/>
    <param name="world_frame"     value="$(arg ns)/odom"/>
  </node>
</group>

The above are the relevant lines in my launch file, but when I try it to run it, there are warnings thrown and the functionality is not as expected. The warnings are as below:

[WARN] [1617652671.519795535, 1553.900000000]: Could not obtain transform from base_link to jackal2/base_link. Error was "base_link" passed to lookupTransform argument source_frame does not exist.
"base_link" passed to lookupTransform argument source_frame does not exist.

I don't understand why these would come up since I am specifically assigning a base_link_frame. Why does it matter if "base_link" exists or not?

edit retag flag offensive close merge delete

Comments

It shouldn't matter what you name it as long as everything is consistent. Do any of your sensor messages reference base_link?

tryan gravatar image tryan  ( 2021-04-06 09:11:58 -0500 )edit

Looks like the velocity controller which is used by the ekf sends 'odom' with 'base_link' header, instead of robot_namespace/base_link. Any idea how I could correct this?

Below is how I spawn the controllers.

<node name="controller\_spawner" pkg="controller\_manager" type="spawner" args="jackal\_joint\_publisher jackal\_velocity\_controller" />

pointsnadpixels gravatar image pointsnadpixels  ( 2021-04-06 12:42:29 -0500 )edit

Can you please try this -

<node name="controller\_spawner" pkg="controller\_manager" type="spawner" args="jackal\_joint\_publisher jackal\_velocity\_controller" ns="$(arg ns)" />

skpro19 gravatar image skpro19  ( 2021-04-06 14:25:52 -0500 )edit

2 Answers

Sort by ยป oldest newest most voted
1

answered 2021-04-06 13:02:00 -0500

tryan gravatar image

updated 2021-04-06 13:10:51 -0500

It looks like the Jackal uses diff_drive_controller as the jackal_velocity_controller (see jackal_control/config/control.yaml). Your name looks slightly different, so please confirm this is correct for your setup. If it is, you can set the base_frame_id parameter in the controller configuration as mentioned in the diff_drive_controller documentation:

base_frame_id (string, default: base_link)
Base frame_id, which is used to fill in the child_frame_id of the Odometry messages and TF.

edit flag offensive delete link more

Comments

Thank you! This was exactly what I was looking for. But it seems that my IMU publishes to 'base_link' rather than 'jackalx/base_link'. Do you know where I can change that?

pointsnadpixels gravatar image pointsnadpixels  ( 2021-04-06 15:19:23 -0500 )edit

That's likely a parameter in the IMU driver itself. I took a quick look and didn't see where that would be configured. I thought it would be in jackal_base/launch/base.launch (link), but I don't see the publisher of /imu/data_raw there. For simulations, the Jackal uses the IMU from hector_gazebo_plugins ([see jackal_description/urdf/jackal.gazebo])(https://github.com/jackal/jackal/blob/3b07ca0c1cba1856d0774923d28b6790a3fbdd6d/jackal_description/urdf/jackal.gazebo#L10)). Sorry, I can't help more with that.

tryan gravatar image tryan  ( 2021-04-06 16:24:37 -0500 )edit

Yeah, I saw that it was in the jackal.gazebo file, but there seems to be no similar parameter there where I can specify the base_frameID. Thank you for your help anyway. Maybe I can write another node to republish this data to the correct frames

pointsnadpixels gravatar image pointsnadpixels  ( 2021-04-06 16:32:45 -0500 )edit

I'm not familiar enough with Jackals to know if they are set up to handle namespaces and/or tf_prefix properly, but this seems like the kind of situation where they would be helpful.

Another (hacky) option would be to use a topic_tools/transform node and manually change the frame_id.

tryan gravatar image tryan  ( 2021-04-06 16:34:28 -0500 )edit

Thanks again, for your help. If I mention a frame ID in the jackal_description/urdf/jackal.gazebo file, it does change the IMU frame ID published messages. Do you have any idea how I can pass that as a parameter to the jackal.gazebo file?

pointsnadpixels gravatar image pointsnadpixels  ( 2021-04-06 16:44:51 -0500 )edit
1

You can use arguments in xacro like this:

<?xml version="1.0"?>
<robot>
  <xacro:arg name="imu_body" default="imu_link" />
  ...
  <gazebo>
    <plugin name="imu_controller" filename="libhector_gazebo_ros_imu.so">
      ...
      <bodyName>$(arg imu_body)</bodyName>
      ...
    </plugin>
  </gazebo>
  ...
</robot>

Then you can use it in a launch file like this:

<param name="robot_description" command="$(find xacro)/xacro path/to/model.urdf.xacro imu_body:=different_link" />

I didn't actually try this with the Jackal code, so there may be some extra steps (e.g., propagating the argument through includes if necessary). Note that you could implement different_link as an argument from the launch file, too.

tryan gravatar image tryan  ( 2021-04-06 20:32:09 -0500 )edit
0

answered 2021-04-06 09:53:51 -0500

Akhil Kurup gravatar image

Where have you defined your ns? I'm assuming it is 'jackal2'?

It seems that the references to your base_link's aren't consistent. Try running rosrun tf view_frames to generate a pdf and view your entire tf tree. That might shed some light into your issue and make debugging easier

edit flag offensive delete link more

Comments

You're right, I've replied to a previous comment as to what is happening, although the tf tree seems to be okay

pointsnadpixels gravatar image pointsnadpixels  ( 2021-04-06 12:43:04 -0500 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 2021-04-05 16:22:34 -0500

Seen: 29 times

Last updated: Apr 06