0
$\begingroup$

Rosanswers logo

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.
[ WARN] [1617652673.364580966, 1555.740000000]: Could not obtain transform from base_link to jackal1/base_link. Error was "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?


Originally posted by pointsnadpixels on ROS Answers with karma: 23 on 2021-04-05

Post score: 0


Original comments

Comment by tryan on 2021-04-06:
It shouldn't matter what you name it as long as everything is consistent. Do any of your sensor messages reference base_link?

Comment by pointsnadpixels on 2021-04-06:
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" />

Comment by skpro19 on 2021-04-06:
Can you please try this -

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

$\endgroup$

1 Answer 1

0
$\begingroup$

Rosanswers logo

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.


Originally posted by tryan with karma: 1421 on 2021-04-06

This answer was ACCEPTED on the original site

Post score: 2


Original comments

Comment by pointsnadpixels on 2021-04-06:
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?

Comment by tryan on 2021-04-06:
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.

Comment by pointsnadpixels on 2021-04-06:
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

Comment by tryan on 2021-04-06:
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.

Comment by pointsnadpixels on 2021-04-06:
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?

Comment by tryan on 2021-04-06:
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.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.