也是节点node之间的一种通讯方式

每个节点自己实现了action 客户端 或服务端。

客户端发起请求,action(后台中心)转发给 服务端节点

服务端node处理、执行action动作

客户端节点发起请求(询问动作执行的结果)

服务端node 响应请求 分两步

  • (1.通过topic 持续返回当前执行的状态
  • 2.动作执行结束了, 返回服务的响应报文。)

和服务的区别:

  1. 可以抢占
  2. 稳定周期反馈, 过程的结果(进度)。服务只有一个反馈

Actions are built on topics and services. Their functionality is similar to services, except actions are preemptable 抢占(you can cancel them while executing). They also provide steady feedback, (稳定的反馈,而服务,只返回一个结果)as opposed to services which return a single response.

可以看到下图: 开始action(服务通讯), 请求结果(服务通讯), feedback( topic通讯)

Actions are like services that allow you to execute long running tasks, provide regular feedback, and are cancelable.

行动通讯,和服务通讯一样,可以执行 耗时间的任务,周期的提供反馈结果。同时任务可以取消。

A robot system would likely use actions for navigation. An action goal could tell a robot to travel to a position. While the robot navigates to the position, it can send updates along the way (i.e. feedback), and then a final result message once it’s reached its destination.

很自然,行动通讯,可以用在机器人导航、轨迹跟踪!。设定一个target的, 一路tracking过去。期间返回当前状态变量。

常用命令:

ros2 action list -t

/turtle1/rotate_absolute [turtlesim/action/RotateAbsolute]

前面是action name , 后面是action type的内容

ros2 action info <action name xx> (查看action 是谁是客户端,谁是服务端)

Action: /turtle1/rotate_absolute  action name
Action clients: 1
    /teleop_turtle
Action servers: 1
    /turtlesim

ros2 interface show turtlesim/action/RotateAbsolute

数据结构定义

# The desired heading in radians
float32 theta  这个是请求命令 (目标值)
---
# The angular displacement in radians to the starting position
float32 delta (这个是 结果)
---
# The remaining rotation in radians
float32 remaining  (这个是topic : feedback)

ros2 action send_goal <action_name> <action_type> <values>

<values> need to be in YAML format.

ros2 action send_goal /turtle1/rotate_absolute turtlesim/action/RotateAbsolute "{theta: 1.57}"

看一下rqt_graph, action request 没显示,因为,之前请求了action goal

归纳:

ros2 topic pub <node name> <message> <value>

ros2 service call <service name> <servie type >< value>

ros2 action send_goal <action name> <action type> <value>

至此, ROS 核心的概念,就这么多。

ROS2 foxy 学习5 : Action 行动相关推荐

  1. ROS2 foxy 学习1 :认识节点=模块

    environment: Linux pc 5.17.1-051701-generic #202203290924-Ubuntu SMP PREEMPT Tue Mar 29 09:30:23 UTC ...

  2. Ubuntu20.04安装ROS2(Foxy)极简教程

    背景&吐槽:ros安装对中国用户是真的不友好,好多资源需要翻qiang才能下载得到,折腾了一两天我才搞定,终于可以继续学习. 安装步骤:废话不多说,官网得安装步骤其实是很坑的,我这里尽量在官网 ...

  3. Ignition Robotics和ROS2 Foxy简明使用说明(ros_ign)

    这里使用主要介绍如下: Ignition的版本为:Citadel,LTS版本支持时间2020-2025: ROS2的版本为:Foxy,LTS版本支持时间2020-2023. 什么是Ignition R ...

  4. Struts2框架学习(二) Action

    Struts2框架学习(二) Action Struts2框架中的Action类是一个单独的javabean对象.不像Struts1中还要去继承HttpServlet,耦合度减小了. 1,流程 拦截器 ...

  5. ros2 foxy 报错缺少“diagnostic_updater“,By not providing “Finddiagnostic_updater.cmake“ in CMAKE_MODULE_P

    环境:ubuntu 20.04 ros2 foxy 安装镭神M10串口版雷达,编译报错 Starting >>> lslidar_driver --- stderr: lslidar ...

  6. ubuntu18.04 安装 ros2 foxy

    安装 colcon and vcs sudo apt update && sudo apt install -y  build-essential sudo apt install - ...

  7. ros2 foxy 安装gazebo11.0

    ros2 foxy 安装时参考了wiki https://index.ros.org/doc/ros2/Installation/Foxy/Linux-Install-Debians/ 然后很惊喜的发 ...

  8. Ubuntu20.04 安装ROS2 Foxy

    Ubuntu20.04 安装ROS2 Foxy记录 参考文献 确保环境支持UTF-8 设置源 安装package 配置环境 测试 参考文献 ROS2官网: https://docs.ros.org/e ...

  9. [tips] 1.2 优麒麟ubuntu 20安装ROS2 Foxy版本

    文件信息 about: 如何安装ros2 foxy版本,如何跑出小乌龟. email: jfq3301@163.com date: 2022.6.19 版本对应关系 ubuntu ros versio ...

最新文章

  1. php获取函数里参数吗,php函数中获取参数信息方法(记录)
  2. 2/5 MySQL入门总结:数据类型
  3. C. Barcode dp
  4. 飞猪信息流内容推荐探索
  5. [emuch.net]MatrixComputations(7-12)
  6. 【转载】 扫描二维码自动识别手机APP下载地址
  7. L1-001 Hello World (5 分)—团体程序设计天梯赛
  8. 银河麒麟双击deb包无法安装
  9. 大数据讲课笔记1.5 使用Vim编辑器
  10. 微型计算机gl703评测,华硕为Strix GL503GE/GL703GE笔记本更新至第8代CPU
  11. 计算机鼠标游戏教学法,浅谈游戏教学法在信息技术教学中的应用论文
  12. JVM致命错误日志详解
  13. 如何获取 iOS 设备 UDID?
  14. 路由器 telnet配置
  15. kafka auto.offset.reset latest earliest 详解
  16. sd 0:0:0:0: [sda] Assuming drive cache: write through错误解决 本人实测!
  17. STM32固件库(Standard Peripheral Libraries )官网下载方法
  18. Jenkins Mac本地环境搭建
  19. Codeforces Round #807 (Div. 2) A-C题解
  20. 用js:字符串数组中每一项的长度。将字符串数组用 | 符号分割。有序数组插入排序插入数组。猴子选大王

热门文章

  1. 凡客登录页面html代码,凡客.html
  2. First_Mobile(xman)
  3. python跟csharp_unity-工具-csharp与python交互
  4. oracle通过load data 将数据导入表中通过存储过程进行批量处理
  5. 碳交易机制下考虑需求响应的综合能源系统优化运行论文复现——附代码
  6. bindService()流程源码分析
  7. 后台管理界面-- 管理员管理[2]
  8. 分享一篇前端面试常会问及的 WEB 安全
  9. window系统热键冲突检测
  10. 【Kafka-分区增加副本】Kafka分区增加副本