Gazebo plugins in ROS

Tutorial: Using Gazebo plugins with ROS

http://gazebosim.org/tutorials?tut=ros_gzplugins

Plugin Types

Gazebo supports several plugin types, and all of them can be connected to ROS, but only a few types can be referenced through a URDF file:

  1. ModelPlugins, to provide access to the physics::Model API
  2. SensorPlugins, to provide access to the sensors::Sensor API
  3. VisualPlugins, to provide access to the rendering::Visual API

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.

Plugins available in gazebo_plugins

Camera

Description: provides ROS interface for simulating cameras such as wge100camera by publishing the CameraInfo and Image ROS messages as described in sensormsgs.

Multicamera

Description: synchronizes multiple camera's shutters such that they publish their images together. Typically used for stereo cameras, uses a very similar interface as the plain Camera plugin

Note: currently only supports stereo cameras.

Depth Camera

Description: simulates a sensor like a Kinect, which is duplicated in the Kinect plugin. Will probably be merged in the future.

Openni Kinect

Description: simulates a Microsoft Kinect, publishes the same topics as the corresponding ROS drivers for the Microsoft kinect as documented in the Fuerte documentation here.

GPU Laser

Description: simulates laser range sensor by broadcasting LaserScan message as described in sensor_msgs. See Hokuyo Laser Scanners Reference.

Laser

Description: the non-GPU version of GPU Laser, but essentially uses the same code. See GPU Laser for documentation.

Block Laser

Description: provides grid style laser range scanner simulation (e.g. Velodyne).

F3D (Force Feedback Ground Truth)

Description: broadcasts external forces on a body in simulation over WrenchStamped message as described in geometry_msgs.

Force

Description: ROS interface for applying Wrench (geometry_msgs) on a body in simulation.

IMU (GazeboRosImu)

Description: simulates IMU sensor. Measurements are computed by the ROS plugin, not by Gazebo.

IMU sensor (GazeboRosImuSensor)

Description: simulates an Inertial Motion Unit sensor, the main differences from IMU (GazeboRosIMU) are: - inheritance from SensorPlugin instead of ModelPlugin, - measurements are given by gazebo ImuSensor instead of being computed by the ros plugin, - gravity is included in inertial measurements.

Joint Pose Trajectory

Description: listens to a jointtrajectoryaction and plays back the set of joint positions. Sets the set of joints to exact positions without regards to simulated physics and forces.

P3D (3D Position Interface for Ground Truth)

Description: broadcasts the inertial pose of any body in simulation via Odometry message as described in nav_msgs via ROS topic.

Projector

Description: projects a static texture from a source outwards, such as used with the PR2's original head camera sensor. See API documentation for more information.

Prosilica Camera

Description: simulates interfaces exposed by a ROS Prosilica Camera. Here's an example URDF Xacro macro.

Bumper

Description: provides contact feedback via ContactsState message.

Differential Drive

Description: model plugin that provides a basic controller for differential drive robots in Gazebo. You need a well defined differential drive robot to use this plugin.

Skid Steering Drive

Description: model plugin that provides a basic controller for skid steering drive robots in Gazebo (Pioneer 3AT for instance).

Video Plugin

Description: visual plugin that displays a ROS image stream on an OGRE Texture inside gazebo. This plugin does not modify the texture of one of the existing link surfaces, but creates a new texture on top of it. The texture will be created on the XY plane, visible from the +Z side. The plugin requires a pixel size while constructing the texture, and will resize incoming ROS image messages to match if they are a different size.

Planar Move Plugin

Description: model plugin that allows arbitrary objects (for instance cubes, spheres and cylinders) to be moved along a horizontal plane using a geometry_msgs/Twist message. The plugin works by imparting a linear velocity (XY) and an angular velocity (Z) to the object every cycle.

 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论
ROS系统中,可以通过以下步骤来创建一个功能包并导入依赖包:urdf、xacro、gazebo_rosgazebo_ros_control、gazebo_plugins。 1. 打开终端,进入你想要创建功能包的路径,例如:`cd ~/catkin_ws/src` 2. 创建一个新的功能包,例如:`catkin_create_pkg my_package rospy urdf xacro gazebo_ros gazebo_ros_control gazebo_plugins` 这个命令会在当前路径下创建一个名为`my_package`的功能包,并且指定了该功能包所依赖的其他功能包,包括`rospy`、`urdf`、`xacro`、`gazebo_ros`、`gazebo_ros_control`、`gazebo_plugins`。 3. 进入功能包的目录:`cd my_package` 4. 创建一个`urdf`文件,例如:`touch my_robot.urdf` 5. 编辑`my_robot.urdf`文件,添加你的机器人模型信息 6. 创建一个`xacro`文件,例如:`touch my_robot.xacro` 7. 编辑`my_robot.xacro`文件,添加你的机器人模型信息 8. 在`my_robot.urdf`或`my_robot.xacro`文件中,添加`gazebo`所需的插件和控制器等信息,例如: ``` <gazebo> <plugin name="my_plugin" filename="libmy_plugin.so"/> <plugin name="my_controller" filename="libmy_controller.so"/> </gazebo> ``` 9. 在`package.xml`文件中添加`gazebo_ros`、`gazebo_ros_control`、`gazebo_plugins`的依赖信息,例如: ``` <depend>gazebo_ros</depend> <depend>gazebo_ros_control</depend> <depend>gazebo_plugins</depend> ``` 10. 编译你的功能包:`catkin_make` 现在,你已经成功创建了一个功能包,并且导入了`urdf`、`xacro`、`gazebo_ros`、`gazebo_ros_control`、`gazebo_plugins`等依赖包。

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

abcwoabcwo

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值