Robotics StackExchange | Archived questions

libhector_gazebo_ros_imu doesn't like namespaces

Hi, I am trying to run a multi-robot simulation, I've got everything working right so far except for the imu which I am using from libhectorgazeboros_imu.so

My Macro is like this:

<xacro:macro name="imu_gazebo" params="link imu_topic update_rate">
<link name="${link}" />
<gazebo>
  <plugin name="imu_plugin" filename="libhector_gazebo_ros_imu.so">
    <updateRate>${update_rate}</updateRate>
    <bodyName>${link}</bodyName>
    <frameId>${link}</frameId>
    <topicName>${imu_topic}</topicName>
    <accelDrift>0.0 0.0 0.0</accelDrift>
    <accelGaussianNoise>${sqrt(5e-05)} ${sqrt(0.0001)} ${sqrt(0.00013)}</accelGaussianNoise>
    <rateDrift>0.0 0.0 0.0</rateDrift>
    <rateGaussianNoise>${sqrt(8e-06)} ${sqrt(8e-06)} ${sqrt(3e-07)}</rateGaussianNoise>
    <yawDrift>0.0</yawDrift>
    <yawGaussianNoise>${sqrt(0.1)}</yawGaussianNoise>
  </plugin>
</gazebo>

/xacro:macro

The topics are published with respect to their namespaces like: /robot1/imudata and /robot2/imudata but the frameid is the same for both: just imuframe. How can I add the robot namespace to the frame_id of the topic knowing that I am using the same URDF for all the robots.

I am including the macro like this:

    <xacro:imu_gazebo link="imu_link" imu_topic="imu_data" update_rate="50.0"/>

Info: my laser scans are configured the same and they work perfectly having unique topics and unique frame names.

Asked by Ammar Albakri on 2022-11-23 03:53:56 UTC

Comments

How do you include the macro? Can you show the xacro where it is used?

Asked by ct2034 on 2022-11-23 17:39:19 UTC

Answers

The libhector_gazebo_ros_imu.so seems to have no frameId parameter, according to http://wiki.ros.org/hector_gazebo_plugins#XML_Parameters try setting robotNamespace instead.

Asked by ct2034 on 2022-11-24 02:10:31 UTC

Comments

If I don't give a frameID it defaults to base_footprint, I can't change it any other way.

Asked by Ammar Albakri on 2022-11-24 05:58:58 UTC

What happens if you set robotNamespace, thought?

Asked by ct2034 on 2022-11-24 09:55:47 UTC

all the topics and services get the robotNamespace prefix for all robot (still because I am using the same URDF for all robots) but the frame_id in the topic is still just imu_link, no prefix no nothing

Asked by Ammar Albakri on 2022-11-25 01:04:02 UTC