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

libhector_gazebo_ros_imu doesn't like namespaces

asked 2022-11-23 02:53:56 -0500

Ammar Albakri gravatar image

updated 2022-11-24 09:16:43 -0500

ljaniec gravatar image

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 libhector_gazebo_ros_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/imu_data and /robot2/imu_data but the frame_id is the same for both: just imu_frame. 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.

edit retag flag offensive close merge delete

Comments

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

ct2034 gravatar image ct2034  ( 2022-11-23 16:39:19 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted
0

answered 2022-11-24 01:10:31 -0500

ct2034 gravatar image

updated 2022-11-24 08:55:59 -0500

The libhector_gazebo_ros_imu.so seems to have no frameIdparameter, according to http://wiki.ros.org/hector_gazebo_plu... try setting robotNamespace instead.

edit flag offensive delete link more

Comments

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

Ammar Albakri gravatar image Ammar Albakri  ( 2022-11-24 04:58:58 -0500 )edit

What happens if you set robotNamespace, thought?

ct2034 gravatar image ct2034  ( 2022-11-24 08:55:47 -0500 )edit

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

Ammar Albakri gravatar image Ammar Albakri  ( 2022-11-25 00:04:02 -0500 )edit

Question Tools

1 follower

Stats

Asked: 2022-11-23 02:53:56 -0500

Seen: 124 times

Last updated: Nov 24 '22