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

Rostopic not created for GPS plugin if reference is added to gazebo tag

asked 2022-02-07 03:09:59 -0600

hn_on_fire gravatar image

I'm using Ros Noetic along with Gazebo11. The following snippet of code doesn't create the /gps/fix topic:

<gazebo reference ="base_link">
    <plugin name="gazebo_ros_gps" filename="libhector_gazebo_ros_gps.so">
        <alwaysOn>true</alwaysOn>
        <updateRate>100.0</updateRate>
        <robotNamespace>/bot</robotNamespace>
        <bodyName>base_link</bodyName>
        <topicName>/gps/fix</topicName>
        <velocityTopicName>/gps/fix_velocity</velocityTopicName>
        <drift>0.001 0.001 0.001</drift>
        <gaussianNoise>0.05 0.05 0.05</gaussianNoise>
        <velocityDrift>0.001 0.001 0.001</velocityDrift>
        <velocityGaussianNoise>0.5 0.5 0.5</velocityGaussianNoise>
    </plugin>
</gazebo>

I am aware that adding the reference is not required and is redundant as <bodyName> tag is required. However, I do not understand why it'd prevent the topic being created. The code runs as expected if the reference is removed.

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2022-02-07 12:37:44 -0600

osilva gravatar image

Hi @hn_on_fire

Try changing the body name, most likely you already have something called base_link to something like sensor

   <gazebo>
            <plugin name="gazebo_ros_gps" filename="libhector_gazebo_ros_gps.so">
                <alwaysOn>true</alwaysOn>
                <updateRate>100.0</updateRate>
                <robotNamespace>/bot</robotNamespace>
                <bodyName>sensor</bodyName>
                <frameId>sensor</frameId>
                <topicName>/gps/fix</topicName>
                <velocityTopicName>/gps/fix_velocity</velocityTopicName>
                <drift>0.001 0.001 0.001</drift>
                <gaussianNoise>0.05 0.05 0.05</gaussianNoise>
                <velocityDrift>0.001 0.001 0.001</velocityDrift>
                <velocityGaussianNoise>0.5 0.5 0.5</velocityGaussianNoise>

            </plugin>
        </gazebo>
edit flag offensive delete link more

Comments

Removing the reference from the gazebo tag (as you have) works just fine! I'm confused why does adding a reference cause a problem(yes, I'm aware that adding the reference is redundant but why does it not allow the topic from being created?). Changing the sensor name(but adding the reference) gives the same error.

hn_on_fire gravatar image hn_on_fire  ( 2022-02-07 16:17:48 -0600 )edit

Question Tools

Stats

Asked: 2022-02-07 03:02:27 -0600

Seen: 172 times

Last updated: Feb 07 '22