资讯详情

ROS-Control专题:PR2的六个概念【3】

参考文:

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 访问硬件组件。这些组件包括:

3.2 hardware_interface类成员

#include <hardware_interface.h>

bool addAccelerometer(Accelerometer*accelerometer)
Add an accelerometer to the hardware interface.More...
bool addActuator(Actuator*actuator)
Add an actuator to the hardware interface.More...
bool addAnalogIn(AnalogIn*analog_in)
Add an analog-in device to the hardware interface.More...
bool addCustomHW(CustomHW*custom_hw)
Add a Custom Hardware device to the hardware interface.More...
bool addDigitalOut(DigitalOut*digital_out)
Add an digital I/O to the hardware interface.More...
bool addForceTorque(ForceTorque*forcetorque)
Add a FT sensorto the hardware interface. More...
bool  addPressureSensor (PressureSensor *sensor)
Add an pressure sensor to the hardware interface. More...
bool  addProjector (Projector *projector)
Add an projector to the hardware interface. More...
Accelerometer *  getAccelerometer (const std::string &name) const
Get a pointer to the accelerometer by name. More...
Actuator *  getActuator (const std::string &name) const
Get a pointer to the actuator by name. More...
AnalogIn *  getAnalogIn (const std::string &name) const
Get a pointer to the analog-in device by name. More...
CustomHW *  getCustomHW (const std::string &name) const
Get a pointer to the Custom Hardware device by name. More...
DigitalOut *  getDigitalOut (const std::string &name) const
Get a pointer to the digital I/O by name. More...
ForceTorque *  getForceTorque (const std::string &name) const
Get a pointer to the FT sensor by name. More...
PressureSensor *  getPressureSensor (const std::string &name) const
Get a pointer to the pressure sensor by name. More...
Projector *  getProjector (const std::string &name) const
Get a pointer to the projector by name. More...

属性项

AccelerometerMap accelerometers_
ActuatorMap actuators_
AnalogInMap analog_ins_
ros::Time current_time_
The time at which the commands were sent to the hardware. More...
CustomHWMap custom_hws_
DigitalOutMap digital_outs_
ForceTorqueMap ft_sensors_
PressureSensorMap pressure_sensors_
ProjectorMap projectors_

四 细节描述(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()

bool pr2_hardware_interface::HardwareInterface::addAccelerometer ( Accelerometer *  accelerometer )
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()

bool pr2_hardware_interface::HardwareInterface::addActuator ( Actuator *  actuator )
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()

bool pr2_hardware_interface::HardwareInterface::addAnalogIn ( AnalogIn *  analog_in )
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()

bool pr2_hardware_interface::HardwareInterface::addCustomHW ( CustomHW *  custom_hw )
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()

bool pr2_hardware_interface::HardwareInterface::addDigitalOut ( DigitalOut *  digital_out )
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()

bool pr2_hardware_interface::HardwareInterface::addForceTorque ( ForceTorque *  forcetorque )
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()

bool pr2_hardware_interface::HardwareInterface::addPressureSensor ( PressureSensor *  sensor )
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()

bool pr2_hardware_interface::HardwareInterface::addProjector ( Projector *  projector )
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()

Accelerometer* pr2_hardware_interface::HardwareInterface::getAccelerometer ( const std::string &  name ) const
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()

Actuator* pr2_hardware_interface::HardwareInterface::getActuator ( const std::string &  name ) const
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()

AnalogIn* pr2_hardware_interface::HardwareInterface::getAnalogIn ( const std::string &  name ) const
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()

CustomHW* pr2_hardware_interface::HardwareInterface::getCustomHW ( const std::string &  name ) const
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()

DigitalOut* pr2_hardware_interface::HardwareInterface::getDigitalOut ( const std::string &  name ) const
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()

ForceTorque* pr2_hardware_interface::HardwareInterface::getForceTorque ( const std::string &  name ) const
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()

PressureSensor* pr2_hardware_interface::HardwareInterface::getPressureSensor ( const std::string &  name ) const
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()

Projector* pr2_hardware_interface::HardwareInterface::getProjector ( const std::string &  name ) const
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

标签: 传感器pr9268201

锐单商城拥有海量元器件数据手册IC替代型号,打造 电子元器件IC百科大全!

锐单商城 - 一站式电子元器件采购平台