ROS2_Control官方资料+运动控制

Getting Started — ROS2_Control: Rolling Dec 2023 documentation

  • Getting Started
  •  Edit on GitHub

You're reading the documentation for a development version. For the latest released version, please have a look at Iron.

Getting Started

Installation

Binary packages

The ros2_control framework is released for ROS 2 rolling. To use it, you have to install ros-rolling-ros2-control and ros-rolling-ros2-controllers packages.

Building from Source

If you want to install the framework from source, e.g., for contributing to the framework, use the following commands:

  • Download all repositories

    mkdir -p ~/ros2_ws/src
    cd ~/ros2_ws/
    wget https://raw.githubusercontent.com/ros-controls/control.ros.org/master/ros_controls.$ROS_DISTRO.repos
    vcs import src < ros_controls.$ROS_DISTRO.repos
    
  • Install dependencies:

    rosdep update --rosdistro=$ROS_DISTRO
    sudo apt-get update
    rosdep install --from-paths src --ignore-src -r -y
    
  • Build everything, e.g. with:

    . /opt/ros/${ROS_DISTRO}/setup.sh
    colcon build --symlink-install
    
  • Do not forget to source setup.bash from the install folder!

Architecture

The source code for the ros2_control framework can be found in the ros2_control and ros2_controllers GitHub repositories. The following figure shows the architecture of the ros2_control framework.

"ros2_control Architecture"

The following UML Class Diagram describes the internal implementation of the ros2_control framework.

"UML Class Diagram"

Controller Manager

The Controller Manager (CM) connects the controllers and hardware-abstraction sides of the ros2_control framework. It also serves as the entry-point for users via ROS services. The CM implements a node without an executor so that it can be integrated into a custom setup. However, it’s usually recommended to use the default node-setup implemented in ros2_control_node file from the controller_manager package. This manual assumes that you use this default node-setup.

On the one hand, CM manages (e.g. loads, activates, deactivates, unloads) controllers and the interfaces they require. On the other hand, it has access (via the Resource Manager) to the hardware components, i.e. their interfaces. The Controller Manager matches required and provided interfaces, granting controllers access to hardware when enabled, or reporting an error if there is an access conflict.

The execution of the control-loop is managed by the CM’s update() method. It reads data from the hardware components, updates outputs of all active controllers, and writes the result to the components.

Resource Manager

The Resource Manager (RM) abstracts physical hardware and its drivers (called hardware components) for the ros2_control framework. The RM loads the components using the pluginlib-library, manages their lifecycle and components’ state and command interfaces. The abstraction provided by RM allows reuse of implemented hardware components, e.g., robot and gripper, without any implementation, and flexible hardware application for state and command interfaces, e.g., separate hardware/communication libraries for motor control and encoder reading.

In the control loop execution, the RM’s read() and write() methods handle the communication with the hardware components.

Controllers

The controllers in the ros2_control framework are based on control theory. They compare the reference value with the measured output and, based on this error, calculate a system’s input. The controllers are objects derived from ControllerInterface (controller_interface package in ros2_control) and exported as plugins using pluginlib-library. For an example of a controller check the ForwardCommandController implementation in the ros2_controllers repository. The controller lifecycle is based on the LifecycleNode class, which implements the state machine described in the Node Lifecycle Design document.

When the control-loop is executed, the update() method is called. This method can access the latest hardware state and enable the controller to write to the hardware command interfaces.

User Interfaces

Users interact with the ros2_control framework using Controller Manager’s services. For a list of services and their definitions, check the srv folder in the controller_manager_msgs package.

While service calls can be used directly from the command line or via nodes, there exists a user-friendly Command Line Interface (CLI) which integrates with the ros2 cli. This supports auto-complete and has a range of common commands available. The base command is ros2 control. For the description of our CLI capabilities, see the Command Line Interface (CLI) documentation.

Hardware Components

The hardware components realize communication to physical hardware and represent its abstraction in the ros2_control framework. The components have to be exported as plugins using pluginlib-library. The Resource Manager dynamically loads those plugins and manages their lifecycle.

There are three basic types of components:

