0
$\begingroup$

I am trying to use the Gazebo plugin libgazebo_ros_p3d in order to record my robot's ground truth trajectory in Gazebo, but I haven't been able to get it to work. I have attempted solutions like in https://answers.gazebosim.org//question/5308/getting-the-gazebo-plugin-p3d-working-hydro/, but they don't work, and I am unable to see the topic which should be output by the plugin.

I am using ROS Noetic and Gazebo v11.11. I am also using a simulated Clearpath Jackal, the urdf/xacro file at https://github.com/jackal/jackal/blob/noetic-devel/jackal_description/urdf/jackal.urdf.xacro, and the following gazebo file.

jackal.gazebo

<?xml version="1.0"?>
<robot>
  <gazebo>
    <plugin name="gazebo_ros_control" filename="libgazebo_ros_control.so">
      <robotNamespace>/</robotNamespace>
    </plugin>
  </gazebo>

  <gazebo>
    <plugin name="imu_controller" filename="libhector_gazebo_ros_imu.so">
      <robotNamespace>/</robotNamespace>
      <updateRate>50.0</updateRate>
      <bodyName>imu_link</bodyName>
      <topicName>imu/data</topicName>
      <accelDrift>0.005 0.005 0.005</accelDrift>
      <accelGaussianNoise>0.005 0.005 0.005</accelGaussianNoise>
      <rateDrift>0.005 0.005 0.005 </rateDrift>
      <rateGaussianNoise>0.005 0.005 0.005 </rateGaussianNoise>
      <headingDrift>0.005</headingDrift>
      <headingGaussianNoise>0.005</headingGaussianNoise>
    </plugin>
  </gazebo>

  <gazebo>
    <plugin name="gps_controller" filename="libhector_gazebo_ros_gps.so">
      <updateRate>40</updateRate>
      <robotNamespace>/</robotNamespace>
      <bodyName>navsat_link</bodyName>
      <frameId>base_link</frameId>
      <topicName>/navsat/fix</topicName>
      <velocityTopicName>/navsat/vel</velocityTopicName>
      <referenceLatitude>$(optenv GAZEBO_WORLD_LAT 49.9)</referenceLatitude>
  <referenceLongitude>$(optenv GAZEBO_WORLD_LON 8.9)</referenceLongitude>
      <referenceHeading>90</referenceHeading>
      <referenceAltitude>0</referenceAltitude>
      <drift>0.0001 0.0001 0.0001</drift>
    </plugin>
  </gazebo>
  
  <!-- for ground truth trajectory --> 
  <gazebo>
    <plugin name="p3d_base_controller" filename="libgazebo_ros_p3d.so">
      <alwaysOn>true</alwaysOn>
      <updateRate>50.0</updateRate>
      <bodyName>base_link</bodyName>
      <topicName>ground_truth/state</topicName>
      <gaussianNoise>0.01</gaussianNoise>
      <frameName>world</frameName>
      <xyzOffsets>0 0 0</xyzOffsets>
      <rpyOffsets>0 0 0</rpyOffsets>
    </plugin>
  </gazebo>

  <gazebo reference="base_link">
    <turnGravityOff>false</turnGravityOff>
  </gazebo>

  <gazebo reference="chassis_link">
    <material>Gazebo/DarkGrey</material>
    <turnGravityOff>false</turnGravityOff>
  </gazebo>
  <gazebo reference="imu_link">
    <turnGravityOff>false</turnGravityOff>
  </gazebo>

  <gazebo reference="navsat_link">
    <material>Gazebo/DarkGrey</material>
    <turnGravityOff>false</turnGravityOff>
  </gazebo>
  <gazebo reference="front_fender_link">
    <material>Gazebo/Yellow</material>
    <turnGravityOff>false</turnGravityOff>
  </gazebo>
  <gazebo reference="rear_fender_link">
    <material>Gazebo/Yellow</material>
    <turnGravityOff>false</turnGravityOff>
  </gazebo>
</robot>

The other plugins in the file work just fine, and I can see their topics, but libgazebo_ros_p3d is not. If anyone could help me solve this issue, I would really appreciate it.

$\endgroup$

0

Your Answer

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

Browse other questions tagged or ask your own question.