资讯详情

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

一、 提要

ROS-control是ROS重要概念,而 ROS-control是通过PR因此,从本质上讲,它是由开发产生的PR2本质是彻底理解ROS-control;本文主要阐述ROS-control的消息;

ROS-control的基础是pr2,PR2(Personal Robot 2.2代个人机器人)Willow Garage该公司设计的机器人平台数字2代表第二代机器人。本文将介绍ROS中的pr2机制及相应的接口开发原理。

二、pr2的六个关键

2.1 Pr六个关键知识点如下

  • pr2_controller_interface:实时控制器 C 接口
  • pr2_controller_manager:允许您在实时循环中操作和管理多个控制器的基础设施
  • pr2_hardware_interface:PR2 硬件的 C 接口包括执行器、压传感器、加速度计、数字输出和投影仪接口。
  • pr2_mechanism_model:基于力控机器人的模型 urdf 机器人描述格式。
  • pr2_mechanism_msgs:包括实时控制器、关节和执行器状态在内的实时控制电路通信消息。
  • realtime_tools:实时发布到 ROS 主题工具。

本文主要讨论pr2_mechanism_msgs和realtime_tools;

三、关于pr2_mechanism_msgs

该包定义了与实时控制循环通信的服务。它还定义了实时控制器、关节和执行器状态的信息。

ActuatorStatisticsControllerStatisticsJointStatisticsMechanismStatistics ListControllerTypesListControllersLoadControllerReloadControllerLibrariesSwitchControllerUnloadController SwitchController

4.1 pr2_mechanism_msgs/ActuatorStatistics

此消息包含 pr2 执行器在机器人上的状态。 通过电机和编码器包含执行器transmission传输到关节。

# actuator的名称stringname

#ethercat 链中 MCB 的序列号。 #链条中的第一个设备 deviced_id 为零int32device_id#测量执行器状态的时间

timetimestamp# theencoderposition,representedbythenumberofencoderticksint32encoder_count#Theangularoffset(inradians)thatisaddedtotheencoderreading,#togettothepositionoftheactuator.Thisnumberiscomputedwhenthereferece#sensoristriggeredduringthecalibrationphasefloat64encoder_offset#theencoderpositioninradiansfloat64position#theencodervelocityinencodertickspersecondfloat64encoder_velocity#theencodervelocityinradianspersecondfloat64velocity#thevalueofthecalibrationreading:low(false)orhigh(true)boolcalibration_reading#booltoindicateifthejointalreadytriggeredtherising/fallingedgeofthereferencesensorboolcalibration_rising_edge_validboolcalibration_falling_edge_validbr># the encoder position when the last rising/falling edge was observed. # only read this value when the calibration_rising/falling_edge_valid is truefloat64 last_calibration_rising_edgefloat64 last_calibration_falling_edge# flag to indicate if this actuator is enabled or not. # An actuator can only be commanded when it is enabled.bool is_enabled# indicates if the motor is halted. A motor can be halted because of a voltage or communication problembool halted# the last current/effort command that was requestedfloat64 last_commanded_currentfloat64 last_commanded_effort# the last current/effort command that was executed by the actuatorfloat64 last_executed_currentfloat64 last_executed_effort# the last current/effort that was measured by the actuatorfloat64 last_measured_currentfloat64 last_measured_effort# the motor voltatefloat64 motor_voltage# the number of detected encoder problems int32 num_encoder_errors

    

4.2 pr2_mechanism_msgs/ControllerStatistics

消息文件:pr2_mechanism_msgs/ControllerStatistics.msg

# This message contains the state of one realtime controller# that was spawned in pr2_mechanism_control# the name of the controllerstring name# the time at which these controller statistics were measuredtime timestamp# bool that indicates if the controller is currently# in a running or a stopped statebool running# the maximum time the update loop of the controller ever needed to completeduration max_time# the average time the update loop of the controller needs to complete. # the average is computed in a sliding time window.duration mean_time# the variance on the time the update loop of the controller needs to complete.# the variance applies to a sliding time window.duration variance_time# the number of times this controller broke the realtime loopint32 num_control_loop_overruns# the timestamp of the last time this controller broke the realtime looptime time_last_control_loop_overrun

4.3 pr2_mechanism_msgs/JointStatistics 

消息文件:pr2_mechanism_msgs/JointStatistics.msg