System

Complex (multi-DOF) robotic hardware like industrial robots. The main difference between the Actuator component is the possibility to use complex transmissions like needed for humanoid robot’s hands. This component has reading and writing capabilities. It is used when there is only one logical communication channel to the hardware (e.g., KUKA-RSI).

Sensor

Robotic hardware is used for sensing its environment. A sensor component is related to a joint (e.g., encoder) or a link (e.g., force-torque sensor). This component type has only reading capabilities.

Actuator

Simple (1 DOF) robotic hardware like motors, valves, and similar. An actuator implementation is related to only one joint. This component type has reading and writing capabilities. Reading is not mandatory if not possible (e.g., DC motor control with Arduino board). The actuator type can also be used with a multi-DOF robot if its hardware enables modular design, e.g., CAN-communication with each motor independently.

A detailed explanation of hardware components is given in the Hardware Access through Controllers design document.

Hardware Description in URDF

The ros2_control framework uses the <ros2_control>-tag in the robot’s URDF file to describe its components, i.e., the hardware setup. The chosen structure enables tracking together multiple xacro-macros into one without any changes. The example hereunder shows a position-controlled robot with 2-DOF (RRBot), an external 1-DOF force-torque sensor, and an externally controlled 1-DOF parallel gripper as its end-effector. For more examples and detailed explanations, check the ros2_control_demos site and ROS 2 Control Components URDF Examples design document.

<ros2_control name="RRBotSystemPositionOnly" type="system"><hardware><plugin>ros2_control_demo_hardware/RRBotSystemPositionOnlyHardware</plugin><param name="example_param_write_for_sec">2</param><param name="example_param_read_for_sec">2</param></hardware><joint name="joint1"><command_interface name="position"><param name="min">-1</param><param name="max">1</param></command_interface><state_interface name="position"/></joint><joint name="joint2"><command_interface name="position"><param name="min">-1</param><param name="max">1</param></command_interface><state_interface name="position"/></joint>
</ros2_control>
<ros2_control name="RRBotForceTorqueSensor1D" type="sensor"><hardware><plugin>ros2_control_demo_hardware/ForceTorqueSensor1DHardware</plugin><param name="example_param_read_for_sec">0.43</param></hardware><sensor name="tcp_fts_sensor"><state_interface name="force"/><param name="frame_id">rrbot_tcp</param><param name="min_force">-100</param><param name="max_force">100</param></sensor>
</ros2_control>
<ros2_control name="RRBotGripper" type="actuator"><hardware><plugin>ros2_control_demo_hardware/PositionActuatorHardware</plugin><param name="example_param_write_for_sec">1.23</param><param name="example_param_read_for_sec">3</param></hardware><joint name="gripper_joint "><command_interface name="position"><param name="min">0</param><param name="max">50</param></command_interface><state_interface name="position"/><state_interface name="velocity"/></joint>
</ros2_control>

Running the Framework for Your Robot

To run the ros2_control framework, do the following. The example files can be found in the ros2_control_demos repository.

  1. Create a YAML file with the configuration of the controller manager and two controllers. (Example configuration for RRBot)

  2. Extend the robot’s URDF description with needed <ros2_control> tags. It is recommended to use macro files (xacro) instead of pure URDF. (Example URDF for RRBot)

  3. Create a launch file to start the node with Controller Manager. You can use a default ros2_control node (recommended) or integrate the controller manager in your software stack. (Example launch file for RRBot)

NOTE: You could alternatively use a script to create setup a skeleton of the “hardware_interface” package by using the scripts provided by one of our maintainers.

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mzph.cn/news/285762.shtml

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

三、教你搞懂渐变堆叠面积图《手把手教你 ECharts 数据可视化详解》

注&#xff1a;本系列教程需要对应 JavaScript 、html、css 基础&#xff0c;否则将会导致阅读时困难&#xff0c;本教程将会从 ECharts 的官方示例出发&#xff0c;详解每一个示例实现&#xff0c;从中学习 ECharts 。 ECharts 官方示例&#xff1a;https://echarts.apache.o…

