Gazebo plugins in ROS Gazebo plugins in ROS

Aster
人工智能领域新星创作者
2023-01-18 10:58:20

https://classic.gazebosim.org/tutorials?tut=ros_gzplugins

 

Adding a ModelPlugin

In short, the ModelPlugin is inserted in the URDF inside the <robot> element. It is wrapped with the <gazebo> pill, to indicate information passed to Gazebo. For example:

<robot>
  ... robot description ...
  <gazebo>
    <plugin name="differential_drive_controller" filename="libdiffdrive_plugin.so">
      ... plugin parameters ...
    </plugin>
  </gazebo>
  ... robot description ...
</robot>

Upon loading the robot model within Gazebo, the diffdrive_plugin code will be given a reference to the model itself, allowing it to manipulate it. Also, it will be give a reference to the SDF element of itself, in order to read the plugin parameters passed to it.

Adding a SensorPlugin

Specifying sensor plugins is slightly different. Sensors in Gazebo are meant to be attached to links, so the <gazebo> element describing that sensor must be given a reference to that link. For example:

<robot>
  ... robot description ...
  <link name="sensor_link">
    ... link description ...
  </link>

  <gazebo reference="sensor_link">
    <sensor type="camera" name="camera1">
      ... sensor parameters ...
      <plugin name="camera_controller" filename="libgazebo_ros_camera.so">
        ... plugin parameters ..
      </plugin>
    </sensor>
  </gazebo>

</robot>

Upon loading the robot model within Gazebo, the camera_controller code will be given a reference to the sensor, providing access to its API. Also, it will be give a reference to the SDF element of itself, in order to read the plugin parameters passed to it.

...全文
28 回复 打赏 收藏 转发到动态 举报
写回复
回复
切换为时间正序
请发表友善的回复…
发表回复

61

社区成员

发帖
与我相关
我的任务
社区描述
基于NVIDIA的DeepStream SDK开发技术交流社区。通过DeepStream可从USB/CSI/RTSP相机中获取流数据,用于快速构建具有AI能力的应用程序。
自动驾驶pytorch边缘计算 个人社区 陕西省·西安市
社区管理员
  • 鼾声鼾语
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告