一、 提要

ROS-control是ROS的重要概念,而  ROS-control是通过PR2开发而产生的,因此,实质上,吃透PR2实质就是吃透了ROS-control;本篇主要阐明ROS-control的消息;

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

二、pr2的六个关键

2.1 Pr2的六个关键知识点如下

  • 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

这个包定义了用于与实时控制循环通信的服务。它还定义了表示实时控制器、关节和执行器状态的消息。

ROS Message / Service / Action Types

ROS Message Types ROS Service Types ROS Action Types
ActuatorStatistics
ControllerStatistics
JointStatistics
MechanismStatistics
ListControllerTypes
ListControllers
LoadController
ReloadControllerLibraries
SwitchController
UnloadController
SwitchController

四、ROS Message Types

4.1 pr2_mechanism_msgs/ActuatorStatistics

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

#  actuator的名称
string name

# ethercat 链中 MCB 的序列号。  
# 链中的第一个设备的 deviced_id 为零
int32 device_id

#  测量此执行器状态的时间

time timestamp

#    the encoder position, represented by the number of encoder ticks
int32 encoder_count

# The angular offset (in radians) that is added to the encoder reading, 
# to get to the position of the actuator. This number is computed when the referece
# sensor is triggered during the calibration phase
float64 encoder_offset

# the encoder position in radians
float64 position

# the encoder velocity in encoder ticks per second
float64 encoder_velocity

# the encoder velocity in radians per second
float64 velocity

# the value of the calibration reading: low (false) or high (true)
bool calibration_reading

# bool to indicate if the joint already triggered the rising/falling edge of the reference sensor
bool calibration_rising_edge_valid
bool calibration_falling_edge_valid

# the encoder position when the last rising/falling edge was observed. 
# only read this value when the calibration_rising/falling_edge_valid is true
float64 last_calibration_rising_edge
float64 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 problem
bool halted

# the last current/effort command that was requested
float64 last_commanded_current
float64 last_commanded_effort

# the last current/effort command that was executed by the actuator
float64 last_executed_current
float64 last_executed_effort

# the last current/effort that was measured by the actuator
float64 last_measured_current
float64 last_measured_effort

# the motor voltate
float64 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 controller
string name

# the time at which these controller statistics were measured
time timestamp

# bool that indicates if the controller is currently
# in a running or a stopped state
bool running

# the maximum time the update loop of the controller ever needed to complete
duration 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 loop
int32 num_control_loop_overruns

# the timestamp of the last time this controller broke the realtime loop
time 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 joint
string name

# the time at which these joint statistics were measured
time timestamp

# the position of the joint in radians
float64 position

# the velocity of the joint in radians per second
float64 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 apply
float64 commanded_effort

# a flag indicating if the joint is calibrated or not
bool is_calibrated

# a flag inidcating if the joint violated one of its position/velocity/effort limits
# in the last publish cycle
bool 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 cycle
float64 min_position

# the highest position reached by the joint in the last publish cycle
float64 max_position

# the maximum absolute velocity reached by the joint in the last publish cycle
float64 max_abs_velocity

# the maximum absolute effort applied by the joint in the last publish cycle
float64 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 header
ActuatorStatistics[] actuator_statistics
JointStatistics[] joint_statistics
ControllerStatistics[] controller_statistics

五、ROS Service Types

5.1 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[] controllers
string[] 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 name
bool 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_controllers
string[] stop_controllers
int32 strictness
int32 BEST_EFFORT=1
int32 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 controller

string name
---
bool ok

六、ROS Action Types

6.1 pr2_mechanism_msgs/SwitchController

消息文件:pr2_mechanism_msgs/SwitchController.action

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

