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.pswp.cn/news/285762.shtml
繁體地址,請注明出處:http://hk.pswp.cn/news/285762.shtml
英文地址,請注明出處:http://en.pswp.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 代…