# This message contains the state of one joint of the pr2 robot.# This message is specificly designed for the pr2 robot. # A generic joint state message can be found in sensor_msgs::JointState# the name of the jointstring name# the time at which these joint statistics were measuredtime timestamp# the position of the joint in radiansfloat64 position# the velocity of the joint in radians per secondfloat64 velocity# the measured joint effort float64 measured_effort# the effort that was commanded to the joint.# the actual applied effort might be different# because the safety code can limit the effort# a joint can applyfloat64 commanded_effort# a flag indicating if the joint is calibrated or notbool is_calibrated# a flag inidcating if the joint violated one of its position/velocity/effort limits# in the last publish cyclebool violated_limits# the total distance travelled by the joint, measured in radians.float64 odometer# the lowest position reached by the joint in the last publish cyclefloat64 min_position# the highest position reached by the joint in the last publish cyclefloat64 max_position# the maximum absolute velocity reached by the joint in the last publish cyclefloat64 max_abs_velocity# the maximum absolute effort applied by the joint in the last publish cyclefloat64 max_abs_effort

4.4 pr2_mechanism_msgs/MechanismStatistics 

消息文件:pr2_mechanism_msgs/MechanismStatistics.msg

# This message describes the state of the pr2 mechanism. It contains the state of# each actuator, each joint, and each controller that is spawned in pr2_mechanism_control.Header headerActuatorStatistics[] actuator_statisticsJointStatistics[] joint_statisticsControllerStatistics[] controller_statistics

pr2_mechanism_msgs/ListControllerTypes

服务文件:pr2_mechanism_msgs/ListControllerTypes.srv

# The ListControllers service returns a list of controller types that are known# to pr2_mechanism_control. string[] types

5.2 pr2_mechanism_msgs/ListControllers 

服务文件:pr2_mechanism_msgs/ListControllers.srv

# The ListControllers service returns a list of controller names that are spawned# inside pr2_mechanism_control, and their corresponding stats. The state is either# running or stopped.string[] controllersstring[] state

5.3 pr2_mechanism_msgs/LoadController 

服务文件:pr2_mechanism_msgs/LoadController.srv

# The LoadController service allows you to load a single controller # inside pr2_controller_manager# To load a controller, specify the "name" of the controller. # The return value "ok" indicates if the controller was successfully# constructed and initialized or not.string namebool ok

5.4 pr2_mechanism_msgs/ReloadControllerLibraries 

服务文件:pr2_mechanism_msgs/ReloadControllerLibraries.srv

# The ReloadControllerLibraries service will reload all controllers that are available in# the system as plugins# Reloading libraries only works if there are no controllers loaded. If there# are still some controllers loaded, the reloading will fail.# If this bool is set to true, all loaded controllers will get# killed automatically, and the reloading can succeed.bool force_kill---bool ok

5.5 pr2_mechanism_msgs/SwitchController

pr2_mechanism_msgs/SwitchController.srv

# The SwitchController service allows you stop a number of controllers# and start a number of controllers, all in one single timestep of the# pr2_mechanism_control control loop. # To switch controllers, specify #  * the list of controller names to start,#  * the list of controller names to stop, and#  * the strictness (BEST_EFFORT or STRICT)#    * STRICT means that switching will fail if anything goes wrong (an invalid#      controller name, a controller that failed to start, etc. )#    * BEST_EFFORT means that even when something goes wrong with on controller, #      the service will still try to start/stop the remaining controllers# The return value "ok" indicates if the controllers were switched# successfully or not.  The meaning of success depends on the # specified strictness.string[] start_controllersstring[] stop_controllersint32 strictnessint32 BEST_EFFORT=1int32 STRICT=2---bool ok

5.6 pr2_mechanism_msgs/UnloadController

pr2_mechanism_msgs/UnloadController.srv

# The UnloadController service allows you to unload a single controller # that is loaded in pr2_controller_manager. # To unload a controller, specify the "name" of the controller. # The return value "ok" indicates if the controller was unloaded or not.# There are three cases when unloadinng a controller will fail:#  * No controller with the specified name exists#  * The controller is still running#  * Another controller depends on the specified controllerstring name---bool ok

6.1 pr2_mechanism_msgs/SwitchController 

消息文件:pr2_mechanism_msgs/SwitchController.action

string[] start_controllers string[] stop_controllers --- ---

标签: 传感器pr9268201

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

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