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.

...全文
113 回复 打赏 收藏 转发到动态 举报
写回复
用AI写文章
回复
切换为时间正序
请发表友善的回复…
发表回复
Design, build and simulate complex robots using Robot Operating System and master its out-of-the-box functionalities About This Book Develop complex robotic applications using ROS for interfacing robot manipulators and mobile robots with the help of high end robotic sensors Gain insights into autonomous navigation in mobile robot and motion planning in robot manipulators Discover the best practices and troubleshooting solutions everyone needs when working on ROS Who This Book Is For If you are a robotics enthusiast or researcher who wants to learn more about building robot applications using ROS, this book is for you. In order to learn from this book, you should have a basic knowledge of ROS, GNU/Linux, and C++ programming concepts. The book will also be good for programmers who want to explore the advanced features of ROS. Table of Contents Chapter 1: Introduction to ROS and Its Package Management Chapter 2: Working with 3D Robot Modeling in ROS Chapter 3: Simulating Robots Using ROS and Gazebo Chapter 4: Using the ROS MoveIt! and Navigation Stack Chapter 5: Working with Pluginlib, Nodelets, and Gazebo Plugins Chapter 6: Writing ROS Controllers and Visualization Plugins Chapter 7: Interfacing I/O Boards, Sensors, and Actuators to ROS Chapter 8: Programming Vision Sensors using ROS, Open-CV, and PCL Chapter 9: Building and Interfacing Differential Drive Mobile Robot Hardware in ROS Chapter 10: Exploring the Advanced Capabilities of ROS-MoveIt! Chapter 11: ROS for Industrial Robots Chapter 12: Troubleshooting and Best Practices in ROS

64

社区成员

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

试试用AI创作助手写篇文章吧