ROS-Control专题:PR2的六个概念【5】相关推荐

  1. ROS-Control专题:PR2的六个概念【4】

    一. 提要 ROS-control是ROS的重要概念,而  ROS-control是通过PR2开发而产生的,因此,实质上,吃透PR2实质就是吃透了ROS-control: ROS-control的基础 ...

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

    参考文: pr2_mechanism - ROS Wiki pr2_controller_interface - ROS Wiki 一. 提要 ROS-control是ROS的重要概念,而  ROS- ...

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

    一. 摘要 要学习好ROS-control,先学好PR2.ROS-control的基础是pr2,PR2(Personal Robot 2,简称人形机器人2代)是Willow Garage公司设计的机器 ...

  4. ROS-Control专题:PR2的六个概念【01】

    参考文: pr2_mechanism - ROS Wiki pr2_controller_interface - ROS Wiki 一. 摘要 要学习好ROS-control,先学好PR2.ROS-c ...

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

    参考文: pr2_mechanism - ROS Wiki pr2_controller_interface - ROS Wiki 一. 摘要 ROS-control的基础是pr2,PR2(Perso ...

  6. 20189221 2018-2019-2 《密码与安全新技术专题》第六周作业

    20189221 2018-2019-2 <密码与安全新技术专题>第六周作业 课程:<密码与安全新技术专题> 班级: 201892 姓名: 郭开世 学号:20189221 上课 ...

  7. 2018-2019-2 20189206 《密码与安全新技术专题》 第六次作业

    学号 2018-2019-2 <密码与安全新技术专题>第六次作业 课程:<密码与安全新技术专题> 班级: 1892 姓名: 王子榛 学号:20189206 上课教师:王志强 上 ...

  8. 20189216 2018-2019-2 《密码与安全新技术专题》第六次作业

    20189216 2018-2019-2 <密码与安全新技术专题>第六次作业 课程:<密码与安全新技术专题> 班级: 1892 姓名: 鲍政李 学号:20189216 上课教师 ...

  9. ROS探索总结(十六)(十七)(十八)(十九)——HRMRP机器人的设计 构建完整的机器人应用系统 重读tf 如何配置机器人的导航功能

    ROS探索总结(十六)--HRMRP机器人的设计 1. HRMRP简介         HRMRP(Hybrid Real-time Mobile Robot Platform,混合实时移动机器人平台 ...

  10. ROS与Arduino学习(六)Logging日志

    ROS与Arduino学习(六)Logging日志 Tutorial Level:客户端与服务器 Next Tutorial:小案例节点通信      本节较为简单告诉大家如何向系统发布日志信息. T ...

最新文章

  1. vs2019怎么调整字体大小_考研倒计时23天,答题卡怎么使用?来看看正确的使用方法吧!...
  2. _​_​i​n​t​6​4​ ​与​l​o​n​g​ ​l​o​n​g​ ​i​n​t
  3. 一名 40 岁“老”程序员的反思~
  4. JavaScript实现按位运算符乘以无符号数multiplyUnsigned算法(附完整源码)
  5. python 修改模板对象的属性_django小技巧之html模板中调用对象属性或对象的方法...
  6. 为静态博客生成器WDTP移植了一款美美哒主题
  7. C++ 学习之旅(5)——设置Setup文件目录
  8. 设计模式学习笔记——命令(Command)模式
  9. [Linux网络编程]ARP简单实例
  10. java窗体实现射击_java_Java基于Swing实现的打猎射击游戏代码,本文实例讲述了Java基于Swing实 - phpStudy...
  11. python概率论_概率论中常见分布总结以及python的scipy库使用
  12. ecs云服务器搭建php,云服务器 ecs怎么配置php
  13. 91手机助手官网iPhone版 v5.3.2 官方版
  14. 全球及中国超声波智能燃气表行业研究及十四五规划分析报告
  15. 解决 虚拟机安装 centos8 时出现设置基础软件仓库时出错
  16. pythoneducoder苹果梨子煮水的功效_荸荠和梨子一起煮的好处
  17. 使用WinWedge软件记录satorius天平的数据(记录)
  18. ld: library not found for -l.... 问题的解决
  19. MATLAB作图时值为0的点不画出来
  20. 【老生谈算法】matlab实现灰度图处理源码——灰度图处理

热门文章

  1. vue3的逻辑复用抽离
  2. MySQL高级部分理论知识细讲
  3. 在tomcat里面配置数据库地址,以及在Spring和Java中的使用
  4. 【Unity3D自学记录】Unity3D之KeyCode键值
  5. python语音通话_如何优雅的用Python玩转语音聊天机器人
  6. 烧钱,救得了中国游戏吗?
  7. R语言smoothHR包_R语言数据分析实例一:离职率分析与建模预测
  8. 布同:使用ghost备份或者还原的往事
  9. 有关“十二生肖”的成语
  10. ES学习笔记八-聚合搜索