C语言试题八十二之输入小写字母,把小写字母转换成大写字母。

📃个人主页:个人主页 🔥系列专栏:C语言试题200例目录 💬推荐一款刷算法、笔试、面经、拿大公司offer神器 👉 点击跳转进入网站 ✅作者简介:大家好,我是码莎拉蒂,CSDN博客专家(全站排名Top 50),阿里云博客专家、51CTO博客专家、华为云享专家 1、题目 输入小写字…

Serv-U服务器的管理3

&#xff18;&#xff0e;编辑&#xff29;&#xff30;访问规则对于某些扰乱服务器秩序但又不方便删除其账户的用户&#xff0c;可以利用“编辑&#xff29;&#xff30;访问规则”允许或阻止特定的&#xff29;&#xff30;访问。&#xff33;&#xff45;&#xff52;&#…

【ArcGIS风暴】什么是点云?什么是Las数据集?一篇文章告诉你点云数据的奥秘

摄影测量Pix4d等软件,或激光雷达数据一般都是LAS格式的点云数据,有很大的适用范围和优点,那么,到底什么是LAS数据集呢,一文告诉你LAS数据集的来龙去脉。 扩展阅读: 什么是点云?什么是Las数据集?一篇文章告诉你点云数据的奥秘 ArcGIS+CASS点云(.las)数据生成等高线方法案…

试用了多款报表工具,终于找到了基于.Net 6开发的一个了

Part1前言上一个月有一个项目需要用到数据分析&#xff0c;将老板感兴趣的数据给他整理成一个面板&#xff0c;方便他实时查看&#xff0c;于是自己了解到了BI,当时我们项目就用了metabase&#xff0c;metabase是一款开源的BI分析工具&#xff0c;开发语言clojureReact为主。就…

4种CSS文字竖排方法

2019独角兽企业重金招聘Python工程师标准>>> 有时候&#xff0c;我们需要对网页某个区域的文字竖排&#xff0c;竖向排列&#xff0c;横向的当然大家都见惯了&#xff0c;对于竖排&#xff0c;一时间找不到思路了&#xff0c;呵呵&#xff0c;其实和横排一样简单&am…

知道这20个正则表达式,能让你少写1,000行代码

正则表达式&#xff0c;一个十分古老而又强大的文本处理工具&#xff0c;仅仅用一段非常简短的表达式语句&#xff0c;便能够快速实现一个非常复杂的业务逻辑。熟练地掌握正则表达式的话&#xff0c;能够使你的开发效率得到极大的提升。 正则表达式经常被用于字段或任意字符串的…

Android之SwipeRefreshLayout嵌套RecyclerView遇到的坑

1 、需求 RecyclerView多布局里面加入SwipeRefreshLayout实现下拉刷新 2、关键代码 <androidx.swiperefreshlayout.widget.SwipeRefreshLayoutandroid:id="@+id/mainRefresh"android:layout_width="match_parent"android:layout_height="0dp"…

TCP连接出现大量TIME_WAIT的解决办法

一个TCP/IP连接断开以后&#xff0c;会通过TIME_WAIT的状态保留一段时间&#xff0c;时间过了才会释放这个端口&#xff0c;当端口接受的频繁请求数量过多的时候&#xff0c;就会产生大量的TIME_WAIT状态的连接&#xff0c;这些连接占着端口&#xff0c;会消耗大量的资源。面对…

【ArcGIS风暴】ArcGIS10.6创建LAS数据集的两种方法并加载点云数据

文章目录 1. 使用上下文菜单创建 LAS 数据集2. 使用地理处理工具创建 LAS 数据集3. 显示LAS数据集LAS 数据集是位于文件夹中的独立文件,并且引用 LAS 格式的激光雷达数据和用于定义表面特征的可选表面约束要素。可使用创建 LAS 数据集工具或 ArcCatalog 中文件夹的上下文菜单快…

关于建立北京市专业技术人员职业资格与职称对应关系的通知

