参考文:
pr2_mechanism - ROS Wiki
pr2_controller_interface - ROS Wiki
一、 提要
ROS-control是ROS重要概念,而 ROS-control是通过PR因此,从本质上讲,它是由开发产生的PR2本质是彻底理解ROS-control;
ROS-control的基础是pr2,PR2(Personal Robot 2.2代个人机器人)Willow Garage数字2代表第二代机器人是公司设计的机器人平台。本文将在此介绍ROS中的pr2机制及相应的接口开发原理。
二、pr2的六个关键
2.1 Pr六个关键知识点如下
-
pr2_controller_interface: The C interface for a realtime controller
-
pr2_controller_manager: The infrastructure that allows you to run and manage multiple controllers in a realtime loop
-
pr2_hardware_interface: The C interface for the PR2 hardware, containing actuators, pressure sensors, accelerometers, digital out and projector interface.
-
pr2_mechanism_model: The model of an effort controlled robot, based on theurdfrobot description format.
-
pr2_mechanism_msgs: Messages used to communicate with the realtime control loop, and messages that contain the state of the realtime controllers, the joints and the actuators.
-
realtime_tools: A tool to publish to a ROS topic from realtime.
三、pr2_hardware_interface
该软件包含通过 EtherCAT 控制的 PR2 硬件组件的 C 接口。这包括控制 PR2 指尖所需的电机和编码器、压力传感器、相机触发器等部件……该接口中的所有硬件组件都可以直接用于硬实时内部控制器控制电路。
注意:此处EtherCAT是以太网现场总线,也是关键内容。。
3.1硬件组件(Hardware components)
PR2 硬件接口为 PR2 提供一个硬件 C 通过贯穿机器人的抽象层 etherCAT 控制链路。大多数用户不需要直接处理接口。如果你只对控制机器人关节感兴趣,你应该直接使用它 pr2_mechanism_model 交互。只有需要直接访问硬件的高级用户才能使用 PR2 硬件接口。
硬件接口:HardwareInterface 类提供对通过 EtherCAT 控制的 PR2 访问硬件组件。这些组件包括:
-
PR2 机器人包含 32 个执行器,每个执行器由一个电机和一个编码器组成。
-
PR2 夹具包含 3 轴加速度计在这里找到与这些传感器实时通信的说明。
-
PR2 有一个或多个数字的电机控制器板 I/O 引脚。数字 I/O 可用于控制各种硬件,如校准 LED 或相机触发器。
-
PR2 纹理投影仪安装在头部。纹理有助于立体相机看到没有纹理的物体。
-
一些 EtherCAT 设备(例如 Beckhoff EL3064)将输入表示为模拟值数组。
3.2 hardware_interface类成员
#include <hardware_interface.h>
属性项
四 细节描述(Detailed Description)
HardwareInterface 类提供对通过 EtherCAT 控制的 PR2 硬件组件的访问。这些组件包括:
- Actuators
- Finger-tip Pressure Sensors
- Accelerometers
- Force/Torque Sensors
- Digital I/Os
- Projectors
4.1 组件类
对于每种组件类型,都存在一个由以下三个字段组成的类定义:
提供这些组件中的一个或多个的驱动程序按名称向硬件接口注册该组件的相应类。对于给定的组件类型,名称必须是唯一的。
控制器可以通过名称检索指向组件类的指针。组件使用组件类的 command_ 字段进行控制,其状态在 status_ 字段中给出。
在文件hardware_interface.h 的第 440 行定义。
4.2 成员函数 Member Function Documentation
◆ addAccelerometer()
|
inline |
Add an accelerometer to the hardware interface.
Parameters
accelerometer | A pointer to the Accelerometer |
Returns
true if successful, false if name is a duplicate
Definition at line 558 of file hardware_interface.h.
◆ addActuator()
|
inline |
Add an actuator to the hardware interface.
Parameters
actuator | A pointer to the Actuator |
Returns
true if successful, false if name is a duplicate
Definition at line 536 of file hardware_interface.h.
◆ addAnalogIn()
|
inline |
Add an analog-in device to the hardware interface.
Parameters
analog_in | A pointer to the AnalogIn |
Returns
true if successful, false if name is a duplicate
Definition at line 602 of file hardware_interface.h.
◆ addCustomHW()
|
inline |
Add a Custom Hardware device to the hardware interface.
Parameters
custom_hw | A pointer to the CustomHW |
Returns
true if successful, false if name is a duplicate
Definition at line 613 of file hardware_interface.h.
◆ addDigitalOut()
|
inline |
Add an digital I/O to the hardware interface.
Parameters
digital_out | A pointer to the DigitalOut |
Returns
true if successful, false if name is a duplicate
Definition at line 580 of file hardware_interface.h.
◆ addForceTorque()
|
inline |
Add a FT sensor to the hardware interface.
Parameters
forcetorque | A pointer to the ForceTorque |
Returns
true if successful, false if name is a duplicate
Definition at line 569 of file hardware_interface.h.
◆ addPressureSensor()
|
inline |
Add an pressure sensor to the hardware interface.
Parameters
sensor | A pointer to the PressureSensor |
Returns
true if successful, false if name is a duplicate
Definition at line 547 of file hardware_interface.h.
◆ addProjector()
|
inline |
Add an projector to the hardware interface.
Parameters
projector | A pointer to the Projector |
Returns
true if successful, false if name is a duplicate
Definition at line 591 of file hardware_interface.h.
◆ getAccelerometer()
|
inline |
Get a pointer to the accelerometer by name.
Parameters
name | The name of the accelerometer |
Returns
A pointer to an Accelerometer. Returns NULL if name is not valid.
Definition at line 476 of file hardware_interface.h.
◆ getActuator()
|
inline |
Get a pointer to the actuator by name.
Parameters
name | The name of the actuator |
Returns
A pointer to an Actuator. Returns NULL if name is not valid.
Definition at line 456 of file hardware_interface.h.
◆ getAnalogIn()
|
inline |
Get a pointer to the analog-in device by name.
Parameters
name | The name of the analog-in device |
Returns
A pointer to an AnalogIn. Returns NULL if name is not valid.
Definition at line 516 of file hardware_interface.h.
◆ getCustomHW()
|
inline |
Get a pointer to the Custom Hardware device by name.
Parameters
name | The name of the Custom Hardware device |
Returns
A pointer to a CustomHW. Returns NULL if name is not valid.
Definition at line 526 of file hardware_interface.h.
◆ getDigitalOut()
|
inline |
Get a pointer to the digital I/O by name.
Parameters
name | The name of the digital I/O |
Returns
A pointer to an DigitalOut. Returns NULL if name is not valid.
Definition at line 496 of file hardware_interface.h.
◆ getForceTorque()
|
inline |
Get a pointer to the FT sensor by name.
Parameters
name | The name of the FT sensor |
Returns
A pointer to a FT sensor. Returns NULL if name is not valid.
Definition at line 486 of file hardware_interface.h.
◆ getPressureSensor()
|
inline |
Get a pointer to the pressure sensor by name.
Parameters
name | The name of the pressure sensor |
Returns
A pointer to a PressureSensor. Returns NULL if name is not valid.
Definition at line 466 of file hardware_interface.h.
◆ getProjector()
|
inline |
Get a pointer to the projector by name.
Parameters
name | The name of the projector |
Returns
A pointer to an Projector. Returns NULL if name is not valid.
Definition at line 506 of file hardware_interface.h.
Member Data Documentation
◆ accelerometers_
AccelerometerMap pr2_hardware_interface::HardwareInterface::accelerometers_ |
Definition at line 445 of file hardware_interface.h.
◆ actuators_
ActuatorMap pr2_hardware_interface::HardwareInterface::actuators_ |
Definition at line 443 of file hardware_interface.h.
◆ analog_ins_
AnalogInMap pr2_hardware_interface::HardwareInterface::analog_ins_ |
Definition at line 449 of file hardware_interface.h.
◆ current_time_
ros::Time pr2_hardware_interface::HardwareInterface::current_time_ |
The time at which the commands were sent to the hardware.
Definition at line 619 of file hardware_interface.h.
◆ custom_hws_
CustomHWMap pr2_hardware_interface::HardwareInterface::custom_hws_ |
Definition at line 450 of file hardware_interface.h.
◆ digital_outs_
DigitalOutMap pr2_hardware_interface::HardwareInterface::digital_outs_ |
Definition at line 447 of file hardware_interface.h.
◆ ft_sensors_
ForceTorqueMap pr2_hardware_interface::HardwareInterface::ft_sensors_ |
Definition at line 446 of file hardware_interface.h.
◆ pressure_sensors_
PressureSensorMap pr2_hardware_interface::HardwareInterface::pressure_sensors_ |
Definition at line 444 of file hardware_interface.h.
◆ projectors_
ProjectorMap pr2_hardware_interface::HardwareInterface::projectors_ |
Definition at line 448 of file hardware_interface.h.
The documentation for this class was generated from the following file:
- hardware_interface.h