原文地址 http://www.bjrbj.gov.cn/xxgk/gsgg/201906/t20190605_82857.html 附件 北京市专业技术人员职业资格与职称对应表 &#xff08;46项&#xff09; 一、准入类职业资格 序号 资格名称 可聘专业技术职务 1 注册消防工程师 一级注册消防工程师&#xff1a;工程师 二…

基于.NetCore开发博客项目 StarBlog - (12) Razor页面动态编译

系列文章基于.NetCore开发博客项目 StarBlog - (1) 为什么需要自己写一个博客&#xff1f;基于.NetCore开发博客项目 StarBlog - (2) 环境准备和创建项目基于.NetCore开发博客项目 StarBlog - (3) 模型设计基于.NetCore开发博客项目 StarBlog - (4) markdown博客批量导入基于.N…

C语言试题八十三之输出左下三角形九九乘法表

📃个人主页:个人主页 🔥系列专栏:C语言试题200例目录 💬推荐一款刷算法、笔试、面经、拿大公司offer神器 👉 点击跳转进入网站 ✅作者简介:大家好,我是码莎拉蒂,CSDN博客专家(全站排名Top 50),阿里云博客专家、51CTO博客专家、华为云享专家 1、题目 输出左下三…

Android SDK目录结构

1、add-ons这里面保存着附加库&#xff0c;比如GoogleMaps&#xff0c;当然你如果安装了OphoneSDK&#xff0c;这里也会有一些类库在里面。 2、docs这里面是Android的帮助文档&#xff0c;Android开发所有API都在里面。 3、platforms是每个平台的SDK真正的文件&#xff0c;里面…

【Pix4d精品教程】Pix4d项目空三结果精度评估完整解决方案

《无人机航空摄影测量精品教程》合集目录(Pix4d、CC、EPS、PhotoScan、Inpho) 文章目录 一、单体项目评估二、整体项目评估在航测项目内业工作中,不管是垂直摄影,还是倾斜摄影,最核心的部分是空三加密,一个很重要的基础是共线方程。空三结果的精度是航测的基本要求,也会…

2016 10 26考试 NOIP模拟赛 杂题

Time 7&#xff1a;50 AM -> 11&#xff1a;15 AM 感觉今天考完后&#xff0c;我的内心是崩溃的 试题考试包 T1&#xff1a; 首先看起来是个贪心&#xff0c;然而&#xff0c;然而&#xff0c;看到那个100%数据为n < 2000整个人就虚了&#xff0c;发呆接近两小时后意识到…

2016 CCPC 杭州

A - ArcSofts Office Rearrangement 均分石子。 好像怎么分答案都一样&#xff0c;于是模拟一遍。 #include <bits/stdc.h>using namespace std; typedef long long ll;template<typename T> inline void read(T &x){ x0;T f1;char ch;do{chgetchar();if(ch-)f…

[转]RxHttp 一条链发送请求,新一代Http请求神器(一)

简介 RxHttp是基于OkHttp的二次封装&#xff0c;并于RxJava做到无缝衔接&#xff0c;一条链就能发送一个完整的请求。主要功能如下&#xff1a; 支持Get、Post、Put、Delete等任意请求方式&#xff0c;可自定义请求方式支持Json、DOM等任意数据解析方式&#xff0c;可自定义数据…

【Pix4d精品教程】Pix4d空三后处理:点云分类与过滤、DSM精编生成DEM、生成等高线案例详解

《无人机航空摄影测量精品教程》合集目录(Pix4d、CC、EPS、PhotoScan、Inpho) DEM结果预览: 等高线结果预览: Pix4d内业空三结束后,会生成点云,DOM和DSM等产品,一般情况下,DOM精度不达标(如房屋边缘有噪点)的话,可以直接在镶嵌图编辑器进行DOM的编辑,然而后处理的…

如何更好地组织最小 WEB API 代码结构

前言我们在《.NET 6新特性试用》中讲过&#xff0c;随着项目需求和复杂性的增加&#xff0c;单个文件的最小 WEB API 会变得非常臃肿。而且&#xff0c;Program.cs 应该只放启动和初始化代码。不应该包含太多 MapXXX 方法。那么&#xff0c;如何以更好的方式组织最小 WEB API 代…