add rm arm package
13
HiveCoreR0/src/ros2_rm_robot-humble/LICENSE
Normal file
@@ -0,0 +1,13 @@
|
||||
Copyright 2024 realman-robotics
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
175
HiveCoreR0/src/ros2_rm_robot-humble/README.md
Normal file
@@ -0,0 +1,175 @@
|
||||
<div align="right">
|
||||
|
||||
[中文简体](https://github.com/RealManRobot/ros2_rm_robot/blob/humble/README_CN.md)|
|
||||
[English](https://github.com/RealManRobot/ros2_rm_robot/blob/humble/README.md)
|
||||
|
||||
</div>
|
||||
|
||||
# ros2_rm_robot
|
||||
|
||||
The package is mainly used for providing ROS2 support for the robotic arm, and the following is the use environment.
|
||||
|
||||
* Currently supported robotic arms are RM65 series, RM75 series, ECO65 series, ECO63 series, RML63 series, GEN72 series, and the details can be referred to the website [RealMan robots](http://www.realman-robotics.com/).
|
||||
* Version V1.5.0.
|
||||
* The supported robotic arm controller version is 1.4.3 or above.
|
||||
* The Ubuntu version is 22.04.
|
||||
* The ROS2 version is humble.
|
||||
|
||||
The following is the installation and use tutorial of the package.
|
||||
|
||||
## 1\. Build the environment
|
||||
---
|
||||
Before using the package, we first need to do the following operations.
|
||||
|
||||
* 1.[Install ROS2](#1.Install_ROS2)
|
||||
* 2.[Install Moveit2](#Install_Moveit2)
|
||||
* 3.[Configure the package environment](#Configure_the_package_environment)
|
||||
* 4.[Compile](#Compile)
|
||||
|
||||
### 1.Install_ROS2
|
||||
|
||||
----
|
||||
|
||||
We provide the installation script for ROS2, ros2_install.sh, which is located in the scripts folder of the rm_install package. In practice, we need to move to the path and execute the following commands.
|
||||
|
||||
```
|
||||
sudo bash ros2_install.sh
|
||||
```
|
||||
|
||||
If you do not want to use the script installation, you can also refer to the website [ROS2_INSTALL](https://docs.ros.org/en/humble/Installation/Ubuntu-Install-Debians.html).
|
||||
|
||||
### Install_Moveit2
|
||||
|
||||
----
|
||||
|
||||
We provide the installation script for Moveit2, moveit2_install.sh, which is located in the scripts folder of the rm_install package. In practice, we need to move to the path and execute the following commands.
|
||||
|
||||
```
|
||||
sudo bash moveit2_install.sh
|
||||
```
|
||||
|
||||
If you do not want to use the script installation, you can also refer to the website [Moveit2_INSTALL](https://moveit.ros.org/install-moveit2/binary/).
|
||||
|
||||
### Configure_the_package_environment
|
||||
|
||||
----
|
||||
|
||||
This script is located in the lib folder of the rm_driver package. In practice, we need to move to the path and execute the following commands.
|
||||
|
||||
```
|
||||
sudo bash lib_install.sh
|
||||
```
|
||||
|
||||
### Compile
|
||||
|
||||
----
|
||||
|
||||
After the above execution is successful, execute the following commands to compile the package. First, we need to build a workspace and import the package file into the src folder under the workspace, and then use the colcon build command to compile.
|
||||
|
||||
```
|
||||
mkdir -p ~/ros2_ws/src
|
||||
cp -r ros2_rm_robot ~/ros2_ws/src
|
||||
cd ~/ros2_ws
|
||||
colcon build --packages-select rm_ros_interfaces
|
||||
source ./install/setup.bash
|
||||
colcon build
|
||||
```
|
||||
|
||||
After the compilation is completed, the package can be run.
|
||||
|
||||
## 2\. Function running
|
||||
|
||||
---
|
||||
|
||||
Package introduction
|
||||
|
||||
1. Installation and environment configuration ([rm_install](https://github.com/RealManRobot/ros2_rm_robot/tree/humble/rm_install))
|
||||
|
||||
* This package is the auxiliary package for using the robotic arm. It is mainly used to introduce the installation and construction method of the package use environment, the installation of the dependent library and the compilation method of the function package.
|
||||
|
||||
3. Hardware driver ([rm_driver](https://github.com/RealManRobot/ros2_rm_robot/tree/humble/rm_driver))
|
||||
|
||||
* This package is the ROS2 underlying driver package of the robotic arm. It is used to subscribe and publish the underlying related topic information of the robotic arm.
|
||||
|
||||
5. Launch ([rm_bringup](https://github.com/RealManRobot/ros2_rm_robot/tree/humble/rm_bringup))
|
||||
|
||||
* This package is the node launch package of the robotic arm. It is used to quickly launch the multi-node compound robotic arm function.
|
||||
|
||||
6. Model description ([rm_description](https://github.com/RealManRobot/ros2_rm_robot/tree/humble/rm_description))
|
||||
|
||||
* This package is the model description package of the robotic arm. It is used to provide the robotic arm model file and model load node, and provide the coordinate transformation relationship between the joints of the robotic arm for other packages.
|
||||
|
||||
7. ROS message interface ([rm_ros_interfaces](https://github.com/RealManRobot/ros2_rm_robot/tree/humble/rm_ros_interfaces))
|
||||
|
||||
* This package is the message file package of the robotic arm. It is used to provide all control messages and state messages for the robotic arm to adapt to ROS2.
|
||||
|
||||
8. Moveit2 configuration [(rm_moveit2_config](https://github.com/RealManRobot/ros2_rm_robot/tree/humble/rm_moveit2_config)
|
||||
|
||||
* This package is the moveit2 adaptation package of the robotic arm. It is used to adapt and realize the moveit2 planning and control functions of various series of robotic arms, mainly including the control functions of virtual robotic arm control and real robotic arm control.
|
||||
|
||||
9. Moveit2 and hardware driver communication connection ([rm_config](https://github.com/RealManRobot/ros2_rm_robot/tree/humble/rm_control))
|
||||
|
||||
* This package is the communication connection package between the underlying driver package (rm_driver) and the moveit2 package (rm_moveit2_config). It is mainly used to subdivide the planning points of moveit2 and then pass them to the underlying driver package in the form of transmission to control the motion of the robotic arm.
|
||||
|
||||
10. Gazebo simulation robotic arm control ([rm_gazebo](https://github.com/RealManRobot/ros2_rm_robot/tree/humble/rm_gazebo))
|
||||
|
||||
* This package is the gazebo simulation robotic arm package. It is mainly used to display the robotic arm model in the gazebo simulation environment, and the planning and control of the simulated robotic arm can be carried out through moveit2.
|
||||
|
||||
11. Use examples ([rm_examples](https://github.com/RealManRobot/ros2_rm_robot/tree/humble/rm_example))
|
||||
|
||||
* This package is some use examples of the robotic arm, and it is mainly used to realize some basic control functions and motion functions of the robotic arm.
|
||||
|
||||
12. Technical documentation ([rm_docs](https://github.com/RealManRobot/ros2_rm_robot/tree/humble/rm_doc))
|
||||
|
||||
* This package is an introduction document package, which mainly includes a document that provides an overall introduction to the content and usage of the packages, as well as a document that provides a detailed introduction to the content and usage of each package.
|
||||
|
||||
The above are the current ten packages; each package has its own unique role. Please refer to the document in the doc folder under the rm_doc package for a detailed understanding.
|
||||
|
||||
### 2.1 Run the virtual robotic arm
|
||||
|
||||
----
|
||||
|
||||
Use the following command to launch the gazebo to display the simulation robotic arm, and launch moveit2 for the planning and control of the simulation robotic arm.
|
||||
|
||||
```
|
||||
source ~/ros2_ws/install/setup.bash
|
||||
ros2 launch rm_bringup rm_<arm_type>_gazebo.launch.py
|
||||
```
|
||||
|
||||
\<arm_type> needs to use 65, 75, eco65、eco63, 63, gen72, gen72_II characters to replace it. For example, when using an RM65 robotic arm, the command is as follows.
|
||||
|
||||
```
|
||||
ros2 launch rm_bringup rm_65_gazebo.launch.py
|
||||
```
|
||||
|
||||
After successful launch, you can use moveit2 for the control of the virtual robotic arm.
|
||||
|
||||
### 2.2 Control the real robotic arm
|
||||
|
||||
----
|
||||
|
||||
Use the following command to launch the hardware driver of the robotic arm, and launch moveit2 for the planning and control of the robotic arm.
|
||||
|
||||
```
|
||||
source ~/ros2_ws/install/setup.bash
|
||||
ros2 launch rm_bringup rm_<arm_type>_bringup.launch.py
|
||||
```
|
||||
|
||||
\<arm_type> needs to use 65, 75, eco65、eco63, 63, gen72, gen72_II characters to replace it. For example, when using an RM65 robotic arm, the command is as follows.
|
||||
|
||||
```
|
||||
ros2 launch rm_bringup rm_65_bringup.launch.py
|
||||
```
|
||||
|
||||
After successful launch, you can use moveit2 for the control of the real robotic arm.
|
||||
|
||||
### Safety Tips
|
||||
|
||||
----
|
||||
|
||||
Please refer to the following operation specifications when using the robotic arm to ensure the user's safety.
|
||||
|
||||
* Check the installation of the robotic arm before each use, including whether the mounting screw is loose and whether the robotic arm is vibrating or trembling.
|
||||
* During the running of the robotic arm, no person shall be in the falling or working range of the robotic arm, nor shall any other object be placed in the robot arm's safety range.
|
||||
* Place the robotic arm in a safe location when not in use to avoid it from falling down and damaging or injuring other objects during vibration.
|
||||
* Disconnect the robotic arm from the power supply in time when not in use.
|
||||
113
HiveCoreR0/src/ros2_rm_robot-humble/README_CN.md
Normal file
@@ -0,0 +1,113 @@
|
||||
<div align="right">
|
||||
|
||||
[中文简体](https://github.com/RealManRobot/ros2_rm_robot/blob/humble/README_CN.md)|
|
||||
[English](https://github.com/RealManRobot/ros2_rm_robot/blob/humble/README.md)
|
||||
|
||||
</div>
|
||||
|
||||
# ros2_rm_robot
|
||||
该功能包的主要作用为提供机械臂的ROS2支持,以下为使用环境。
|
||||
* 当前支持的机械臂有RM65系列、RM75系列、ECO65系列、ECO63系列、RML63系列、GEN72系列,详细可参考网址 [RealMan robots](http://www.realman-robotics.com/)。
|
||||
* 版本1.5.0.
|
||||
* 支持的机械臂控制器版本1.4.3以上。
|
||||
* 基于的Ubuntu版本为22.04。
|
||||
* ROS2版本为humble。
|
||||
|
||||
下面为功能包安装使用教程。
|
||||
## 1.搭建环境
|
||||
---
|
||||
在使用功能包之前我们首先需要进行如下操作。
|
||||
* 1.[安装ROS2](#安装ROS2)
|
||||
* 2.[安装Moveit2](#安装Moveit2)
|
||||
* 3.[配置功能包环境](#配置功能包环境)
|
||||
* 4.[编译](#编译)
|
||||
### 安装ROS2
|
||||
----
|
||||
我们提供了ROS2的安装脚本ros2_install.sh,该脚本位于rm_install功能包中的scripts文件夹下,在实际使用时我们需要移动到该路径执行如下指令。
|
||||
```
|
||||
sudo bash ros2_install.sh
|
||||
```
|
||||
如果不想使用脚本安装也可以参考网址 [ROS2_INSTALL](https://docs.ros.org/en/humble/Installation/Ubuntu-Install-Debians.html)。
|
||||
### 安装Moveit2
|
||||
----
|
||||
我们提供了Moveit2的安装脚本moveit2_install.sh,该脚本位于rm_install功能包中的scripts文件夹下,在实际使用时我们需要移动到该路径执行如下指令。
|
||||
```
|
||||
sudo bash moveit2_install.sh
|
||||
```
|
||||
如果不想使用脚本安装也可以参考网址 [Moveit2_INSTALL](https://moveit.ros.org/install-moveit2/binary/)进行安装。
|
||||
### 配置功能包环境
|
||||
----
|
||||
该脚本位于rm_driver功能包中的lib文件夹下,在实际使用时我们需要移动到该路径执行如下指令。
|
||||
```
|
||||
sudo bash lib_install.sh
|
||||
```
|
||||
### 编译
|
||||
----
|
||||
以上执行成功后,可以执行如下指令进行功能包编译,首先需要构建工作空间,并将功能包文件导入工作空间下的src文件夹下,之后使用colcon build指令进行编译。
|
||||
```
|
||||
mkdir -p ~/ros2_ws/src
|
||||
cp -r ros2_rm_robot ~/ros2_ws/src
|
||||
cd ~/ros2_ws
|
||||
colcon build --packages-select rm_ros_interfaces
|
||||
source ./install/setup.bash
|
||||
colcon build
|
||||
```
|
||||
编译完成后即可进行功能包的运行操作。
|
||||
|
||||
|
||||
## 2.功能运行
|
||||
---
|
||||
功能包简介
|
||||
1. 安装与环境配置([rm_install](https://github.com/RealManRobot/ros2_rm_robot/tree/humble/rm_install))
|
||||
* 该功能包为机械臂使用辅助功能包,主要作用为介绍功能包使用环境安装与搭建方式,功能包的依赖库安装和功能包编译方法。
|
||||
3. 硬件驱动([rm_driver](https://github.com/RealManRobot/ros2_rm_robot/tree/humble/rm_driver))
|
||||
* 该功能包为机械臂的ROS2底层驱动功能包,其作用为订阅和发布机械臂底层相关话题信息。
|
||||
5. 启动([rm_bringup](https://github.com/RealManRobot/ros2_rm_robot/tree/humble/rm_bringup))
|
||||
* 该功能包为机械臂的节点启动功能包,其作用为快速启动多节点复合的机械臂功能。
|
||||
6. 模型描述([rm_description](https://github.com/RealManRobot/ros2_rm_robot/tree/humble/rm_description))
|
||||
* 该功能包为机械臂模型描述功能包,其作用为提供机械臂模型文件和模型加载节点,并为其他功能包提供机械臂关节间的坐标变换关系。
|
||||
7. ROS消息接口([rm_ros_interfaces](https://github.com/RealManRobot/ros2_rm_robot/tree/humble/rm_ros_interfaces))
|
||||
* 该功能包为机械臂的消息文件功能包,其作用为提供机械臂适配ROS2的所有控制消息和状态消息。
|
||||
8. Moveit2配置([rm_moveit2_config](https://github.com/RealManRobot/ros2_rm_robot/tree/humble/rm_moveit2_config))
|
||||
* 该功能包为机械臂的moveit2适配功能包,其作用为适配和实现各系列机械臂的moveit2规划控制功能,主要包括虚拟机械臂控制和真实机械臂控制两部分控制功能。
|
||||
9. Moveit2与硬件驱动通信连接([rm_config](https://github.com/RealManRobot/ros2_rm_robot/tree/humble/rm_control))
|
||||
* 该功能包为底层驱动功能包(rm_driver)和moveit2功能包(rm_moveit2_config)之间的通信连接功能包,主要功能为将moveit2的规划点进行细分然后通过透传的形式传递给底层驱动功能包控制机械臂运动。
|
||||
10. Gazebo仿真机械臂控制([rm_gazebo](https://github.com/RealManRobot/ros2_rm_robot/tree/humble/rm_gazebo))
|
||||
* 该功能包为gazebo仿真机械臂功能包,主要功能为在gazebo仿真环境中显示机械臂模型,可通过moveit2对仿真的机械臂进行规划控制。
|
||||
11. 使用案例([rm_examples](https://github.com/RealManRobot/ros2_rm_robot/tree/humble/rm_example))
|
||||
* 该功能包为机械臂的一些使用案例,主要功能为实现机械臂的一些基本的控制功能和运动功能的使用案例。
|
||||
12. 技术文档([rm_docs](https://github.com/RealManRobot/ros2_rm_robot/tree/humble/rm_doc))
|
||||
* 该功能包为介绍文档的功能包,其主要包括为对整体的功能包内容和使用方式进行总体介绍的文档和对每个功能包中的内容和使用方式进行详细介绍的文档。
|
||||
|
||||
以上为当前的十个功能包,每个功能包都有其独特的作用,详情请参考rm_doc功能包下的doc文件夹中的文档进行详细了解。
|
||||
### 2.1运行虚拟机械臂
|
||||
----
|
||||
使用如下指令可以启动gazebo显示仿真机械臂,并同时启动moveit2进行仿真机械臂的规划操控。
|
||||
```
|
||||
source ~/ros2_ws/install/setup.bash
|
||||
ros2 launch rm_bringup rm_<arm_type>_gazebo.launch.py
|
||||
```
|
||||
<arm_type>需要使用65、75、eco65、eco63、63、gen72、gen72_II字符进行代替,如使用RM65机械臂时,命令如下。
|
||||
```
|
||||
ros2 launch rm_bringup rm_65_gazebo.launch.py
|
||||
```
|
||||
启动成功后即可使用moveit2进行虚拟机械臂的控制。
|
||||
### 2.2控制真实机械臂
|
||||
----
|
||||
使用如下指令可以启动机械臂硬件驱动,并同时启动moveit2进行机械臂的规划操控。
|
||||
```
|
||||
source ~/ros2_ws/install/setup.bash
|
||||
ros2 launch rm_bringup rm_<arm_type>_bringup.launch.py
|
||||
```
|
||||
<arm_type>需要使用65、75、eco65、eco63、63、gen72字符进行代替,如使用RM65机械臂时,命令如下。
|
||||
```
|
||||
ros2 launch rm_bringup rm_65_bringup.launch.py
|
||||
```
|
||||
启动成功后即可使用moveit2进行真实机械臂的控制。
|
||||
### 安全提示
|
||||
----
|
||||
在使用机械臂时,为保证使用者安全,请参考如下操作规范。
|
||||
* 每次使用前检查机械臂的安装情况,包括固定螺丝是否松动,机械臂是否存在震动、晃动的情况。
|
||||
* 机械臂在运行过程中,人不可处于机械臂落下或工作范围内,也不可将其他物体放到机械臂动作的安全范围内。
|
||||
* 在不使用机械臂时,应将机械臂置于安全位置,防止震动时机械臂跌落而损坏或砸伤其他物体。
|
||||
* 在不使用机械臂时应及时断开机械臂电源。
|
||||
@@ -0,0 +1,45 @@
|
||||
cmake_minimum_required(VERSION 3.8)
|
||||
project(control_arm_move)
|
||||
|
||||
# Default to C99
|
||||
if(NOT CMAKE_C_STANDARD)
|
||||
set(CMAKE_C_STANDARD 99)
|
||||
endif()
|
||||
|
||||
# Default to C++14
|
||||
if(NOT CMAKE_CXX_STANDARD)
|
||||
set(CMAKE_CXX_STANDARD 14)
|
||||
endif()
|
||||
|
||||
|
||||
if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang")
|
||||
add_compile_options(-Wall -Wextra -Wpedantic)
|
||||
endif()
|
||||
|
||||
# find dependencies
|
||||
find_package(ament_cmake REQUIRED)
|
||||
find_package(rclcpp REQUIRED)
|
||||
find_package(std_msgs REQUIRED)
|
||||
find_package(sensor_msgs REQUIRED)
|
||||
find_package(geometry_msgs REQUIRED)
|
||||
find_package(rm_ros_interfaces REQUIRED)
|
||||
|
||||
if(BUILD_TESTING)
|
||||
find_package(ament_lint_auto REQUIRED)
|
||||
set(ament_cmake_copyright_FOUND TRUE)
|
||||
set(ament_cmake_cpplint_FOUND TRUE)
|
||||
ament_lint_auto_find_test_dependencies()
|
||||
endif()
|
||||
|
||||
add_executable(move_demo src/api_Move_demo.cpp)
|
||||
|
||||
ament_target_dependencies(move_demo rclcpp std_msgs rm_ros_interfaces)
|
||||
|
||||
|
||||
install(DIRECTORY launch
|
||||
DESTINATION share/${PROJECT_NAME})
|
||||
|
||||
install(TARGETS
|
||||
move_demo
|
||||
DESTINATION lib/${PROJECT_NAME})
|
||||
ament_package()
|
||||
@@ -0,0 +1,13 @@
|
||||
Copyright 2024 realman-robotics
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
@@ -0,0 +1,219 @@
|
||||
# 机械臂运动控制`ARM_MOVE_DEMO`
|
||||
|
||||
---
|
||||
|
||||
## 1.项目介绍
|
||||
|
||||
本项目是一个基于RM65、RM75机械臂和ROS功能包实现MoveJ、MoveJ_P、MoveL、MoveC规划运动功能,在程序执行时将依次执行关节运动MoveJ指令,位姿运动MoveJ_P指令、直线运动MoveL指令,圆弧运动MoveC指令,在执行成功或失败时终端都会收到相关提示,目的是使ROS开发者迅速掌握并灵活运用机械臂。
|
||||
|
||||
## 2.代码结构
|
||||
|
||||
```
|
||||
├── CMakeLists.txt <-CMake编译文件
|
||||
├── launch <-启动文件夹
|
||||
│ ├── rm_65_move.launch.py <-启动文件(RM65)
|
||||
│ └── rm_75_move.launch.py <-启动文件(RM75)
|
||||
├── LICENSE <-版本说明
|
||||
├── package.xml <-依赖描述文件夹
|
||||
├── README.md <-说明文档
|
||||
└── src <-C++源码文件夹
|
||||
└── api_Move_demo.cpp <-源码文件
|
||||
```
|
||||
|
||||
## 3.项目下载
|
||||
|
||||
通过项目链接下载本项目工程文件到本地:[ros2_rm_robot](https://github.com/RealManRobot/ros2_rm_robot/tree/humble)
|
||||
|
||||
## 4.环境配置
|
||||
|
||||
| 项目 | 内容 |
|
||||
| :-- | :-- |
|
||||
| 系统 | Ubuntu22.04 |
|
||||
| ROS版本 | humble |
|
||||
| 依赖 | 机械臂的ROS2-humble功能包 |
|
||||
|
||||
**配置过程**
|
||||
|
||||
1. 首先需要准备好Ubuntu22.04操作系统的虚拟机或其他设备。
|
||||
2. 安装ROS2环境[humble](https://docs.ros.org/en/humble/Installation/Ubuntu-Install-Debians.html),也可参考ROS2-humble功能包中的安装说明进行安装。
|
||||
3. ROS2-Humble功能包安装
|
||||
|
||||
新建工作空间和src文件
|
||||
```
|
||||
mkdir -p ~/ros2_ws/src
|
||||
```
|
||||
|
||||
将ROS2文件放入src中
|
||||
```
|
||||
cp -r ros2_rm_robot ~/ros2_ws/src
|
||||
```
|
||||
|
||||
进入工作空间
|
||||
```
|
||||
cd ~/ros2_ws
|
||||
```
|
||||
|
||||
编译rm_ros_interfaces功能包
|
||||
```
|
||||
colcon build --packages-select rm_ros_interfaces
|
||||
```
|
||||
声明环境变量
|
||||
```
|
||||
source ./install/setup.bash
|
||||
```
|
||||
|
||||
编译所有功能包
|
||||
```
|
||||
colcon build
|
||||
```
|
||||
|
||||
再次声明环境变量
|
||||
```
|
||||
source ./install/setup.bash
|
||||
```
|
||||
|
||||
## 5.使用指南
|
||||
|
||||
* **命令行使用**:
|
||||
|
||||
我们需要在一个终端中启动机械臂的rm_driver功能包。
|
||||
|
||||
```
|
||||
ros2 launch rm_driver rm_<arm_type>_driver.launch.py
|
||||
```
|
||||
|
||||
<arm_type>可以为65、63、eco65、75、gen72,可对照自己使用的设备进行实际选择
|
||||
若我们的机械臂为RM65机械臂时应使用如下启动指令。
|
||||
|
||||
```
|
||||
ros2 launch control_arm_move rm_65_move.launch.py
|
||||
```
|
||||
|
||||
若为RM75机械臂时应使用如下启动指令。
|
||||
|
||||
```
|
||||
ros2 launch control_arm_move rm_75_move.launch.py
|
||||
```
|
||||
|
||||
> 若非RM65、RM75机械臂可能会出现无法到达点位的情况,为正常现象。
|
||||
|
||||
* **返回信息**:
|
||||
|
||||
在程序成功运行时将会出现以下提示信息。
|
||||
```
|
||||
[move_demo-1] [INFO] [1722921182.157890965] [Move_demo_pub_node]: arm_dof is 7 //当前控制机械臂自由度提示
|
||||
[move_demo-1]
|
||||
[move_demo-1] [INFO] [1722921188.120872813] [Move_demo_sub_node]: *******Movej succeeded //MoveJ运动成功时的提示信息
|
||||
[move_demo-1]
|
||||
[move_demo-1] [INFO] [1722921191.708291782] [Move_demo_sub_node]: *******Movej_p succeeded //MoveJ_P运动成功时的提示信息
|
||||
[move_demo-1]
|
||||
[move_demo-1] [INFO] [1722921193.977513811] [Move_demo_sub_node]: *******MoveL succeeded //MoveL运动成功时的提示信息
|
||||
[move_demo-1]
|
||||
[move_demo-1] [INFO] [1722921194.075138936] [Move_demo_sub_node]: *******MoveC succeeded //MoveC运动成功时的提示信息
|
||||
```
|
||||
## 6.关键代码说明
|
||||
|
||||
下面是 `api_Move_demo.cpp` 文件的主要功能:
|
||||
|
||||
- **初始化**
|
||||
相关发布订阅信息初始化
|
||||
|
||||
声明movej_p发布器
|
||||
```
|
||||
rclcpp::Publisher<rm_ros_interfaces::msg::Movejp>::SharedPtr movej_p_publisher_;
|
||||
```
|
||||
|
||||
声明movel发布器
|
||||
```
|
||||
rclcpp::Publisher<rm_ros_interfaces::msg::Movel>::SharedPtr movel_publisher_;
|
||||
```
|
||||
|
||||
声明movej发布器
|
||||
```
|
||||
rclcpp::Publisher<rm_ros_interfaces::msg::Movej>::SharedPtr movej_publisher_;
|
||||
```
|
||||
|
||||
声明movec发布器
|
||||
```
|
||||
rclcpp::Publisher<rm_ros_interfaces::msg::Movec>::SharedPtr movec_publisher_;
|
||||
```
|
||||
|
||||
声明movej_p订阅器
|
||||
```
|
||||
rclcpp::Subscription<std_msgs::msg::Bool>::SharedPtr movej_p_subscription_;
|
||||
```
|
||||
|
||||
声明movel订阅器
|
||||
```
|
||||
rclcpp::Subscription<std_msgs::msg::Bool>::SharedPtr movel_subscription_;
|
||||
```
|
||||
|
||||
声明movej订阅器
|
||||
```
|
||||
rclcpp::Subscription<std_msgs::msg::Bool>::SharedPtr movej_subscription_;
|
||||
```
|
||||
|
||||
声明movec订阅器
|
||||
```
|
||||
rclcpp::Subscription<std_msgs::msg::Bool>::SharedPtr movec_subscription_;
|
||||
```
|
||||
|
||||
- **回调函数**
|
||||
接收机械臂版本信息,进入消息回调函数
|
||||
|
||||
构造函数
|
||||
```
|
||||
MoveDemoSub();
|
||||
```
|
||||
|
||||
movej_p结果回调函数
|
||||
```
|
||||
void MoveJPDemo_Callback(const std_msgs::msg::Bool::SharedPtr msg);
|
||||
```
|
||||
|
||||
movel结果回调函数
|
||||
```
|
||||
void MoveJDemo_Callback(const std_msgs::msg::Bool::SharedPtr msg);
|
||||
```
|
||||
|
||||
movej结果回调函数
|
||||
```
|
||||
void MoveLDemo_Callback(const std_msgs::msg::Bool::SharedPtr msg);
|
||||
```
|
||||
|
||||
movec结果回调函数
|
||||
```
|
||||
void MoveCDemo_Callback(const std_msgs::msg::Bool::SharedPtr msg);
|
||||
```
|
||||
|
||||
- **发布MoveJ指令**
|
||||
发布MoveJ指令使机械臂运动到目标位姿。
|
||||
|
||||
```ROS
|
||||
this->movej_publisher_->publish(movej_way);
|
||||
```
|
||||
|
||||
- **发布MoveJ_P指令**
|
||||
发布MoveJ_P指令使机械臂运动到目标位姿。
|
||||
|
||||
```ROS
|
||||
this->movej_p_publisher_->publish(moveJ_P_TargetPose);
|
||||
```
|
||||
|
||||
- **发布MoveL指令**
|
||||
发布MoveL指令使机械臂运动到目标位姿。
|
||||
|
||||
```ROS
|
||||
this->movel_publisher_->publish(moveL_TargetPose);
|
||||
```
|
||||
|
||||
- **发布MoveC指令**
|
||||
发布MoveC指令使机械臂运动到目标位姿。
|
||||
|
||||
```ROS
|
||||
this->movec_publisher_->publish(moveC_TargetPose);
|
||||
```
|
||||
|
||||
## 7.许可证信息
|
||||
|
||||
* 具体许可证内容请参见`LICENSE`文件。
|
||||
@@ -0,0 +1,17 @@
|
||||
from launch import LaunchDescription
|
||||
from launch_ros.actions import Node
|
||||
def generate_launch_description():
|
||||
ld = LaunchDescription()
|
||||
move_node = Node(
|
||||
package='control_arm_move', #节点所在的功能包
|
||||
executable='move_demo', #表示要运行的可执行文件名或脚本名字.py
|
||||
parameters= [
|
||||
{'arm_dof': 6}
|
||||
], #接入自由度参数
|
||||
output='screen', #用于将话题信息打印到屏幕
|
||||
)
|
||||
|
||||
ld.add_action(move_node)
|
||||
return ld
|
||||
|
||||
|
||||
@@ -0,0 +1,17 @@
|
||||
from launch import LaunchDescription
|
||||
from launch_ros.actions import Node
|
||||
def generate_launch_description():
|
||||
ld = LaunchDescription()
|
||||
move_node = Node(
|
||||
package='control_arm_move', #节点所在的功能包
|
||||
executable='move_demo', #表示要运行的可执行文件名或脚本名字.py
|
||||
parameters= [
|
||||
{'arm_dof': 7}
|
||||
], #接入自由度参数
|
||||
output='screen', #用于将话题信息打印到屏幕
|
||||
)
|
||||
|
||||
ld.add_action(move_node)
|
||||
return ld
|
||||
|
||||
|
||||
@@ -0,0 +1,21 @@
|
||||
<?xml version="1.0"?>
|
||||
<?xml-model href="http://download.ros.org/schema/package_format3.xsd" schematypens="http://www.w3.org/2001/XMLSchema"?>
|
||||
<package format="3">
|
||||
<name>control_arm_move</name>
|
||||
<version>0.0.0</version>
|
||||
<description>TODO: Package description</description>
|
||||
<maintainer email="2209099554@qq.com">rm</maintainer>
|
||||
<license>TODO: License declaration</license>
|
||||
|
||||
<buildtool_depend>ament_cmake</buildtool_depend>
|
||||
|
||||
<depend>rclcpp</depend>
|
||||
<depend>rm_ros_interfaces</depend>
|
||||
|
||||
<test_depend>ament_lint_auto</test_depend>
|
||||
<test_depend>ament_lint_common</test_depend>
|
||||
|
||||
<export>
|
||||
<build_type>ament_cmake</build_type>
|
||||
</export>
|
||||
</package>
|
||||
@@ -0,0 +1,260 @@
|
||||
//
|
||||
// Created by ubuntu on 23-11-28.
|
||||
//
|
||||
#include <iostream>
|
||||
#include <chrono>
|
||||
#include <functional>
|
||||
#include <memory>
|
||||
#include <unistd.h>
|
||||
#include <thread>
|
||||
#include "rclcpp/rclcpp.hpp"
|
||||
#include "rm_ros_interfaces/msg/movejp.hpp"
|
||||
#include "rm_ros_interfaces/msg/movel.hpp"
|
||||
#include "rm_ros_interfaces/msg/movej.hpp"
|
||||
#include "rm_ros_interfaces/msg/movec.hpp"
|
||||
#include "std_msgs/msg/bool.hpp"
|
||||
|
||||
using namespace std::chrono_literals;
|
||||
using std::placeholders::_1;
|
||||
bool movej_state = false;
|
||||
bool movej_p_state = false;
|
||||
bool movel_state = false;
|
||||
bool movec_state = false;
|
||||
bool first_run = true;
|
||||
/****************************************创建类************************************/
|
||||
class MoveDemoPub: public rclcpp::Node
|
||||
{
|
||||
public:
|
||||
MoveDemoPub(); //构造函数
|
||||
void looppub_timer_callback(); //move运动规划函数
|
||||
|
||||
|
||||
|
||||
private:
|
||||
rclcpp::Publisher<rm_ros_interfaces::msg::Movejp>::SharedPtr movej_p_publisher_; //声明发布器
|
||||
rclcpp::Publisher<rm_ros_interfaces::msg::Movel>::SharedPtr movel_publisher_; //声明发布器
|
||||
rclcpp::Publisher<rm_ros_interfaces::msg::Movej>::SharedPtr movej_publisher_; //声明发布器
|
||||
rclcpp::Publisher<rm_ros_interfaces::msg::Movec>::SharedPtr movec_publisher_;
|
||||
rclcpp::TimerBase::SharedPtr loop_pub_Timer; //定时发布器
|
||||
rm_ros_interfaces::msg::Movej movej_way;
|
||||
int arm_dof_ = 6;
|
||||
};
|
||||
|
||||
/****************************************创建类************************************/
|
||||
class MoveDemoSub: public rclcpp::Node
|
||||
{
|
||||
public:
|
||||
MoveDemoSub(); //构造函数
|
||||
void MoveJPDemo_Callback(const std_msgs::msg::Bool::SharedPtr msg); //结果回调函数
|
||||
void MoveJDemo_Callback(const std_msgs::msg::Bool::SharedPtr msg); //结果回调函数
|
||||
void MoveLDemo_Callback(const std_msgs::msg::Bool::SharedPtr msg); //结果回调函数
|
||||
void MoveCDemo_Callback(const std_msgs::msg::Bool::SharedPtr msg); //结果回调函数
|
||||
|
||||
|
||||
private:
|
||||
rclcpp::Subscription<std_msgs::msg::Bool>::SharedPtr movej_p_subscription_; //声明订阅器
|
||||
rclcpp::Subscription<std_msgs::msg::Bool>::SharedPtr movel_subscription_; //声明订阅器
|
||||
rclcpp::Subscription<std_msgs::msg::Bool>::SharedPtr movej_subscription_; //声明订阅器
|
||||
rclcpp::Subscription<std_msgs::msg::Bool>::SharedPtr movec_subscription_; //声明订阅器
|
||||
};
|
||||
|
||||
|
||||
/******************************接收到订阅的机械臂执行状态消息后,会进入消息回调函数**************************/
|
||||
void MoveDemoSub::MoveJPDemo_Callback(const std_msgs::msg::Bool::SharedPtr msg)
|
||||
{
|
||||
// 将接收到的消息打印出来,显示是否执行成功
|
||||
movej_p_state = msg->data;
|
||||
if(msg->data)
|
||||
{
|
||||
RCLCPP_INFO (this->get_logger(),"*******Movej_p succeeded\n");
|
||||
} else {
|
||||
RCLCPP_ERROR (this->get_logger(),"*******Movej_p Failed\n");
|
||||
}
|
||||
}
|
||||
/***********************************************end**************************************************/
|
||||
|
||||
/******************************接收到订阅的机械臂执行状态消息后,会进入消息回调函数**************************/
|
||||
void MoveDemoSub::MoveLDemo_Callback(const std_msgs::msg::Bool::SharedPtr msg)
|
||||
{
|
||||
// 将接收到的消息打印出来,显示是否执行成功
|
||||
movel_state = msg->data;
|
||||
if(msg->data)
|
||||
{
|
||||
RCLCPP_INFO (this->get_logger(),"*******MoveL succeeded\n");
|
||||
} else {
|
||||
RCLCPP_ERROR (this->get_logger(),"*******MoveL Failed\n");
|
||||
}
|
||||
}
|
||||
/***********************************************end**************************************************/
|
||||
|
||||
/******************************接收到订阅的机械臂执行状态消息后,会进入消息回调函数**************************/
|
||||
void MoveDemoSub::MoveJDemo_Callback(const std_msgs::msg::Bool::SharedPtr msg)
|
||||
{
|
||||
// 将接收到的消息打印出来,显示是否执行成功
|
||||
movej_state = msg->data;
|
||||
if(msg->data)
|
||||
{
|
||||
RCLCPP_INFO (this->get_logger(),"*******Movej succeeded\n");
|
||||
} else {
|
||||
RCLCPP_ERROR (this->get_logger(),"*******Movej Failed\n");
|
||||
}
|
||||
}
|
||||
/***********************************************end**************************************************/
|
||||
|
||||
/******************************接收到订阅的机械臂执行状态消息后,会进入消息回调函数**************************/
|
||||
void MoveDemoSub::MoveCDemo_Callback(const std_msgs::msg::Bool::SharedPtr msg)
|
||||
{
|
||||
// 将接收到的消息打印出来,显示是否执行成功
|
||||
movec_state = msg->data;
|
||||
if(msg->data)
|
||||
{
|
||||
RCLCPP_INFO (this->get_logger(),"*******MoveC succeeded\n");
|
||||
} else {
|
||||
RCLCPP_ERROR (this->get_logger(),"*******MoveC Failed\n");
|
||||
}
|
||||
}
|
||||
/***********************************************end**************************************************/
|
||||
|
||||
/*******************************************movejp运动函数****************************************/
|
||||
void MoveDemoPub::looppub_timer_callback()
|
||||
{
|
||||
if(first_run == true)
|
||||
{
|
||||
|
||||
if(arm_dof_ == 6)
|
||||
{
|
||||
movej_way.joint[0] = -0.360829;
|
||||
movej_way.joint[1] = 0.528468;
|
||||
movej_way.joint[2] = 1.326293;
|
||||
movej_way.joint[3] = -0.000454;
|
||||
movej_way.joint[4] = 1.221748;
|
||||
movej_way.joint[5] = 0.000052;
|
||||
movej_way.speed = 20;
|
||||
movej_way.dof = 6;
|
||||
}
|
||||
if(arm_dof_ == 7)
|
||||
{
|
||||
movej_way.joint[0] = 0.176278;
|
||||
movej_way.joint[1] = 0.0;
|
||||
movej_way.joint[2] = 0.3543;
|
||||
movej_way.joint[3] = 0.53;
|
||||
movej_way.joint[4] = 0.00873;
|
||||
movej_way.joint[5] = 0.3595;
|
||||
movej_way.joint[6] = 0.3595;
|
||||
movej_way.speed = 20;
|
||||
movej_way.dof = 7;
|
||||
}
|
||||
movej_way.block = true;
|
||||
this->movej_publisher_->publish(movej_way);
|
||||
first_run = false;
|
||||
std::this_thread::sleep_for(std::chrono::milliseconds(1000));
|
||||
|
||||
}
|
||||
if(movej_state == true)
|
||||
{
|
||||
rm_ros_interfaces::msg::Movejp moveJ_P_TargetPose;
|
||||
moveJ_P_TargetPose.pose.position.x = -0.355816;
|
||||
moveJ_P_TargetPose.pose.position.y = -0.000013;
|
||||
moveJ_P_TargetPose.pose.position.z = 0.222814;
|
||||
moveJ_P_TargetPose.pose.orientation.x = 0.995179;
|
||||
moveJ_P_TargetPose.pose.orientation.y = -0.094604;
|
||||
moveJ_P_TargetPose.pose.orientation.z = -0.025721;
|
||||
moveJ_P_TargetPose.pose.orientation.w = 0.002349;
|
||||
moveJ_P_TargetPose.speed = 20;
|
||||
moveJ_P_TargetPose.block = true;
|
||||
this->movej_p_publisher_->publish(moveJ_P_TargetPose);
|
||||
movej_state = false;
|
||||
std::this_thread::sleep_for(std::chrono::milliseconds(1000));
|
||||
}
|
||||
|
||||
if(movej_p_state == true)
|
||||
{
|
||||
rm_ros_interfaces::msg::Movel moveL_TargetPose;
|
||||
moveL_TargetPose.pose.position.x = -0.255816;
|
||||
moveL_TargetPose.pose.position.y = -0.000013;
|
||||
moveL_TargetPose.pose.position.z = 0.222814;
|
||||
moveL_TargetPose.pose.orientation.x = 0.995179;
|
||||
moveL_TargetPose.pose.orientation.y = -0.094604;
|
||||
moveL_TargetPose.pose.orientation.z = -0.025721;
|
||||
moveL_TargetPose.pose.orientation.w = 0.002349;
|
||||
moveL_TargetPose.speed = 20;
|
||||
moveL_TargetPose.block = true;
|
||||
this->movel_publisher_->publish(moveL_TargetPose);
|
||||
movej_p_state = false;
|
||||
std::this_thread::sleep_for(std::chrono::milliseconds(1000));
|
||||
}
|
||||
|
||||
if(movel_state == true)
|
||||
{
|
||||
rm_ros_interfaces::msg::Movec moveC_TargetPose;
|
||||
moveC_TargetPose.pose_mid.position.x = -0.307239;
|
||||
moveC_TargetPose.pose_mid.position.y = 0.150903;
|
||||
moveC_TargetPose.pose_mid.position.z = 0.222814;
|
||||
moveC_TargetPose.pose_mid.orientation.x = 0.995179;
|
||||
moveC_TargetPose.pose_mid.orientation.y = -0.094604;
|
||||
moveC_TargetPose.pose_mid.orientation.z = -0.025721;
|
||||
moveC_TargetPose.pose_mid.orientation.w = 0.002349;
|
||||
moveC_TargetPose.pose_end.position.x = -0.357239;
|
||||
moveC_TargetPose.pose_end.position.y = 0.000903;
|
||||
moveC_TargetPose.pose_end.position.z = 0.222814;
|
||||
moveC_TargetPose.pose_end.orientation.x = 0.995179;
|
||||
moveC_TargetPose.pose_end.orientation.y = -0.094604;
|
||||
moveC_TargetPose.pose_end.orientation.z = -0.025721;
|
||||
moveC_TargetPose.pose_end.orientation.w = 0.002349;
|
||||
moveC_TargetPose.speed = 20;
|
||||
moveC_TargetPose.loop = 1;
|
||||
moveC_TargetPose.trajectory_connect = 0;
|
||||
moveC_TargetPose.block = true;
|
||||
this->movec_publisher_->publish(moveC_TargetPose);
|
||||
movel_state = false;
|
||||
}
|
||||
|
||||
}
|
||||
/***********************************************end**************************************************/
|
||||
|
||||
|
||||
/***********************************构造函数,初始化发布器订阅器****************************************/
|
||||
MoveDemoPub::MoveDemoPub():rclcpp::Node("Move_demo_pub_node")
|
||||
{
|
||||
this->declare_parameter<int>("arm_dof", arm_dof_);
|
||||
this->get_parameter("arm_dof", arm_dof_);
|
||||
RCLCPP_INFO (this->get_logger(),"arm_dof is %d\n",arm_dof_);
|
||||
if(arm_dof_ == 6)
|
||||
{movej_way.joint.resize(6);}
|
||||
else if(arm_dof_ == 7)
|
||||
{movej_way.joint.resize(7);}
|
||||
movej_p_publisher_ = this->create_publisher<rm_ros_interfaces::msg::Movejp>("/rm_driver/movej_p_cmd", rclcpp::ParametersQoS());
|
||||
movel_publisher_ = this->create_publisher<rm_ros_interfaces::msg::Movel>("/rm_driver/movel_cmd", rclcpp::ParametersQoS());
|
||||
movej_publisher_ = this->create_publisher<rm_ros_interfaces::msg::Movej>("/rm_driver/movej_cmd", rclcpp::ParametersQoS());
|
||||
movec_publisher_ = this->create_publisher<rm_ros_interfaces::msg::Movec>("/rm_driver/movec_cmd", rclcpp::ParametersQoS());
|
||||
loop_pub_Timer = this->create_wall_timer(std::chrono::milliseconds(100),
|
||||
std::bind(&MoveDemoPub::looppub_timer_callback,this));
|
||||
std::this_thread::sleep_for(std::chrono::milliseconds(3000));
|
||||
|
||||
}
|
||||
/***********************************************end**************************************************/
|
||||
|
||||
/***********************************构造函数,初始化发布器订阅器****************************************/
|
||||
MoveDemoSub::MoveDemoSub():rclcpp::Node("Move_demo_sub_node")
|
||||
{
|
||||
movej_p_subscription_ = this->create_subscription<std_msgs::msg::Bool>("/rm_driver/movej_p_result", rclcpp::ParametersQoS(), std::bind(&MoveDemoSub::MoveJPDemo_Callback, this,_1));
|
||||
movel_subscription_ = this->create_subscription<std_msgs::msg::Bool>("/rm_driver/movel_result", rclcpp::ParametersQoS(), std::bind(&MoveDemoSub::MoveLDemo_Callback, this,_1));
|
||||
movej_subscription_ = this->create_subscription<std_msgs::msg::Bool>("/rm_driver/movej_result", rclcpp::ParametersQoS(), std::bind(&MoveDemoSub::MoveJDemo_Callback, this,_1));
|
||||
movec_subscription_ = this->create_subscription<std_msgs::msg::Bool>("/rm_driver/movec_result", rclcpp::ParametersQoS(), std::bind(&MoveDemoSub::MoveCDemo_Callback, this,_1));
|
||||
}
|
||||
/***********************************************end**************************************************/
|
||||
|
||||
/******************************************************主函数*********************************************/
|
||||
int main(int argc, char** argv)
|
||||
{
|
||||
rclcpp::init(argc, argv);
|
||||
rclcpp::executors::SingleThreadedExecutor executor;
|
||||
auto node_sub = std::make_shared<MoveDemoSub>();
|
||||
auto node_pub = std::make_shared<MoveDemoPub>();
|
||||
executor.add_node(node_pub);
|
||||
executor.add_node(node_sub);
|
||||
executor.spin();
|
||||
rclcpp::shutdown();
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,47 @@
|
||||
cmake_minimum_required(VERSION 3.8)
|
||||
project(force_position_control)
|
||||
|
||||
# Default to C99
|
||||
if(NOT CMAKE_C_STANDARD)
|
||||
set(CMAKE_C_STANDARD 99)
|
||||
endif()
|
||||
|
||||
# Default to C++14
|
||||
if(NOT CMAKE_CXX_STANDARD)
|
||||
set(CMAKE_CXX_STANDARD 14)
|
||||
endif()
|
||||
|
||||
|
||||
if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang")
|
||||
add_compile_options(-Wall -Wextra -Wpedantic)
|
||||
endif()
|
||||
|
||||
# find dependencies
|
||||
find_package(ament_cmake REQUIRED)
|
||||
find_package(rclcpp REQUIRED)
|
||||
find_package(std_msgs REQUIRED)
|
||||
find_package(sensor_msgs REQUIRED)
|
||||
find_package(geometry_msgs REQUIRED)
|
||||
find_package(rm_ros_interfaces REQUIRED)
|
||||
|
||||
|
||||
if(BUILD_TESTING)
|
||||
find_package(ament_lint_auto REQUIRED)
|
||||
|
||||
set(ament_cmake_copyright_FOUND TRUE)
|
||||
|
||||
set(ament_cmake_cpplint_FOUND TRUE)
|
||||
ament_lint_auto_find_test_dependencies()
|
||||
endif()
|
||||
|
||||
add_executable(rm_force_position_control src/api_Force_Position_Control_demo.cpp)
|
||||
|
||||
ament_target_dependencies(rm_force_position_control rclcpp std_msgs rm_ros_interfaces)
|
||||
|
||||
install(DIRECTORY launch
|
||||
DESTINATION share/${PROJECT_NAME})
|
||||
|
||||
install(TARGETS
|
||||
rm_force_position_control
|
||||
DESTINATION lib/${PROJECT_NAME})
|
||||
ament_package()
|
||||
@@ -0,0 +1,13 @@
|
||||
Copyright 2024 realman-robotics
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
@@ -0,0 +1,169 @@
|
||||
# 力位混合控制规划`ARM_FORCE_POSITION_CONTROL_DEMO`
|
||||
|
||||
---
|
||||
|
||||
## **1.项目介绍**
|
||||
|
||||
本项目是一个基于RM65、RM75机械臂和ROS功能包实现力位混合控制规划运动功能(该功能适用于类似于MoveL的笛卡尔运动,不适用与MoveJ等关节运动),程序在执行时会依次执行开启力位混合控制,进行笛卡尔运动,关闭力位混合控制的操作,目的是使ROS开发者迅速掌握并灵活运用机械臂。
|
||||
|
||||
## **2. 代码结构**
|
||||
|
||||
```
|
||||
├── CMakeLists.txt <-CMake编译文件
|
||||
├── launch <-启动文件夹
|
||||
│ └── force_position_control_demo.launch <-启动文件
|
||||
├── LICENSE <-版本说明
|
||||
├── package.xml <-依赖描述文件夹
|
||||
├── README.md <-说明文档
|
||||
└── src <-C++源码文件夹
|
||||
└── api_force_position_control_demo.cpp <-源码文件
|
||||
```
|
||||
## **3.项目下载**
|
||||
|
||||
通过项目链接下载本项目工程文件到本地:[ros2_rm_robot](https://github.com/RealManRobot/ros2_rm_robot/tree/humble)
|
||||
|
||||
## **4.环境配置**
|
||||
|
||||
| 项目 | 内容 |
|
||||
| :-- | :-- |
|
||||
| 系统 | Ubuntu22.04 |
|
||||
| ROS版本 | humble |
|
||||
| 依赖 | 机械臂的ROS2-humble功能包 |
|
||||
|
||||
**配置过程**
|
||||
|
||||
1. 首先需要准备好Ubuntu22.04操作系统的虚拟机或其他设备。
|
||||
2. 安装ROS2环境[humble](https://docs.ros.org/en/humble/Installation/Ubuntu-Install-Debians.html),也可参考ROS2-humble功能包中的安装说明进行安装。
|
||||
3. ROS2-Humble功能包安装
|
||||
|
||||
新建工作空间和src文件
|
||||
```
|
||||
mkdir -p ~/ros2_ws/src
|
||||
```
|
||||
|
||||
将ROS2文件放入src中
|
||||
```
|
||||
cp -r ros2_rm_robot ~/ros2_ws/src
|
||||
```
|
||||
|
||||
进入工作空间
|
||||
```
|
||||
cd ~/ros2_ws
|
||||
```
|
||||
|
||||
编译rm_ros_interfaces功能包
|
||||
```
|
||||
colcon build --packages-select rm_ros_interfaces
|
||||
```
|
||||
声明环境变量
|
||||
```
|
||||
source ./install/setup.bash
|
||||
```
|
||||
|
||||
编译所有功能包
|
||||
```
|
||||
colcon build
|
||||
```
|
||||
|
||||
再次声明环境变量
|
||||
```
|
||||
source ./install/setup.bash
|
||||
|
||||
## **5. 使用指南**
|
||||
|
||||
* **命令行使用**:
|
||||
|
||||
我们需要在一个终端中启动机械臂的rm_driver功能包。
|
||||
```
|
||||
ros2 launch rm_driver rm_<arm_type>_driver.launch.py
|
||||
```
|
||||
<arm_type>可以为65、63、eco65、75、gen72,可对照自己使用的设备进行实际选择
|
||||
我们需要在另一个终端中启动机械臂的force_position_control功能包。
|
||||
```
|
||||
ros2 launch force_position_control force_position_control_demo.launch.py
|
||||
```
|
||||
若非RM65、RM75机械臂可能会出现无法到达点位的情况,为正常现象。
|
||||
* **返回信息**:
|
||||
|
||||
在程序成功运行时将会出现以下提示信息。
|
||||
```
|
||||
[rm_force_position_control-1] [INFO] [1722914114.076652595] [Force_Position_Control_sub_node]: *******Movej_p succeeded //Movej_p运动成功提示
|
||||
[rm_force_position_control-1]
|
||||
[rm_force_position_control-1] [INFO] [1722914114.248853737] [Force_Position_Control_sub_node]: *******Set Force Postion succeeded //力位混合控制设置成功提示
|
||||
[rm_force_position_control-1]
|
||||
[rm_force_position_control-1] [INFO] [1722914116.432832020] [Force_Position_Control_sub_node]: *******MoveL succeeded //Movel运动成功提示
|
||||
[rm_force_position_control-1]
|
||||
[rm_force_position_control-1] [INFO] [1722914116.548136946] [Force_Position_Control_sub_node]: *******Stop Force Postion succeeded //结束力位混合控制设置成功提示
|
||||
[rm_force_position_control-1]
|
||||
[rm_force_position_control-1] [INFO] [1722914116.647943527] [Force_Position_Control_pub_node]: *******All step run over //指令运行完成提示
|
||||
```
|
||||
|
||||
* **关键代码说明**:
|
||||
|
||||
下面是 `api_force_position_control_demo.cpp` 文件的主要功能:
|
||||
|
||||
- **初始化**
|
||||
相关发布订阅信息初始化
|
||||
|
||||
```ROS
|
||||
rclcpp::Subscription<std_msgs::msg::Bool>::SharedPtr movej_p_subscription_; //声明movej_p运动订阅器
|
||||
rclcpp::Subscription<std_msgs::msg::Bool>::SharedPtr movel_subscription_; //声明movel运动订阅器
|
||||
|
||||
rclcpp::Subscription<std_msgs::msg::Bool>::SharedPtr set_force_postion_subscription_; //声明力位混合控制订阅器
|
||||
rclcpp::Subscription<std_msgs::msg::Bool>::SharedPtr stop_force_postion_subscription_; //声明停止力位混合控制订阅器
|
||||
rclcpp::Publisher<rm_ros_interfaces::msg::Movejp>::SharedPtr movej_p_publisher_; //声明Movej_p运动发布器
|
||||
rclcpp::Publisher<rm_ros_interfaces::msg::Movel>::SharedPtr movel_publisher_; //声明Movel运动发布器
|
||||
|
||||
rclcpp::Publisher<rm_ros_interfaces::msg::Setforceposition>::SharedPtr set_force_postion_publisher_; //声明力位混合控制发布器
|
||||
rclcpp::Publisher<std_msgs::msg::Bool>::SharedPtr stop_force_postion_publisher_; //声明停止力位混合控制发布器
|
||||
```
|
||||
|
||||
- **回调函数**
|
||||
接收到订阅的机械臂执行状态消息后,会进入消息回调函数
|
||||
|
||||
void MoveJPDemo_Callback(const std_msgs::msg::Bool::SharedPtr msg); //Movej_p运动结果回调函数
|
||||
void SetForcePostionDemo_Callback(const std_msgs::msg::Bool::SharedPtr msg); //力位混合控制结果回调函数
|
||||
void MoveLDemo_Callback(const std_msgs::msg::Bool::SharedPtr msg); //Movel运动结果回调函数
|
||||
void StopForcePostionDemo_Callback(const std_msgs::msg::Bool::SharedPtr msg); //停止力位混合控制结果回调函数
|
||||
|
||||
- **发布MoveJ_P指令**
|
||||
发布MoveJ_P指令使机械臂运动到目标位姿。
|
||||
|
||||
```ROS
|
||||
this->movej_p_publisher_->publish(moveJ_P_TargetPose);
|
||||
```
|
||||
|
||||
- **发布开启力位混合指令**
|
||||
设置机械臂开启力位混合指令。
|
||||
|
||||
```ROS
|
||||
this->set_force_postion_publisher_->publish(forceposition_data);
|
||||
```
|
||||
|
||||
- **发布MoveL指令**
|
||||
发布MoveL指令使机械臂运动到目标位姿。
|
||||
|
||||
```ROS
|
||||
this->movel_publisher_->publish(moveL_TargetPose);
|
||||
```
|
||||
|
||||
- **发布关闭力位混合指令**
|
||||
发布MoveL指令使机械臂运动到目标位姿。
|
||||
|
||||
```ROS
|
||||
this->stop_force_postion_publisher_->publish(stop_force_postion_data);
|
||||
```
|
||||
|
||||
## **6. 许可证信息**
|
||||
|
||||
* 具体许可证内容请参见`LICENSE`文件。
|
||||
|
||||
## **7. 常见问题解答(FAQ)**
|
||||
|
||||
- **Q1:机械臂连接失败**
|
||||
|
||||
答案:修改过机械臂IP
|
||||
|
||||
- **Q2:UDP数据推送接口收不到数据**
|
||||
|
||||
答案:检查线程模式、是否使能推送数据、IP以及防火墙
|
||||
@@ -0,0 +1,12 @@
|
||||
from launch import LaunchDescription
|
||||
from launch_ros.actions import Node
|
||||
def generate_launch_description():
|
||||
ld = LaunchDescription()
|
||||
force_position_control_node = Node(
|
||||
package='force_position_control', #节点所在的功能包
|
||||
executable='rm_force_position_control', #表示要运行的可执行文件名或脚本名字.py
|
||||
output='screen', #用于将话题信息打印到屏幕
|
||||
)
|
||||
|
||||
ld.add_action(force_position_control_node)
|
||||
return ld
|
||||
@@ -0,0 +1,21 @@
|
||||
<?xml version="1.0"?>
|
||||
<?xml-model href="http://download.ros.org/schema/package_format3.xsd" schematypens="http://www.w3.org/2001/XMLSchema"?>
|
||||
<package format="3">
|
||||
<name>force_position_control</name>
|
||||
<version>0.0.0</version>
|
||||
<description>TODO: Package description</description>
|
||||
<maintainer email="2209099554@qq.com">rm</maintainer>
|
||||
<license>TODO: License declaration</license>
|
||||
|
||||
<buildtool_depend>ament_cmake</buildtool_depend>
|
||||
|
||||
<depend>rclcpp</depend>
|
||||
<depend>rm_ros_interfaces</depend>
|
||||
|
||||
<test_depend>ament_lint_auto</test_depend>
|
||||
<test_depend>ament_lint_common</test_depend>
|
||||
|
||||
<export>
|
||||
<build_type>ament_cmake</build_type>
|
||||
</export>
|
||||
</package>
|
||||
@@ -0,0 +1,222 @@
|
||||
//
|
||||
// Created by ubuntu on 24-7-11.
|
||||
//
|
||||
#include <iostream>
|
||||
#include <chrono>
|
||||
#include <functional>
|
||||
#include <memory>
|
||||
#include <unistd.h>
|
||||
#include <thread>
|
||||
#include "rclcpp/rclcpp.hpp"
|
||||
#include "rm_ros_interfaces/msg/movejp.hpp"
|
||||
#include "rm_ros_interfaces/msg/movel.hpp"
|
||||
#include "rm_ros_interfaces/msg/setforceposition.hpp"
|
||||
#include "rm_ros_interfaces/msg/movec.hpp"
|
||||
#include "std_msgs/msg/bool.hpp"
|
||||
|
||||
using namespace std::chrono_literals;
|
||||
using std::placeholders::_1;
|
||||
bool set_force_postion_state = false;
|
||||
bool movej_p_state = false;
|
||||
bool movel_state = false;
|
||||
bool stop_force_postion_state = false;
|
||||
bool first_run = true;
|
||||
/****************************************创建类************************************/
|
||||
class ForcePositionControlDemoSub: public rclcpp::Node
|
||||
{
|
||||
public:
|
||||
ForcePositionControlDemoSub(); //构造函数
|
||||
void ForcePositionControl_demo(); //力位混合运动规划函数
|
||||
void MoveJPDemo_Callback(const std_msgs::msg::Bool::SharedPtr msg); //结果回调函数
|
||||
void SetForcePostionDemo_Callback(const std_msgs::msg::Bool::SharedPtr msg); //结果回调函数
|
||||
void MoveLDemo_Callback(const std_msgs::msg::Bool::SharedPtr msg); //结果回调函数
|
||||
void StopForcePostionDemo_Callback(const std_msgs::msg::Bool::SharedPtr msg); //结果回调函数
|
||||
|
||||
private:
|
||||
rclcpp::Subscription<std_msgs::msg::Bool>::SharedPtr movej_p_subscription_; //声明订阅器
|
||||
rclcpp::Subscription<std_msgs::msg::Bool>::SharedPtr movel_subscription_; //声明订阅器
|
||||
|
||||
rclcpp::Subscription<std_msgs::msg::Bool>::SharedPtr set_force_postion_subscription_; //声明订阅器
|
||||
rclcpp::Subscription<std_msgs::msg::Bool>::SharedPtr stop_force_postion_subscription_; //声明订阅器
|
||||
|
||||
};
|
||||
|
||||
class ForcePositionControlDemoPub: public rclcpp::Node
|
||||
{
|
||||
public:
|
||||
ForcePositionControlDemoPub(); //构造函数
|
||||
void ForcePositionControl_demo(); //力位混合运动规划函数
|
||||
void looppub_timer_callback(); //move运动规划函数
|
||||
|
||||
private:
|
||||
rclcpp::Publisher<rm_ros_interfaces::msg::Movejp>::SharedPtr movej_p_publisher_; //声明发布器
|
||||
rclcpp::Publisher<rm_ros_interfaces::msg::Movel>::SharedPtr movel_publisher_; //声明发布器
|
||||
|
||||
rclcpp::Publisher<rm_ros_interfaces::msg::Setforceposition>::SharedPtr set_force_postion_publisher_;//声明发布器
|
||||
rclcpp::Publisher<std_msgs::msg::Bool>::SharedPtr stop_force_postion_publisher_; //声明发布器
|
||||
rclcpp::TimerBase::SharedPtr loop_pub_Timer; //定时发布器
|
||||
|
||||
};
|
||||
|
||||
/******************************接收到订阅的机械臂执行状态消息后,会进入消息回调函数**************************/
|
||||
void ForcePositionControlDemoSub::MoveJPDemo_Callback(const std_msgs::msg::Bool::SharedPtr msg)
|
||||
{
|
||||
// 将接收到的消息打印出来,显示是否执行成功
|
||||
movej_p_state = true;
|
||||
if(msg->data)
|
||||
{
|
||||
RCLCPP_INFO (this->get_logger(),"*******Movej_p succeeded\n");
|
||||
} else {
|
||||
RCLCPP_ERROR (this->get_logger(),"*******Movej_p Failed\n");
|
||||
}
|
||||
}
|
||||
/***********************************************end**************************************************/
|
||||
|
||||
/******************************接收到订阅的机械臂执行状态消息后,会进入消息回调函数**************************/
|
||||
void ForcePositionControlDemoSub::MoveLDemo_Callback(const std_msgs::msg::Bool::SharedPtr msg)
|
||||
{
|
||||
// 将接收到的消息打印出来,显示是否执行成功
|
||||
movel_state = msg->data;
|
||||
if(msg->data)
|
||||
{
|
||||
RCLCPP_INFO (this->get_logger(),"*******MoveL succeeded\n");
|
||||
} else {
|
||||
RCLCPP_ERROR (this->get_logger(),"*******MoveL Failed\n");
|
||||
}
|
||||
}
|
||||
/***********************************************end**************************************************/
|
||||
|
||||
/******************************接收到订阅的机械臂执行状态消息后,会进入消息回调函数**************************/
|
||||
void ForcePositionControlDemoSub::SetForcePostionDemo_Callback(const std_msgs::msg::Bool::SharedPtr msg)
|
||||
{
|
||||
// 将接收到的消息打印出来,显示是否执行成功
|
||||
set_force_postion_state = msg->data;
|
||||
if(msg->data)
|
||||
{
|
||||
RCLCPP_INFO (this->get_logger(),"*******Set Force Postion succeeded\n");
|
||||
} else {
|
||||
RCLCPP_ERROR (this->get_logger(),"*******Set Force Postion Failed\n");
|
||||
}
|
||||
}
|
||||
/***********************************************end**************************************************/
|
||||
|
||||
/******************************接收到订阅的机械臂执行状态消息后,会进入消息回调函数**************************/
|
||||
void ForcePositionControlDemoSub::StopForcePostionDemo_Callback(const std_msgs::msg::Bool::SharedPtr msg)
|
||||
{
|
||||
// 将接收到的消息打印出来,显示是否执行成功
|
||||
stop_force_postion_state = true;
|
||||
if(msg->data)
|
||||
{
|
||||
RCLCPP_INFO (this->get_logger(),"*******Stop Force Postion succeeded\n");
|
||||
} else {
|
||||
RCLCPP_ERROR (this->get_logger(),"*******Stop Force Postion Failed\n");
|
||||
}
|
||||
}
|
||||
/***********************************************end**************************************************/
|
||||
|
||||
/*******************************************力位混合运动函数****************************************/
|
||||
void ForcePositionControlDemoPub::looppub_timer_callback()
|
||||
{
|
||||
//moveJP到达指定位置
|
||||
if(first_run ==true)
|
||||
{
|
||||
rm_ros_interfaces::msg::Movejp moveJ_P_TargetPose;
|
||||
std::this_thread::sleep_for(std::chrono::milliseconds(1000));
|
||||
moveJ_P_TargetPose.pose.position.x = -0.355816;
|
||||
moveJ_P_TargetPose.pose.position.y = -0.000013;
|
||||
moveJ_P_TargetPose.pose.position.z = 0.222814;
|
||||
moveJ_P_TargetPose.pose.orientation.x = 0.995179;
|
||||
moveJ_P_TargetPose.pose.orientation.y = -0.094604;
|
||||
moveJ_P_TargetPose.pose.orientation.z = -0.025721;
|
||||
moveJ_P_TargetPose.pose.orientation.w = 0.002349;
|
||||
moveJ_P_TargetPose.speed = 20;
|
||||
moveJ_P_TargetPose.block = true;
|
||||
this->movej_p_publisher_->publish(moveJ_P_TargetPose);
|
||||
first_run = false;
|
||||
std::this_thread::sleep_for(std::chrono::milliseconds(1000));
|
||||
}
|
||||
//开启力位混合
|
||||
if(movej_p_state==true) //等待moveJ_P到达
|
||||
{
|
||||
rm_ros_interfaces::msg::Setforceposition forceposition_data;
|
||||
forceposition_data.sensor = 1;
|
||||
forceposition_data.mode = 0;
|
||||
forceposition_data.direction = 2;
|
||||
forceposition_data.n = 5;
|
||||
// forceposition_data.block = true;
|
||||
this->set_force_postion_publisher_->publish(forceposition_data);
|
||||
movej_p_state = false;
|
||||
std::this_thread::sleep_for(std::chrono::milliseconds(100));
|
||||
}
|
||||
//moveL运动
|
||||
if(set_force_postion_state==true)
|
||||
{
|
||||
rm_ros_interfaces::msg::Movel moveL_TargetPose;
|
||||
moveL_TargetPose.pose.position.x = -0.255816;
|
||||
moveL_TargetPose.pose.position.y = -0.000013;
|
||||
moveL_TargetPose.pose.position.z = 0.222814;
|
||||
moveL_TargetPose.pose.orientation.x = 0.995179;
|
||||
moveL_TargetPose.pose.orientation.y = -0.094604;
|
||||
moveL_TargetPose.pose.orientation.z = -0.025721;
|
||||
moveL_TargetPose.pose.orientation.w = 0.002349;
|
||||
moveL_TargetPose.speed = 20;
|
||||
moveL_TargetPose.block = true;
|
||||
this->movel_publisher_->publish(moveL_TargetPose);
|
||||
set_force_postion_state = false;
|
||||
std::this_thread::sleep_for(std::chrono::milliseconds(1000));
|
||||
}
|
||||
//停止力位混合
|
||||
if(movel_state==true) //等待movel到达
|
||||
{
|
||||
std_msgs::msg::Bool stop_force_postion_data;
|
||||
stop_force_postion_data.data = true;
|
||||
this->stop_force_postion_publisher_->publish(stop_force_postion_data);
|
||||
movel_state = false;
|
||||
std::this_thread::sleep_for(std::chrono::milliseconds(100));
|
||||
}
|
||||
if(stop_force_postion_state==true)
|
||||
{
|
||||
RCLCPP_INFO (this->get_logger(),"*******All step run over\n");
|
||||
stop_force_postion_state = false;
|
||||
}
|
||||
}
|
||||
/***********************************************end**************************************************/
|
||||
|
||||
/***********************************构造函数,初始化发布器订阅器****************************************/
|
||||
ForcePositionControlDemoPub::ForcePositionControlDemoPub():rclcpp::Node("Force_Position_Control_pub_node")
|
||||
{
|
||||
movej_p_publisher_ = this->create_publisher<rm_ros_interfaces::msg::Movejp>("/rm_driver/movej_p_cmd", rclcpp::ParametersQoS());
|
||||
movel_publisher_ = this->create_publisher<rm_ros_interfaces::msg::Movel>("/rm_driver/movel_cmd", rclcpp::ParametersQoS());
|
||||
set_force_postion_publisher_ = this->create_publisher<rm_ros_interfaces::msg::Setforceposition>("/rm_driver/set_force_postion_cmd", rclcpp::ParametersQoS());
|
||||
stop_force_postion_publisher_ = this->create_publisher<std_msgs::msg::Bool>("/rm_driver/stop_force_postion_cmd", rclcpp::ParametersQoS());
|
||||
loop_pub_Timer = this->create_wall_timer(std::chrono::milliseconds(100),
|
||||
std::bind(&ForcePositionControlDemoPub::looppub_timer_callback,this));
|
||||
std::this_thread::sleep_for(std::chrono::milliseconds(2000));
|
||||
}
|
||||
/***********************************************end**************************************************/
|
||||
|
||||
/***********************************构造函数,初始化发布器订阅器****************************************/
|
||||
ForcePositionControlDemoSub::ForcePositionControlDemoSub():rclcpp::Node("Force_Position_Control_sub_node")
|
||||
{
|
||||
movej_p_subscription_ = this->create_subscription<std_msgs::msg::Bool>("/rm_driver/movej_p_result", rclcpp::ParametersQoS(), std::bind(&ForcePositionControlDemoSub::MoveJPDemo_Callback, this,_1));
|
||||
movel_subscription_ = this->create_subscription<std_msgs::msg::Bool>("/rm_driver/movel_result", rclcpp::ParametersQoS(), std::bind(&ForcePositionControlDemoSub::MoveLDemo_Callback, this,_1));
|
||||
set_force_postion_subscription_ = this->create_subscription<std_msgs::msg::Bool>("/rm_driver/set_force_postion_result", rclcpp::ParametersQoS(), std::bind(&ForcePositionControlDemoSub::SetForcePostionDemo_Callback, this,_1));
|
||||
stop_force_postion_subscription_ = this->create_subscription<std_msgs::msg::Bool>("/rm_driver/stop_force_postion_result", rclcpp::ParametersQoS(), std::bind(&ForcePositionControlDemoSub::StopForcePostionDemo_Callback, this,_1));
|
||||
std::this_thread::sleep_for(std::chrono::milliseconds(3000));
|
||||
}
|
||||
/***********************************************end**************************************************/
|
||||
|
||||
/******************************************************主函数*********************************************/
|
||||
int main(int argc, char** argv)
|
||||
{
|
||||
rclcpp::init(argc, argv);
|
||||
rclcpp::executors::SingleThreadedExecutor executor;
|
||||
auto node_sub = std::make_shared<ForcePositionControlDemoSub>();
|
||||
auto node_pub = std::make_shared<ForcePositionControlDemoPub>();
|
||||
executor.add_node(node_pub);
|
||||
executor.add_node(node_sub);
|
||||
|
||||
executor.spin();
|
||||
rclcpp::shutdown();
|
||||
return 0;
|
||||
}
|
||||
@@ -0,0 +1,44 @@
|
||||
cmake_minimum_required(VERSION 3.8)
|
||||
project(get_arm_state)
|
||||
|
||||
# Default to C99
|
||||
if(NOT CMAKE_C_STANDARD)
|
||||
set(CMAKE_C_STANDARD 99)
|
||||
endif()
|
||||
|
||||
# Default to C++14
|
||||
if(NOT CMAKE_CXX_STANDARD)
|
||||
set(CMAKE_CXX_STANDARD 14)
|
||||
endif()
|
||||
|
||||
|
||||
if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang")
|
||||
add_compile_options(-Wall -Wextra -Wpedantic)
|
||||
endif()
|
||||
|
||||
# find dependencies
|
||||
find_package(ament_cmake REQUIRED)
|
||||
find_package(rclcpp REQUIRED)
|
||||
find_package(std_msgs REQUIRED)
|
||||
find_package(sensor_msgs REQUIRED)
|
||||
find_package(geometry_msgs REQUIRED)
|
||||
find_package(rm_ros_interfaces REQUIRED)
|
||||
|
||||
if(BUILD_TESTING)
|
||||
find_package(ament_lint_auto REQUIRED)
|
||||
set(ament_cmake_copyright_FOUND TRUE)
|
||||
set(ament_cmake_cpplint_FOUND TRUE)
|
||||
ament_lint_auto_find_test_dependencies()
|
||||
endif()
|
||||
|
||||
add_executable(rm_get_arm_state_demo src/api_Get_Arm_State_demo.cpp)
|
||||
|
||||
ament_target_dependencies(rm_get_arm_state_demo rclcpp std_msgs rm_ros_interfaces)
|
||||
|
||||
install(DIRECTORY launch
|
||||
DESTINATION share/${PROJECT_NAME})
|
||||
|
||||
install(TARGETS
|
||||
rm_get_arm_state_demo
|
||||
DESTINATION lib/${PROJECT_NAME})
|
||||
ament_package()
|
||||
@@ -0,0 +1,13 @@
|
||||
Copyright 2024 realman-robotics
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
@@ -0,0 +1,244 @@
|
||||
# 获取机械臂状态`GET_ARM_STATE_DEMO`
|
||||
|
||||
---
|
||||
|
||||
## 1.项目介绍
|
||||
|
||||
本项目是一个基于机械臂机械臂本体和ROS功能包实现获取机械臂当前控制器版本、关节状态、位姿状态、六维力信息功能,程序将依次执行获取控制器版本信息,获取机械臂状态,获取六维力数据信息的指令,程序执行时,对应的数据信息会打印在终端中,该示例目的是使ROS开发者迅速掌握并灵活运用机械臂。
|
||||
|
||||
## 2. 代码结构
|
||||
|
||||
```
|
||||
├── CMakeLists.txt <-CMake编译文件
|
||||
├── launch <-启动文件夹
|
||||
│ └── get_arm_state_demo.launch.py <-启动文件
|
||||
├── LICENSE <-版本说明
|
||||
├── package.xml <-依赖描述文件夹
|
||||
├── README.md <-说明文档
|
||||
└── src <-C++源码文件夹
|
||||
└── api_Get_Arm_State_demo.cpp <-源码文件
|
||||
```
|
||||
|
||||
## 3.项目下载
|
||||
|
||||
通过项目链接下载本项目工程文件到本地:[ros2_rm_robot](https://github.com/RealManRobot/ros2_rm_robot/tree/humble)
|
||||
|
||||
## 4.环境配置
|
||||
|
||||
| 项目 | 内容 |
|
||||
| :-- | :-- |
|
||||
| 系统 | Ubuntu22.04 |
|
||||
| ROS版本 | humble |
|
||||
| 依赖 | 机械臂的ROS2-humble功能包 |
|
||||
|
||||
1. 首先需要准备好Ubuntu22.04操作系统的虚拟机或其他设备。
|
||||
2. 安装ROS2环境[humble](https://docs.ros.org/en/humble/Installation/Ubuntu-Install-Debians.html),也可参考ROS2-humble功能包中的安装说明进行安装。
|
||||
3. ROS2-Humble功能包安装
|
||||
|
||||
新建工作空间和src文件夹
|
||||
```
|
||||
mkdir -p ~/ros2_ws/src
|
||||
```
|
||||
|
||||
将ROS2文件复制到src文件夹中
|
||||
```
|
||||
cp -r ros2_rm_robot ~/ros2_ws/src
|
||||
```
|
||||
|
||||
进入工作空间
|
||||
```
|
||||
cd ~/ros2_ws
|
||||
```
|
||||
|
||||
编译rm_ros_interfaces功能包
|
||||
```
|
||||
colcon build --packages-select rm_ros_interfaces
|
||||
```
|
||||
|
||||
声明环境变量
|
||||
```
|
||||
source ./install/setup.bash
|
||||
```
|
||||
|
||||
编译所有功能包
|
||||
```
|
||||
colcon build
|
||||
```
|
||||
|
||||
再次声明环境变量
|
||||
```
|
||||
source ./install/setup.bash
|
||||
```
|
||||
|
||||
## 5. 使用指南
|
||||
|
||||
* **命令行使用**:
|
||||
|
||||
我们需要在一个终端中启动机械臂的rm_driver功能包。
|
||||
```
|
||||
ros2 launch rm_driver rm_<arm_type>_driver.launch.py
|
||||
```
|
||||
<arm_type>可以为65、63、eco65、75、gen72,可对照自己使用的设备进行实际选择
|
||||
我们需要在另一个终端中启动机械臂的get_arm_state功能包。
|
||||
```
|
||||
ros2 launch get_arm_state get_arm_state_demo.launch.py
|
||||
```
|
||||
* **返回信息**:
|
||||
|
||||
在程序成功运行时将会出现以下提示信息。
|
||||
```
|
||||
[rm_get_arm_state_demo-1] [INFO] [1722912567.024745517] [get_state]: joint state is: [0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000] //机械臂角度信息
|
||||
[rm_get_arm_state_demo-1]
|
||||
[rm_get_arm_state_demo-1] [INFO] [1722912567.024994866] [get_state]: pose state is: [0.000000, 0.000000, 0.534000, 3.141000, 0.000000, 0.000000] //机械臂位姿信息(欧拉角)
|
||||
[rm_get_arm_state_demo-1]
|
||||
[rm_get_arm_state_demo-1] [INFO] [1722912567.025200125] [get_state]: joint state is: [0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000] //机械臂弧度信息
|
||||
[rm_get_arm_state_demo-1]
|
||||
[rm_get_arm_state_demo-1] [INFO] [1722912567.025321800] [get_state]: pose state is: //机械臂位姿信息(四元数)
|
||||
[rm_get_arm_state_demo-1] [position.x = 0.000000,
|
||||
[rm_get_arm_state_demo-1] position.y = 0.000000,
|
||||
[rm_get_arm_state_demo-1] position.z = 0.534000,
|
||||
[rm_get_arm_state_demo-1] orientation.x = 1.000000,
|
||||
[rm_get_arm_state_demo-1] orientation.y = 0.000000,
|
||||
[rm_get_arm_state_demo-1] orientation.z = 0.000000,
|
||||
[rm_get_arm_state_demo-1] orientation.w = 0.000296]
|
||||
[rm_get_arm_state_demo-1]
|
||||
[rm_get_arm_state_demo-1] [INFO] [1722912567.025408782] [get_state]: Planversion is 7B0156 //机械臂控制器版本信息(7代表自由度,b代表没有六维力,156为控制器程序版本为1.5.6)
|
||||
[rm_get_arm_state_demo-1]
|
||||
[rm_get_arm_state_demo-1] [INFO] [1722912567.025463071] [get_state]: Productversion is GEN72-BI //机械臂设备型号息信息
|
||||
[rm_get_arm_state_demo-1] [INFO] [1723550015.625603508] [get_state]:
|
||||
[rm_get_arm_state_demo-1] [INFO] [1723550325.782782033] [get_state]: // 六维力传感器原始数据
|
||||
[rm_get_arm_state_demo-1] force-force_fx is 0.000000
|
||||
[rm_get_arm_state_demo-1] force-force_fy is 0.000000
|
||||
[rm_get_arm_state_demo-1] force-force_fz is 0.000000
|
||||
[rm_get_arm_state_demo-1] force-force_mx is 0.000000
|
||||
[rm_get_arm_state_demo-1] force-force_my is 0.000000
|
||||
[rm_get_arm_state_demo-1] force-force_mz is 0.000000
|
||||
[rm_get_arm_state_demo-1]
|
||||
[rm_get_arm_state_demo-1] [INFO] [1723550325.782929425] [get_state]: // 六维力传感器系统受力数据
|
||||
[rm_get_arm_state_demo-1] zero-force_fx is 0.000000
|
||||
[rm_get_arm_state_demo-1] zero-force_fy is 0.000000
|
||||
[rm_get_arm_state_demo-1] zero-force_fz is 0.000000
|
||||
[rm_get_arm_state_demo-1] zero-force_mx is 0.000000
|
||||
[rm_get_arm_state_demo-1] zero-force_my is 0.000000
|
||||
[rm_get_arm_state_demo-1] zero-force_mz is 0.000000
|
||||
[rm_get_arm_state_demo-1]
|
||||
[rm_get_arm_state_demo-1] [INFO] [1723550325.782964040] [get_state]: // 六维力传感器工作坐标系受力数据
|
||||
[rm_get_arm_state_demo-1] work-zero_fx is 0.000000
|
||||
[rm_get_arm_state_demo-1] work-zero_fy is 0.000000
|
||||
[rm_get_arm_state_demo-1] work-zero_fz is 0.000000
|
||||
[rm_get_arm_state_demo-1] work-zero_mx is 0.000000
|
||||
[rm_get_arm_state_demo-1] work-zero_my is 0.000000
|
||||
[rm_get_arm_state_demo-1] work-zero_mz is 0.000000
|
||||
[rm_get_arm_state_demo-1]
|
||||
[rm_get_arm_state_demo-1] [INFO] [1723550325.782985859] [get_state]: // 六维力传感器工具坐标系受力数据
|
||||
[rm_get_arm_state_demo-1] tool-zero_fx is 0.000000
|
||||
[rm_get_arm_state_demo-1] tool-zero_fy is 0.000000
|
||||
[rm_get_arm_state_demo-1] tool-zero_fz is 0.000000
|
||||
[rm_get_arm_state_demo-1] tool-zero_mx is 0.000000
|
||||
[rm_get_arm_state_demo-1] tool-zero_my is 0.000000
|
||||
[rm_get_arm_state_demo-1] tool-zero_mz is 0.000000
|
||||
```
|
||||
|
||||
## 6.关键代码说明
|
||||
|
||||
下面是 `api_Get_Arm_State_demo.cpp` 文件的主要功能:
|
||||
|
||||
- **初始化**
|
||||
相关发布订阅信息初始化
|
||||
|
||||
机械臂关节状态发布器
|
||||
```
|
||||
rclcpp::Publisher<std_msgs::msg::Empty>::SharedPtr arm_state_publisher_;
|
||||
```
|
||||
|
||||
机械臂软件版本发布器
|
||||
```
|
||||
rclcpp::Publisher<std_msgs::msg::Empty>::SharedPtr arm_software_version_publisher_;
|
||||
```
|
||||
|
||||
机械臂六维力状态发布器
|
||||
```
|
||||
rclcpp::Publisher<std_msgs::msg::Empty>::SharedPtr get_force_data_publisher_;
|
||||
```
|
||||
|
||||
关节原始状态订阅器
|
||||
```
|
||||
rclcpp::Subscription<rm_ros_interfaces::msg::Armoriginalstate>::SharedPtr subscription_original_state;
|
||||
```
|
||||
|
||||
关节状态订阅器
|
||||
```
|
||||
rclcpp::Subscription<rm_ros_interfaces::msg::Armstate>::SharedPtr subscription_arm_state;
|
||||
```
|
||||
|
||||
控制器版本订阅器
|
||||
```
|
||||
rclcpp::Subscription<rm_ros_interfaces::msg::Armsoftversion>::SharedPtr subscription_software_version;
|
||||
```
|
||||
|
||||
六维力传感器状态订阅器
|
||||
```
|
||||
rclcpp::Subscription<rm_ros_interfaces::msg::Sixforce>::SharedPtr subscription_force_data;
|
||||
```
|
||||
|
||||
六维力系统受力状态订阅器
|
||||
```
|
||||
rclcpp::Subscription<rm_ros_interfaces::msg::Sixforce>::SharedPtr subscription_zero_force_data;
|
||||
```
|
||||
|
||||
六维力工作坐标系受力状态订阅器
|
||||
```
|
||||
rclcpp::Subscription<rm_ros_interfaces::msg::Sixforce>::SharedPtr subscription_work_force_data;
|
||||
```
|
||||
|
||||
六维力工具坐标系受力状态订阅器
|
||||
```
|
||||
rclcpp::Subscription<rm_ros_interfaces::msg::Sixforce>::SharedPtr subscription_tool_force_data;
|
||||
```
|
||||
|
||||
- **回调函数**
|
||||
接收机械臂版本信息,进入消息回调函数
|
||||
|
||||
改变工作坐标系函数
|
||||
```
|
||||
void get_arm_state();
|
||||
```
|
||||
|
||||
机械臂状态原始结果回调函数
|
||||
```
|
||||
void GetArmOriginalState_Callback(const rm_ros_interfaces::msg::Armoriginalstate::SharedPtr msg);
|
||||
```
|
||||
|
||||
机械臂状态结果回调函数
|
||||
```
|
||||
void GetArmState_Callback(const rm_ros_interfaces::msg::Armstate::SharedPtr msg);
|
||||
```
|
||||
|
||||
控制器版本结果回调函数
|
||||
```
|
||||
void GetArmSoftwareVersion_Callback(const rm_ros_interfaces::msg::Armsoftversion::SharedPtr msg);
|
||||
```
|
||||
|
||||
六维力传感器结果回调函数
|
||||
```
|
||||
void ForceData_Callback(const rm_ros_interfaces::msg::Sixforce::SharedPtr msg);
|
||||
```
|
||||
|
||||
六维力结果回调函数
|
||||
```
|
||||
void ZeroForceData_Callback(const rm_ros_interfaces::msg::Sixforce::SharedPtr msg);
|
||||
```
|
||||
|
||||
六维力工作坐标结果回调函数
|
||||
```
|
||||
void WorkForceData_Callback(const rm_ros_interfaces::msg::Sixforce::SharedPtr msg);
|
||||
```
|
||||
|
||||
六维力工具坐标结果回调函数
|
||||
```
|
||||
void ToolForceData_Callback(const rm_ros_interfaces::msg::Sixforce::SharedPtr msg);
|
||||
```
|
||||
|
||||
## 7.许可证信息
|
||||
|
||||
* 具体许可证内容请参见`LICENSE`文件。
|
||||
@@ -0,0 +1,14 @@
|
||||
from launch import LaunchDescription
|
||||
from launch_ros.actions import Node
|
||||
def generate_launch_description():
|
||||
ld = LaunchDescription()
|
||||
get_arm_state_node = Node(
|
||||
package='get_arm_state', #节点所在的功能包
|
||||
executable='rm_get_arm_state_demo', #表示要运行的可执行文件名或脚本名字.py
|
||||
output='screen', #用于将话题信息打印到屏幕
|
||||
)
|
||||
|
||||
ld.add_action(get_arm_state_node)
|
||||
return ld
|
||||
|
||||
|
||||
@@ -0,0 +1,21 @@
|
||||
<?xml version="1.0"?>
|
||||
<?xml-model href="http://download.ros.org/schema/package_format3.xsd" schematypens="http://www.w3.org/2001/XMLSchema"?>
|
||||
<package format="3">
|
||||
<name>get_arm_state</name>
|
||||
<version>0.0.0</version>
|
||||
<description>TODO: Package description</description>
|
||||
<maintainer email="2209099554@qq.com">rm</maintainer>
|
||||
<license>TODO: License declaration</license>
|
||||
|
||||
<buildtool_depend>ament_cmake</buildtool_depend>
|
||||
|
||||
<depend>rclcpp</depend>
|
||||
<depend>rm_ros_interfaces</depend>
|
||||
|
||||
<test_depend>ament_lint_auto</test_depend>
|
||||
<test_depend>ament_lint_common</test_depend>
|
||||
|
||||
<export>
|
||||
<build_type>ament_cmake</build_type>
|
||||
</export>
|
||||
</package>
|
||||
@@ -0,0 +1,172 @@
|
||||
//
|
||||
// Created by ubuntu on 24-7-10.
|
||||
//
|
||||
#include <chrono>
|
||||
#include <functional>
|
||||
#include <memory>
|
||||
#include <unistd.h>
|
||||
#include <thread>
|
||||
#include "rclcpp/rclcpp.hpp"
|
||||
#include "rm_ros_interfaces/msg/armoriginalstate.hpp"
|
||||
#include "rm_ros_interfaces/msg/armstate.hpp"
|
||||
#include "rm_ros_interfaces/msg/armsoftversion.hpp"
|
||||
#include "rm_ros_interfaces/msg/sixforce.hpp"
|
||||
#include "std_msgs/msg/empty.hpp"
|
||||
|
||||
using namespace std::chrono_literals;
|
||||
using std::placeholders::_1;
|
||||
|
||||
/****************************************创建类************************************/
|
||||
class GetArmState: public rclcpp::Node
|
||||
{
|
||||
public:
|
||||
GetArmState(); //构造函数
|
||||
void get_arm_state(); //改变工作坐标系函数
|
||||
void GetArmOriginalState_Callback(const rm_ros_interfaces::msg::Armoriginalstate::SharedPtr msg); //机械臂状态原始结果回调函数
|
||||
void GetArmState_Callback(const rm_ros_interfaces::msg::Armstate::SharedPtr msg); //机械臂状态结果回调函数
|
||||
void GetArmSoftwareVersion_Callback(const rm_ros_interfaces::msg::Armsoftversion::SharedPtr msg); //控制器版本结果回调函数
|
||||
void ForceData_Callback(const rm_ros_interfaces::msg::Sixforce::SharedPtr msg); //六维力传感器结果回调函数
|
||||
void ZeroForceData_Callback(const rm_ros_interfaces::msg::Sixforce::SharedPtr msg); //六维力结果回调函数
|
||||
void WorkForceData_Callback(const rm_ros_interfaces::msg::Sixforce::SharedPtr msg); //六维力工作坐标结果回调函数
|
||||
void ToolForceData_Callback(const rm_ros_interfaces::msg::Sixforce::SharedPtr msg); //六维力工具坐标结果回调函数
|
||||
|
||||
|
||||
private:
|
||||
rclcpp::Publisher<std_msgs::msg::Empty>::SharedPtr arm_state_publisher_; //机械臂关节状态发布器
|
||||
rclcpp::Publisher<std_msgs::msg::Empty>::SharedPtr arm_software_version_publisher_; //机械臂软件版本发布器
|
||||
rclcpp::Publisher<std_msgs::msg::Empty>::SharedPtr get_force_data_publisher_; //机械臂六维力状态发布器
|
||||
rclcpp::Subscription<rm_ros_interfaces::msg::Armoriginalstate>::SharedPtr subscription_original_state; //关节原始状态订阅器
|
||||
rclcpp::Subscription<rm_ros_interfaces::msg::Armstate>::SharedPtr subscription_arm_state; //关节状态订阅器
|
||||
rclcpp::Subscription<rm_ros_interfaces::msg::Armsoftversion>::SharedPtr subscription_software_version; //控制器版本订阅器
|
||||
rclcpp::Subscription<rm_ros_interfaces::msg::Sixforce>::SharedPtr subscription_force_data; //六维力传感器状态订阅器
|
||||
rclcpp::Subscription<rm_ros_interfaces::msg::Sixforce>::SharedPtr subscription_zero_force_data; //六维力系统受力状态订阅器
|
||||
rclcpp::Subscription<rm_ros_interfaces::msg::Sixforce>::SharedPtr subscription_work_force_data; //六维力工作坐标系受力状态订阅器
|
||||
rclcpp::Subscription<rm_ros_interfaces::msg::Sixforce>::SharedPtr subscription_tool_force_data; //六维力工具坐标系受力状态订阅器
|
||||
};
|
||||
|
||||
|
||||
/************************************************机械臂状态原始结果回调********************************************/
|
||||
void GetArmState::GetArmOriginalState_Callback(const rm_ros_interfaces::msg::Armoriginalstate::SharedPtr msg)
|
||||
{
|
||||
// 将接收到的消息打印出来,显示是否执行成功
|
||||
if(msg->dof == 7)
|
||||
{
|
||||
RCLCPP_INFO (this->get_logger(),"joint state is: [%lf, %lf, %lf, %lf, %lf, %lf, %lf]\n", msg->joint[0],msg->joint[1],msg->joint[2],msg->joint[3],msg->joint[4],msg->joint[5],msg->joint[6]);
|
||||
}
|
||||
else
|
||||
{
|
||||
RCLCPP_INFO (this->get_logger(),"joint state is: [%lf, %lf, %lf, %lf, %lf, %lf]\n", msg->joint[0],msg->joint[1],msg->joint[2],msg->joint[3],msg->joint[4],msg->joint[5]);
|
||||
}
|
||||
RCLCPP_INFO (this->get_logger(),"pose state is: [%lf, %lf, %lf, %lf, %lf, %lf]\n", msg->pose[0],msg->pose[1],msg->pose[2],msg->pose[3],msg->pose[4],msg->pose[5]);
|
||||
}
|
||||
/*******************************************************end**********************************************************/
|
||||
|
||||
/******************************************************机械臂状态结果回调***********************************************/
|
||||
void GetArmState::GetArmState_Callback(const rm_ros_interfaces::msg::Armstate::SharedPtr msg)
|
||||
{
|
||||
// 将接收到的消息打印出来,显示是否执行成功
|
||||
if(msg->dof == 7)
|
||||
{
|
||||
RCLCPP_INFO (this->get_logger(),"joint state is: [%lf, %lf, %lf, %lf, %lf, %lf, %lf]\n", msg->joint[0],msg->joint[1],msg->joint[2],msg->joint[3],msg->joint[4],msg->joint[5],msg->joint[6]);
|
||||
}
|
||||
else
|
||||
{
|
||||
RCLCPP_INFO (this->get_logger(),"joint state is: [%lf, %lf, %lf, %lf, %lf, %lf]\n", msg->joint[0],msg->joint[1],msg->joint[2],msg->joint[3],msg->joint[4],msg->joint[5]);
|
||||
}
|
||||
RCLCPP_INFO (this->get_logger(),"pose state is: \n[position.x = %lf,\n position.y = %lf,\n position.z = %lf,\n orientation.x = %lf,\n orientation.y = %lf,\n orientation.z = %lf,\n orientation.w = %lf]\n", msg->pose.position.x,msg->pose.position.y,msg->pose.position.z,msg->pose.orientation.x,msg->pose.orientation.y,msg->pose.orientation.z,msg->pose.orientation.w);
|
||||
}
|
||||
/*******************************************************end**********************************************************/
|
||||
/************************************************机械臂传感器版本结果回调函数********************************************/
|
||||
void GetArmState::GetArmSoftwareVersion_Callback(const rm_ros_interfaces::msg::Armsoftversion::SharedPtr msg)
|
||||
{
|
||||
RCLCPP_INFO(this->get_logger(),"Planversion is %s\n ", msg->planversion.c_str());
|
||||
RCLCPP_INFO(this->get_logger(),"Productversion is %s\n ", msg->productversion.c_str());
|
||||
}
|
||||
/*******************************************************end**********************************************************/
|
||||
/************************************************机械臂传感器六维力结果回调函数********************************************/
|
||||
void GetArmState::ForceData_Callback(const rm_ros_interfaces::msg::Sixforce::SharedPtr msg)
|
||||
{
|
||||
RCLCPP_INFO(this->get_logger(),"\nforce-force_fx is %f\nforce-force_fy is %f\nforce-force_fz is %f\nforce-force_mx is %f\nforce-force_my is %f\nforce-force_mz is %f\n "
|
||||
, msg->force_fx
|
||||
, msg->force_fy
|
||||
, msg->force_fz
|
||||
, msg->force_mx
|
||||
, msg->force_my
|
||||
, msg->force_mz);
|
||||
}
|
||||
/*******************************************************end**********************************************************/
|
||||
/***********************************************机械臂六维力系统受力结果回调函数******************************************/
|
||||
void GetArmState::ZeroForceData_Callback(const rm_ros_interfaces::msg::Sixforce::SharedPtr msg)
|
||||
{
|
||||
RCLCPP_INFO(this->get_logger(),"\nzero-force_fx is %f\nzero-force_fy is %f\nzero-force_fz is %f\nzero-force_mx is %f\nzero-force_my is %f\nzero-force_mz is %f\n"
|
||||
, msg->force_fx
|
||||
, msg->force_fy
|
||||
, msg->force_fz
|
||||
, msg->force_mx
|
||||
, msg->force_my
|
||||
, msg->force_mz);
|
||||
}
|
||||
/*******************************************************end**********************************************************/
|
||||
/***********************************************机械臂六维力系统受力结果回调函数******************************************/
|
||||
void GetArmState::WorkForceData_Callback(const rm_ros_interfaces::msg::Sixforce::SharedPtr msg)
|
||||
{
|
||||
RCLCPP_INFO(this->get_logger(),"\nwork-zero_fx is %f\nwork-zero_fy is %f\nwork-zero_fz is %f\nwork-zero_mx is %f\nwork-zero_my is %f\nwork-zero_mz is %f\n "
|
||||
, msg->force_fx
|
||||
, msg->force_fy
|
||||
, msg->force_fz
|
||||
, msg->force_mx
|
||||
, msg->force_my
|
||||
, msg->force_mz);
|
||||
}
|
||||
/*******************************************************end**********************************************************/
|
||||
/***********************************************机械臂六维力系统受力结果回调函数******************************************/
|
||||
void GetArmState::ToolForceData_Callback(const rm_ros_interfaces::msg::Sixforce::SharedPtr msg)
|
||||
{
|
||||
RCLCPP_INFO(this->get_logger(),"\ntool-zero_fx is %f\ntool-zero_fy is %f\ntool-zero_fz is %f\ntool-zero_mx is %f\ntool-zero_my is %f\ntool-zero_mz is %f\n"
|
||||
, msg->force_fx
|
||||
, msg->force_fy
|
||||
, msg->force_fz
|
||||
, msg->force_mx
|
||||
, msg->force_my
|
||||
, msg->force_mz);
|
||||
}
|
||||
/*******************************************************end**********************************************************/
|
||||
|
||||
/*******************************************获取位姿函数****************************************/
|
||||
void GetArmState::get_arm_state()
|
||||
{
|
||||
std_msgs::msg::Empty get_state;
|
||||
std::this_thread::sleep_for(std::chrono::milliseconds(3000));
|
||||
this->arm_state_publisher_->publish(get_state);
|
||||
std::this_thread::sleep_for(std::chrono::milliseconds(1000));
|
||||
this->arm_software_version_publisher_->publish(get_state);
|
||||
std::this_thread::sleep_for(std::chrono::milliseconds(1000));
|
||||
this->get_force_data_publisher_->publish(get_state);
|
||||
}
|
||||
/***********************************************end**************************************************/
|
||||
|
||||
/***********************************构造函数,初始化发布器订阅器****************************************/
|
||||
GetArmState::GetArmState():rclcpp::Node("get_state")
|
||||
{
|
||||
subscription_original_state = this->create_subscription<rm_ros_interfaces::msg::Armoriginalstate>("/rm_driver/get_current_arm_original_state_result", rclcpp::ParametersQoS(), std::bind(&GetArmState::GetArmOriginalState_Callback, this,_1));
|
||||
subscription_arm_state = this->create_subscription<rm_ros_interfaces::msg::Armstate>("/rm_driver/get_current_arm_state_result", rclcpp::ParametersQoS(), std::bind(&GetArmState::GetArmState_Callback, this,_1));
|
||||
subscription_software_version = this->create_subscription<rm_ros_interfaces::msg::Armsoftversion>("/rm_driver/get_arm_software_version_result", rclcpp::ParametersQoS(), std::bind(&GetArmState::GetArmSoftwareVersion_Callback, this,_1));
|
||||
subscription_force_data = this->create_subscription<rm_ros_interfaces::msg::Sixforce>("/rm_driver/get_force_data_result", rclcpp::ParametersQoS(), std::bind(&GetArmState::ForceData_Callback, this,_1));
|
||||
subscription_zero_force_data = this->create_subscription<rm_ros_interfaces::msg::Sixforce>("/rm_driver/get_zero_force_data_result", rclcpp::ParametersQoS(), std::bind(&GetArmState::ZeroForceData_Callback, this,_1));
|
||||
subscription_work_force_data = this->create_subscription<rm_ros_interfaces::msg::Sixforce>("/rm_driver/get_work_force_data_result", rclcpp::ParametersQoS(), std::bind(&GetArmState::WorkForceData_Callback, this,_1));
|
||||
subscription_tool_force_data = this->create_subscription<rm_ros_interfaces::msg::Sixforce>("/rm_driver/get_tool_force_data_result", rclcpp::ParametersQoS(), std::bind(&GetArmState::ToolForceData_Callback, this,_1));
|
||||
arm_state_publisher_ = this->create_publisher<std_msgs::msg::Empty>("/rm_driver/get_current_arm_state_cmd", rclcpp::ParametersQoS());
|
||||
arm_software_version_publisher_ = this->create_publisher<std_msgs::msg::Empty>("/rm_driver/get_arm_software_version_cmd", rclcpp::ParametersQoS());
|
||||
get_force_data_publisher_ = this->create_publisher<std_msgs::msg::Empty>("/rm_driver/get_force_data_cmd", rclcpp::ParametersQoS());
|
||||
get_arm_state();
|
||||
}
|
||||
/***********************************************end**************************************************/
|
||||
|
||||
/******************************************************主函数*********************************************/
|
||||
int main(int argc, char** argv)
|
||||
{
|
||||
rclcpp::init(argc, argv);
|
||||
rclcpp::spin(std::make_shared<GetArmState>());
|
||||
rclcpp::shutdown();
|
||||
return 0;
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
cmake_minimum_required(VERSION 3.8)
|
||||
project(rm_bringup)
|
||||
|
||||
if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang")
|
||||
add_compile_options(-Wall -Wextra -Wpedantic)
|
||||
endif()
|
||||
|
||||
# find dependencies
|
||||
find_package(ament_cmake REQUIRED)
|
||||
# uncomment the following section in order to fill in
|
||||
# further dependencies manually.
|
||||
# find_package(<dependency> REQUIRED)
|
||||
|
||||
install(
|
||||
DIRECTORY launch
|
||||
DESTINATION share/${PROJECT_NAME}
|
||||
)
|
||||
|
||||
if(BUILD_TESTING)
|
||||
find_package(ament_lint_auto REQUIRED)
|
||||
# the following line skips the linter which checks for copyrights
|
||||
# comment the line when a copyright and license is added to all source files
|
||||
set(ament_cmake_copyright_FOUND TRUE)
|
||||
# the following line skips cpplint (only works in a git repo)
|
||||
# comment the line when this package is in a git repo and when
|
||||
# a copyright and license is added to all source files
|
||||
set(ament_cmake_cpplint_FOUND TRUE)
|
||||
ament_lint_auto_find_test_dependencies()
|
||||
endif()
|
||||
|
||||
ament_package()
|
||||
136
HiveCoreR0/src/ros2_rm_robot-humble/rm_bringup/README.md
Normal file
@@ -0,0 +1,136 @@
|
||||
<div align="right">
|
||||
|
||||
[简体中文](https://github.com/RealManRobot/ros2_rm_robot/blob/humble/rm_bringup/README_CN.md)|[English](https://github.com/RealManRobot/ros2_rm_robot/blob/humble/rm_bringup/README.md)
|
||||
|
||||
</div>
|
||||
|
||||
<div align="center">
|
||||
|
||||
# RealMan Robot rm_bringup User Manual V1.4
|
||||
|
||||
RealMan Intelligent Technology (Beijing) Co., Ltd.
|
||||
|
||||
Revision History:
|
||||
|
||||
|No. | Date | Comment |
|
||||
| :---: | :----: | :---: |
|
||||
|V1.0 | 2/19/2024 | Draft |
|
||||
|V1.1 | 7/8 /2024 | Amend(Add GEN72 adapter files) |
|
||||
|V1.2 | 9/10 /2024| Amend(Add ECO63 adapter files) |
|
||||
|V1.3 | 25/12/2024| Amend(Add 63, 65, 75, ECO65 six-axis force adapter files and 63, 65, 75, ECO63, ECO65 integrated six-axis force adapter files) |
|
||||
|V1.4 | 25/12/2024| Amend(Add GEN72_II adapter files) |
|
||||
|
||||
</div>
|
||||
|
||||
## Content
|
||||
* 1.[rm_bringup Package Description](#rm_bringup_Package_Description)
|
||||
* 2.[rm_bringup Package Use](#rm_bringup_Package_Use)
|
||||
* 2.1[moveit2 Controlling Real Robotic Arm](#moveit2_Controlling_Real_Robotic_Arm)
|
||||
* 2.2[Gazebo control of robotic arm](#Gazebo_control_of_robotic_arm)
|
||||
* 3.[rm_bringup Package Architecture Description](#rm_bringup_Package_Architecture_Description)
|
||||
* 3.1[Overview of Package Files](#Overview_of_Package_Files)
|
||||
* 4.[rm_bringup Topic Description](#rm_bringup_Topic_Description)
|
||||
|
||||
## rm_bringup_Package_Description
|
||||
rm_bringup is a function package for realizing the simultaneous running of multiple launch files. Using this package, a command can be used to launch complex functions combining multiple nodes. This package is introduced in detail in the following aspects.
|
||||
* 1.Package use.
|
||||
* 2.Package architecture description.
|
||||
* 3.Package topic description.
|
||||
Through the introduction of the three parts, it can help you:
|
||||
* 1.Understand the package use.
|
||||
* 2.Familiar with the file structure and function of the package.
|
||||
* 3.Familiar with the topic related to the package for easy development and use.
|
||||
Source code address: https://github.com/RealManRobot/ros2_rm_robot.git。
|
||||
## rm_bringup_Package_Use
|
||||
### moveit2_Controlling_Real_Robotic_Arm
|
||||
First, after configuring the environment and completing the connection, we can directly launch the node and run the launch.py file in the rm_bringup package through the following command.
|
||||
```
|
||||
rm@rm-desktop:~$ ros2 launch rm_bringup rm_<arm_type>_bringup.launch.py
|
||||
```
|
||||
In practice, the above <arm_type> needs to be replaced by the actual model of the robotic arm. The available models of the robotic arm are 65, 63, eco65, eco63, 75 and gen72.
|
||||
The command to start the six-axis force version of the manipulator is (note: eco63 is not available):
|
||||
```
|
||||
rm@rm-desktop:~$ ros2 launch rm_bringup rm_<arm_type>_6f_bringup.launch.py
|
||||
```
|
||||
The command to start the integrated six-axis force version of the manipulator is :
|
||||
```
|
||||
rm@rm-desktop:~$ ros2 launch rm_bringup rm_<arm_type>_6fb_bringup.launch.py
|
||||
```
|
||||
For example, the launch command of 65 robotic arm:
|
||||
```
|
||||
rm@rm-desktop:~$ ros2 launch rm_bringup rm_65_bringup.launch.py
|
||||
```
|
||||
The following screen appears in the interface after a successful node launch.
|
||||

|
||||
The launch file launches the function of moveit2 to control the real robotic arm. Then, you can control the robotic arm movement by dragging the control ball. For details, please refer to "[rm_moveit2_config Detailed Description](https://github.com/RealManRobot/ros2_rm_robot/blob/main/rm_moveit2_config/README.md)".
|
||||
### Gazebo_control_of_robotic_arm
|
||||
We can run the launch.py file in the rm_bringup package through the following command, and directly launch the gzaebo simulation node.
|
||||
```
|
||||
rm@rm-desktop:~$ ros2 launch rm_bringup rm_<arm_type>_gazebo.launch.py
|
||||
```
|
||||
In practice, the above <arm_type> needs to be replaced by the actual model of the robotic arm. The available models of the robotic arm are 65, 63, eco65、eco63, 75, and gen72.
|
||||
|
||||
The command to start the six-axis force version of the manipulator is (note: eco63 is not available):
|
||||
```
|
||||
rm@rm-desktop:~$ ros2 launch rm_bringup rm_<arm_type>_6f_gazebo.launch.py
|
||||
```
|
||||
The command to start the integrated six-axis force version of the manipulator is :
|
||||
```
|
||||
rm@rm-desktop:~$ ros2 launch rm_bringup rm_<arm_type>_6fb_gazebo.launch.py
|
||||
```
|
||||
For example, the launch command of 65 robotic arm:
|
||||
```
|
||||
rm@rm-desktop:~$ ros2 launch rm_bringup rm_65_gazebo.launch.py
|
||||
```
|
||||
The following screen appears in the interface after a successful node launch.
|
||||

|
||||
Then, we use the following command to launch moveit2 to control the simulation robot arm in Gazebo.
|
||||

|
||||
## rm_bringup_Package_Architecture_Description
|
||||
### Overview_of_Package_Files
|
||||
The current rm_driver package is composed of the following files.
|
||||
```
|
||||
├── CMakeLists.txt # compilation rule file
|
||||
├── doc # Supporting documents,pictures
|
||||
│ ├── rm_bringup1.png # pictures1
|
||||
│ ├── rm_bringup2.png # pictures2
|
||||
│ └── rm_bringup3.png # pictures3
|
||||
├── launch
|
||||
│ ├── rm_63_6f_bringup.launch.py # 63 arm six-axis force moveit2 launch file
|
||||
│ ├── rm_63_6f_gazebo.launch.py # 63 arm six-axis force gazebo launch file
|
||||
│ ├── rm_63_6fb_bringup.launch.py # 63 arm integrated six-axis force moveit2 launch file
|
||||
│ ├── rm_63_6fb_gazebo.launch.py # 63 arm integrated six-axis force gazebo launch file
|
||||
│ ├── rm_63_bringup.launch.py # 63 arm moveit2 launch file
|
||||
│ ├── rm_63_gazebo.launch.py # 63 arm gazebo launch file
|
||||
│ ├── rm_65_6f_bringup.launch.py # 65 arm six-axis force moveit2 launch file
|
||||
│ ├── rm_65_6f_gazebo.launch.py # 65 arm six-axis force gazebo launch file
|
||||
│ ├── rm_65_6fb_bringup.launch.py # 65 arm integrated six-axis force moveit2 launch file
|
||||
│ ├── rm_65_6fb_gazebo.launch.py # 65 arm integrated six-axis force gazebo launch file
|
||||
│ ├── rm_65_bringup.launch.py # 65 arm moveit2 launch file
|
||||
│ ├── rm_65_gazebo.launch.py # 65 arm gazebo launch file
|
||||
│ ├── rm_75_6f_bringup.launch.py # 75 arm six-axis force moveit2 launch file
|
||||
│ ├── rm_75_6f_gazebo.launch.py # 75 arm six-axis force gazebo launch file
|
||||
│ ├── rm_75_6fb_bringup.launch.py # 75 arm integrated six-axis force moveit2 launch file
|
||||
│ ├── rm_75_6fb_gazebo.launch.py # 75 arm integrated six-axis force gazebo launch file
|
||||
│ ├── rm_75_bringup.launch.py # 75 arm moveit2 launch file
|
||||
│ ├── rm_75_gazebo.launch.py # 75 arm gazebo launch file
|
||||
│ ├── rm_eco63_6fb_bringup.launch.py # eco63 arm integrated six-axis force moveit2 launch file
|
||||
│ ├── rm_eco63_6fb_gazebo.launch.py # eco63 arm integrated six-axis force gazebo launch file
|
||||
│ ├── rm_eco63_bringup.launch.py # eco63 arm moveit2 launch file
|
||||
│ ├── rm_eco63_gazebo.launch.py # eco63 arm gazebo launch file
|
||||
│ ├── rm_eco65_6f_bringup.launch.py # eco65 arm six-axis force moveit2 launch file
|
||||
│ ├── rm_eco65_6f_gazebo.launch.py # eco65 arm six-axis force gazebo launch file
|
||||
│ ├── rm_eco65_6fb_bringup.launch.py # eco65 arm integrated six-axis force moveit2 launch file
|
||||
│ ├── rm_eco65_6fb_gazebo.launch.py # eco65 arm integrated six-axis force gazebo launch file
|
||||
│ ├── rm_eco65_bringup.launch.py # eco65 arm moveit2 launch file
|
||||
│ ├── rm_eco65_gazebo.launch.py # eco65 arm gazebo launch file
|
||||
│ ├── rm_gen72_bringup.launch.py # gen72 arm moveit2 launch file
|
||||
│ └── rm_gen72_gazebo.launch.py # gen72 arm gazebo launch file
|
||||
│ ├── rm_gen72_II_bringup.launch.py # gen72_II arm moveit2 launch file
|
||||
│ └── rm_gen72_II_gazebo.launch.py # gen72_II arm gazebo launch file
|
||||
├── package.xml
|
||||
├── README_CN.md
|
||||
└── README.md
|
||||
```
|
||||
## rm_bringup_Topic_Description
|
||||
This package currently does not have its topic. It is mainly to call other packages. For the topics related to moveit2, please refer to "[rm_moveit2_config Detailed Description](https://github.com/RealManRobot/ros2_rm_robot/blob/main/rm_moveit2_config/README.md)".
|
||||
135
HiveCoreR0/src/ros2_rm_robot-humble/rm_bringup/README_CN.md
Normal file
@@ -0,0 +1,135 @@
|
||||
<div align="right">
|
||||
|
||||
[简体中文](https://github.com/RealManRobot/ros2_rm_robot/tree/humble/rm_bringup/README_CN.md)|[English](https://github.com/RealManRobot/ros2_rm_robot/tree/humble/rm_bringup/README.md)
|
||||
|
||||
</div>
|
||||
|
||||
<div align="center">
|
||||
|
||||
# 睿尔曼机器人rm_bringup使用说明书V1.4
|
||||
|
||||
睿尔曼智能科技(北京)有限公司
|
||||
文件修订记录:
|
||||
|
||||
| 版本号| 时间 | 备注 |
|
||||
| :---: | :-----: | :---: |
|
||||
|V1.0 |2024-2-19 |拟制 |
|
||||
|V1.1 |2024-7-8 |修订(添加GEN72适配文件) |
|
||||
|V1.2 |2024-9-10 |修订(添加ECO63适配文件) |
|
||||
|V1.3 |2024-12-25 |修订(添加了63、65、75、ECO65的六维力适配文件,以及63、65、75、ECO63、ECO65的一体化六维力适配文件) |
|
||||
|V1.4 |2025-4-7 |修订(添加了GEN72_II适配文件) |
|
||||
|
||||
</div>
|
||||
|
||||
## 目录
|
||||
* 1.[rm_bringup功能包说明](#rm_bringup功能包说明)
|
||||
* 2.[rm_bringup功能包使用](#rm_bringup功能包使用)
|
||||
* 2.1[moveit2控制真实机械臂](#moveit2控制真实机械臂)
|
||||
* 2.2[控制gazebo仿真机械臂](#控制gazebo仿真机械臂)
|
||||
* 3.[rm_bringup功能包架构说明](#rm_bringup功能包架构说明)
|
||||
* 3.1[功能包文件总览](#rm_bringup功能包架构说明)
|
||||
* 4.[rm_bringup话题说明](#rm_bringup话题说明)
|
||||
|
||||
## rm_bringup功能包说明
|
||||
rm_bringup功能包为实现多个launch文件同时运行所设计的功能包,使用该功能包可用一条命令实现多个节点结合的复杂功能的启动。
|
||||
* 1.功能包使用。
|
||||
* 2.功能包架构说明。
|
||||
* 3.功能包话题说明。
|
||||
通过这三部分内容的介绍可以帮助大家:
|
||||
* 1.了解该功能包的使用。
|
||||
* 2.熟悉功能包中的文件构成及作用。
|
||||
* 3.熟悉功能包相关的话题,方便开发和使用
|
||||
## rm_bringup功能包使用
|
||||
### moveit2控制真实机械臂
|
||||
首先配置好环境完成连接后我们可以通过以下命令直接启动节点,运行rm_bringup功能包中的launch.py文件。
|
||||
```
|
||||
rm@rm-desktop:~$ ros2 launch rm_bringup rm_<arm_type>_bringup.launch.py
|
||||
```
|
||||
在实际使用时需要将以上的<arm_type>更换为实际的机械臂型号,可选择的机械臂型号有65、63、eco65、eco63、75、gen72、gen72_II。
|
||||
|
||||
启动六维力版本机械臂的命令为(注意:eco63不可用):
|
||||
```
|
||||
rm@rm-desktop:~$ ros2 launch rm_bringup rm_<arm_type>_6f_bringup.launch.py
|
||||
```
|
||||
启动一体化六维力版本机械臂的命令为:
|
||||
```
|
||||
rm@rm-desktop:~$ ros2 launch rm_bringup rm_<arm_type>_6fb_bringup.launch.py
|
||||
```
|
||||
例如65机械臂的启动命令:
|
||||
```
|
||||
rm@rm-desktop:~$ ros2 launch rm_bringup rm_65_bringup.launch.py
|
||||
```
|
||||
节点启动成功后,将弹出以下画面。
|
||||

|
||||
实际该launch文件启动的为moveit2控制真实机械臂的功能下面就可以使用控制球规划控制机械臂运动,详细可查看《[rm_moveit2_config详解]((https://github.com/RealManRobot/ros2_rm_robot/blob/main/rm_moveit2_config/README_CN.md))》相关内容。
|
||||
### 控制gazebo仿真机械臂
|
||||
我们可以通过以下命令运行rm_bringup功能包中的launch.py文件,直接启动其中的gzaebo仿真节点。
|
||||
```
|
||||
rm@rm-desktop:~$ ros2 launch rm_bringup rm_<arm_type>_gazebo.launch.py
|
||||
```
|
||||
在实际使用时需要将以上的<arm_type>更换为实际的机械臂型号,可选择的机械臂型号有65、63、eco65、eco63、75、gen72、gen72_II。
|
||||
|
||||
启动六维力版本机械臂的命令为(注意:eco63不可用):
|
||||
```
|
||||
rm@rm-desktop:~$ ros2 launch rm_bringup rm_<arm_type>_6f_gazebo.launch.py
|
||||
```
|
||||
启动一体化六维力版本机械臂的命令为:
|
||||
```
|
||||
rm@rm-desktop:~$ ros2 launch rm_bringup rm_<arm_type>_6fb_gazebo.launch.py
|
||||
```
|
||||
例如65机械臂的启动命令:
|
||||
```
|
||||
rm@rm-desktop:~$ ros2 launch rm_bringup rm_65_gazebo.launch.py
|
||||
```
|
||||
节点启动成功后,将弹出以下画面。
|
||||

|
||||
之后我们使用如下指令启动moveit2控制gazebo中的仿真机械臂。
|
||||

|
||||
## rm_bringup功能包架构说明
|
||||
### 功能包文件总览
|
||||
当前rm_bringup功能包的文件构成如下。
|
||||
```
|
||||
├── CMakeLists.txt #编译规则文件
|
||||
├── doc #辅助文档、图片存放文件夹
|
||||
│ ├── rm_bringup1.png #图片1
|
||||
│ ├── rm_bringup2.png #图片2
|
||||
│ └── rm_bringup3.png #图片3
|
||||
├── launch #启动文件
|
||||
│ ├── rm_63_6f_bringup.launch.py #63臂六维力moveit2启动文件
|
||||
│ ├── rm_63_6f_gazebo.launch.py #63臂六维力gazebo启动文件
|
||||
│ ├── rm_63_6fb_bringup.launch.py #63臂一体化六维力moveit2启动文件
|
||||
│ ├── rm_63_6fb_gazebo.launch.py #63臂一体化六维力gazebo启动文件
|
||||
│ ├── rm_63_bringup.launch.py #63臂moveit2启动文件
|
||||
│ ├── rm_63_gazebo.launch.py #63臂gazebo启动文件
|
||||
│ ├── rm_65_6f_bringup.launch.py #65臂六维力moveit2启动文件
|
||||
│ ├── rm_65_6f_gazebo.launch.py #65臂六维力gazebo启动文件
|
||||
│ ├── rm_65_6fb_bringup.launch.py #65臂一体化六维力moveit2启动文件
|
||||
│ ├── rm_65_6fb_gazebo.launch.py #65臂一体化六维力gazebo启动文件
|
||||
│ ├── rm_65_bringup.launch.py #65臂moveit2启动文件
|
||||
│ ├── rm_65_gazebo.launch.py #65臂gazebo启动文件
|
||||
│ ├── rm_75_6f_bringup.launch.py #75臂六维力moveit2启动文件
|
||||
│ ├── rm_75_6f_gazebo.launch.py #75臂六维力gazebo启动文件
|
||||
│ ├── rm_75_6fb_bringup.launch.py #75臂一体化六维力moveit2启动文件
|
||||
│ ├── rm_75_6fb_gazebo.launch.py #75臂一体化六维力gazebo启动文件
|
||||
│ ├── rm_75_bringup.launch.py #75臂moveit2启动文件
|
||||
│ ├── rm_75_gazebo.launch.py #75臂gazebo启动文件
|
||||
│ ├── rm_eco63_6fb_bringup.launch.py #eco63臂一体化六维力moveit2启动文件
|
||||
│ ├── rm_eco63_6fb_gazebo.launch.py #eco63臂一体化六维力gazebo启动文件
|
||||
│ ├── rm_eco63_bringup.launch.py #eco63臂moveit2启动文件
|
||||
│ ├── rm_eco63_gazebo.launch.py #eco63臂gazebo启动文件
|
||||
│ ├── rm_eco65_6f_bringup.launch.py #eco65臂六维力moveit2启动文件
|
||||
│ ├── rm_eco65_6f_gazebo.launch.py #eco65臂六维力gazebo启动文件
|
||||
│ ├── rm_eco65_6fb_bringup.launch.py #eco65臂一体化六维力moveit2启动文件
|
||||
│ ├── rm_eco65_6fb_gazebo.launch.py #eco65臂一体化六维力gazebo启动文件
|
||||
│ ├── rm_eco65_bringup.launch.py #eco65臂moveit2启动文件
|
||||
│ ├── rm_eco65_gazebo.launch.py #eco65臂gazebo启动文件
|
||||
│ ├── rm_gen72_bringup.launch.py #gen72臂moveit2启动文件
|
||||
│ ├── rm_gen72_gazebo.launch.py #gen72臂gazebo启动文件
|
||||
│ ├── rm_gen72_II_bringup.launch.py #gen72_II臂moveit2启动文件
|
||||
│ └── rm_gen72_II_gazebo.launch.py #gen72_II臂gazebo启动文件
|
||||
├── package.xml #依赖说明文件
|
||||
├── README_CN.md #中文说明文档
|
||||
└── README.md #英文说明文档
|
||||
```
|
||||
## rm_bringup话题说明
|
||||
该功能包当前并没有本身的话题,主要为调用其他功能包的话题实现,关于moveit2相关话题可查看《[rm_moveit2_config详解](https://github.com/RealManRobot/ros2_rm_robot/blob/main/rm_moveit2_config/README_CN.md)》相关内容。
|
||||
|
After Width: | Height: | Size: 289 KiB |
|
After Width: | Height: | Size: 222 KiB |
|
After Width: | Height: | Size: 542 KiB |
@@ -0,0 +1,36 @@
|
||||
import os
|
||||
from ament_index_python.packages import get_package_share_directory
|
||||
from launch import LaunchDescription
|
||||
from launch.actions import SetEnvironmentVariable
|
||||
from launch_ros.actions import Node
|
||||
from launch.substitutions import LaunchConfiguration
|
||||
from launch.actions import DeclareLaunchArgument
|
||||
from launch.conditions import IfCondition
|
||||
from launch.actions import (DeclareLaunchArgument, GroupAction,
|
||||
IncludeLaunchDescription, SetEnvironmentVariable)
|
||||
from launch.launch_description_sources import PythonLaunchDescriptionSource
|
||||
|
||||
def generate_launch_description():
|
||||
|
||||
rm_63_driver = IncludeLaunchDescription(
|
||||
PythonLaunchDescriptionSource(os.path.join(get_package_share_directory(('rm_driver')),'launch', 'rm_63_driver.launch.py'))
|
||||
)
|
||||
|
||||
rm_63_description = IncludeLaunchDescription(
|
||||
PythonLaunchDescriptionSource(os.path.join(get_package_share_directory('rm_description'), 'launch', 'rm_63_6f_display.launch.py')),
|
||||
)
|
||||
|
||||
rm_63_control = IncludeLaunchDescription(
|
||||
PythonLaunchDescriptionSource(os.path.join(get_package_share_directory(('rm_control')),'launch', 'rm_63_control.launch.py'))
|
||||
)
|
||||
|
||||
rm_63_moveit_config = IncludeLaunchDescription(
|
||||
PythonLaunchDescriptionSource(os.path.join(get_package_share_directory(('rm_63_config')),'launch', 'real_moveit_demo_6f.launch.py'))
|
||||
)
|
||||
|
||||
return LaunchDescription([
|
||||
rm_63_driver,
|
||||
rm_63_description,
|
||||
rm_63_control,
|
||||
rm_63_moveit_config
|
||||
])
|
||||
@@ -0,0 +1,26 @@
|
||||
import os
|
||||
from ament_index_python.packages import get_package_share_directory
|
||||
from launch import LaunchDescription
|
||||
from launch.actions import SetEnvironmentVariable
|
||||
from launch_ros.actions import Node
|
||||
from launch.substitutions import LaunchConfiguration
|
||||
from launch.actions import DeclareLaunchArgument
|
||||
from launch.conditions import IfCondition
|
||||
from launch.actions import (DeclareLaunchArgument, GroupAction,
|
||||
IncludeLaunchDescription, SetEnvironmentVariable)
|
||||
from launch.launch_description_sources import PythonLaunchDescriptionSource
|
||||
|
||||
def generate_launch_description():
|
||||
|
||||
rm_63_gazebo_up = IncludeLaunchDescription(
|
||||
PythonLaunchDescriptionSource(os.path.join(get_package_share_directory(('rm_gazebo')),'launch', 'gazebo_63_6f_demo.launch.py'))
|
||||
)
|
||||
|
||||
rm_63_gazebo_moveit = IncludeLaunchDescription(
|
||||
PythonLaunchDescriptionSource(os.path.join(get_package_share_directory(('rm_63_config')),'launch', 'gazebo_moveit_demo_6f.launch.py'))
|
||||
)
|
||||
|
||||
return LaunchDescription([
|
||||
rm_63_gazebo_up,
|
||||
rm_63_gazebo_moveit
|
||||
])
|
||||
@@ -0,0 +1,36 @@
|
||||
import os
|
||||
from ament_index_python.packages import get_package_share_directory
|
||||
from launch import LaunchDescription
|
||||
from launch.actions import SetEnvironmentVariable
|
||||
from launch_ros.actions import Node
|
||||
from launch.substitutions import LaunchConfiguration
|
||||
from launch.actions import DeclareLaunchArgument
|
||||
from launch.conditions import IfCondition
|
||||
from launch.actions import (DeclareLaunchArgument, GroupAction,
|
||||
IncludeLaunchDescription, SetEnvironmentVariable)
|
||||
from launch.launch_description_sources import PythonLaunchDescriptionSource
|
||||
|
||||
def generate_launch_description():
|
||||
|
||||
rm_63_driver = IncludeLaunchDescription(
|
||||
PythonLaunchDescriptionSource(os.path.join(get_package_share_directory(('rm_driver')),'launch', 'rm_63_driver.launch.py'))
|
||||
)
|
||||
|
||||
rm_63_description = IncludeLaunchDescription(
|
||||
PythonLaunchDescriptionSource(os.path.join(get_package_share_directory('rm_description'), 'launch', 'rm_63_6fb_display.launch.py')),
|
||||
)
|
||||
|
||||
rm_63_control = IncludeLaunchDescription(
|
||||
PythonLaunchDescriptionSource(os.path.join(get_package_share_directory(('rm_control')),'launch', 'rm_63_control.launch.py'))
|
||||
)
|
||||
|
||||
rm_63_moveit_config = IncludeLaunchDescription(
|
||||
PythonLaunchDescriptionSource(os.path.join(get_package_share_directory(('rm_63_config')),'launch', 'real_moveit_demo_6fb.launch.py'))
|
||||
)
|
||||
|
||||
return LaunchDescription([
|
||||
rm_63_driver,
|
||||
rm_63_description,
|
||||
rm_63_control,
|
||||
rm_63_moveit_config
|
||||
])
|
||||
@@ -0,0 +1,26 @@
|
||||
import os
|
||||
from ament_index_python.packages import get_package_share_directory
|
||||
from launch import LaunchDescription
|
||||
from launch.actions import SetEnvironmentVariable
|
||||
from launch_ros.actions import Node
|
||||
from launch.substitutions import LaunchConfiguration
|
||||
from launch.actions import DeclareLaunchArgument
|
||||
from launch.conditions import IfCondition
|
||||
from launch.actions import (DeclareLaunchArgument, GroupAction,
|
||||
IncludeLaunchDescription, SetEnvironmentVariable)
|
||||
from launch.launch_description_sources import PythonLaunchDescriptionSource
|
||||
|
||||
def generate_launch_description():
|
||||
|
||||
rm_63_gazebo_up = IncludeLaunchDescription(
|
||||
PythonLaunchDescriptionSource(os.path.join(get_package_share_directory(('rm_gazebo')),'launch', 'gazebo_63_6fb_demo.launch.py'))
|
||||
)
|
||||
|
||||
rm_63_gazebo_moveit = IncludeLaunchDescription(
|
||||
PythonLaunchDescriptionSource(os.path.join(get_package_share_directory(('rm_63_config')),'launch', 'gazebo_moveit_demo_6fb.launch.py'))
|
||||
)
|
||||
|
||||
return LaunchDescription([
|
||||
rm_63_gazebo_up,
|
||||
rm_63_gazebo_moveit
|
||||
])
|
||||
@@ -0,0 +1,36 @@
|
||||
import os
|
||||
from ament_index_python.packages import get_package_share_directory
|
||||
from launch import LaunchDescription
|
||||
from launch.actions import SetEnvironmentVariable
|
||||
from launch_ros.actions import Node
|
||||
from launch.substitutions import LaunchConfiguration
|
||||
from launch.actions import DeclareLaunchArgument
|
||||
from launch.conditions import IfCondition
|
||||
from launch.actions import (DeclareLaunchArgument, GroupAction,
|
||||
IncludeLaunchDescription, SetEnvironmentVariable)
|
||||
from launch.launch_description_sources import PythonLaunchDescriptionSource
|
||||
|
||||
def generate_launch_description():
|
||||
|
||||
rm_63_driver = IncludeLaunchDescription(
|
||||
PythonLaunchDescriptionSource(os.path.join(get_package_share_directory(('rm_driver')),'launch', 'rm_63_driver.launch.py'))
|
||||
)
|
||||
|
||||
rm_63_description = IncludeLaunchDescription(
|
||||
PythonLaunchDescriptionSource(os.path.join(get_package_share_directory('rm_description'), 'launch', 'rm_63_display.launch.py')),
|
||||
)
|
||||
|
||||
rm_63_control = IncludeLaunchDescription(
|
||||
PythonLaunchDescriptionSource(os.path.join(get_package_share_directory(('rm_control')),'launch', 'rm_63_control.launch.py'))
|
||||
)
|
||||
|
||||
rm_63_moveit_config = IncludeLaunchDescription(
|
||||
PythonLaunchDescriptionSource(os.path.join(get_package_share_directory(('rm_63_config')),'launch', 'real_moveit_demo.launch.py'))
|
||||
)
|
||||
|
||||
return LaunchDescription([
|
||||
rm_63_driver,
|
||||
rm_63_description,
|
||||
rm_63_control,
|
||||
rm_63_moveit_config
|
||||
])
|
||||
@@ -0,0 +1,26 @@
|
||||
import os
|
||||
from ament_index_python.packages import get_package_share_directory
|
||||
from launch import LaunchDescription
|
||||
from launch.actions import SetEnvironmentVariable
|
||||
from launch_ros.actions import Node
|
||||
from launch.substitutions import LaunchConfiguration
|
||||
from launch.actions import DeclareLaunchArgument
|
||||
from launch.conditions import IfCondition
|
||||
from launch.actions import (DeclareLaunchArgument, GroupAction,
|
||||
IncludeLaunchDescription, SetEnvironmentVariable)
|
||||
from launch.launch_description_sources import PythonLaunchDescriptionSource
|
||||
|
||||
def generate_launch_description():
|
||||
|
||||
rm_63_gazebo_up = IncludeLaunchDescription(
|
||||
PythonLaunchDescriptionSource(os.path.join(get_package_share_directory(('rm_gazebo')),'launch', 'gazebo_63_demo.launch.py'))
|
||||
)
|
||||
|
||||
rm_63_gazebo_moveit = IncludeLaunchDescription(
|
||||
PythonLaunchDescriptionSource(os.path.join(get_package_share_directory(('rm_63_config')),'launch', 'gazebo_moveit_demo.launch.py'))
|
||||
)
|
||||
|
||||
return LaunchDescription([
|
||||
rm_63_gazebo_up,
|
||||
rm_63_gazebo_moveit
|
||||
])
|
||||
@@ -0,0 +1,36 @@
|
||||
import os
|
||||
from ament_index_python.packages import get_package_share_directory
|
||||
from launch import LaunchDescription
|
||||
from launch.actions import SetEnvironmentVariable
|
||||
from launch_ros.actions import Node
|
||||
from launch.substitutions import LaunchConfiguration
|
||||
from launch.actions import DeclareLaunchArgument
|
||||
from launch.conditions import IfCondition
|
||||
from launch.actions import (DeclareLaunchArgument, GroupAction,
|
||||
IncludeLaunchDescription, SetEnvironmentVariable)
|
||||
from launch.launch_description_sources import PythonLaunchDescriptionSource
|
||||
|
||||
def generate_launch_description():
|
||||
|
||||
rm_65_driver = IncludeLaunchDescription(
|
||||
PythonLaunchDescriptionSource(os.path.join(get_package_share_directory(('rm_driver')),'launch', 'rm_65_driver.launch.py'))
|
||||
)
|
||||
|
||||
rm_65_description = IncludeLaunchDescription(
|
||||
PythonLaunchDescriptionSource(os.path.join(get_package_share_directory('rm_description'), 'launch', 'rm_65_6f_display.launch.py')),
|
||||
)
|
||||
|
||||
rm_65_control = IncludeLaunchDescription(
|
||||
PythonLaunchDescriptionSource(os.path.join(get_package_share_directory(('rm_control')),'launch', 'rm_65_control.launch.py'))
|
||||
)
|
||||
|
||||
rm_65_moveit_config = IncludeLaunchDescription(
|
||||
PythonLaunchDescriptionSource(os.path.join(get_package_share_directory(('rm_65_config')),'launch', 'real_moveit_demo_6f.launch.py'))
|
||||
)
|
||||
|
||||
return LaunchDescription([
|
||||
rm_65_driver,
|
||||
rm_65_description,
|
||||
rm_65_control,
|
||||
rm_65_moveit_config
|
||||
])
|
||||
@@ -0,0 +1,25 @@
|
||||
import os
|
||||
from ament_index_python.packages import get_package_share_directory
|
||||
from launch import LaunchDescription
|
||||
from launch.actions import SetEnvironmentVariable
|
||||
from launch_ros.actions import Node
|
||||
from launch.substitutions import LaunchConfiguration
|
||||
from launch.actions import DeclareLaunchArgument
|
||||
from launch.conditions import IfCondition
|
||||
from launch.actions import (DeclareLaunchArgument, GroupAction,
|
||||
IncludeLaunchDescription, SetEnvironmentVariable)
|
||||
from launch.launch_description_sources import PythonLaunchDescriptionSource
|
||||
|
||||
def generate_launch_description():
|
||||
|
||||
rm_65_gazebo_up = IncludeLaunchDescription(
|
||||
PythonLaunchDescriptionSource(os.path.join(get_package_share_directory(('rm_gazebo')),'launch', 'gazebo_65_6f_demo.launch.py'))
|
||||
)
|
||||
rm_65_gazebo_moveit = IncludeLaunchDescription(
|
||||
PythonLaunchDescriptionSource(os.path.join(get_package_share_directory(('rm_65_config')),'launch', 'gazebo_moveit_demo_6f.launch.py'))
|
||||
)
|
||||
|
||||
return LaunchDescription([
|
||||
rm_65_gazebo_up,
|
||||
rm_65_gazebo_moveit
|
||||
])
|
||||
@@ -0,0 +1,36 @@
|
||||
import os
|
||||
from ament_index_python.packages import get_package_share_directory
|
||||
from launch import LaunchDescription
|
||||
from launch.actions import SetEnvironmentVariable
|
||||
from launch_ros.actions import Node
|
||||
from launch.substitutions import LaunchConfiguration
|
||||
from launch.actions import DeclareLaunchArgument
|
||||
from launch.conditions import IfCondition
|
||||
from launch.actions import (DeclareLaunchArgument, GroupAction,
|
||||
IncludeLaunchDescription, SetEnvironmentVariable)
|
||||
from launch.launch_description_sources import PythonLaunchDescriptionSource
|
||||
|
||||
def generate_launch_description():
|
||||
|
||||
rm_65_driver = IncludeLaunchDescription(
|
||||
PythonLaunchDescriptionSource(os.path.join(get_package_share_directory(('rm_driver')),'launch', 'rm_65_driver.launch.py'))
|
||||
)
|
||||
|
||||
rm_65_description = IncludeLaunchDescription(
|
||||
PythonLaunchDescriptionSource(os.path.join(get_package_share_directory('rm_description'), 'launch', 'rm_65_6fb_display.launch.py')),
|
||||
)
|
||||
|
||||
rm_65_control = IncludeLaunchDescription(
|
||||
PythonLaunchDescriptionSource(os.path.join(get_package_share_directory(('rm_control')),'launch', 'rm_65_control.launch.py'))
|
||||
)
|
||||
|
||||
rm_65_moveit_config = IncludeLaunchDescription(
|
||||
PythonLaunchDescriptionSource(os.path.join(get_package_share_directory(('rm_65_config')),'launch', 'real_moveit_demo_6fb.launch.py'))
|
||||
)
|
||||
|
||||
return LaunchDescription([
|
||||
rm_65_driver,
|
||||
rm_65_description,
|
||||
rm_65_control,
|
||||
rm_65_moveit_config
|
||||
])
|
||||
@@ -0,0 +1,25 @@
|
||||
import os
|
||||
from ament_index_python.packages import get_package_share_directory
|
||||
from launch import LaunchDescription
|
||||
from launch.actions import SetEnvironmentVariable
|
||||
from launch_ros.actions import Node
|
||||
from launch.substitutions import LaunchConfiguration
|
||||
from launch.actions import DeclareLaunchArgument
|
||||
from launch.conditions import IfCondition
|
||||
from launch.actions import (DeclareLaunchArgument, GroupAction,
|
||||
IncludeLaunchDescription, SetEnvironmentVariable)
|
||||
from launch.launch_description_sources import PythonLaunchDescriptionSource
|
||||
|
||||
def generate_launch_description():
|
||||
|
||||
rm_65_gazebo_up = IncludeLaunchDescription(
|
||||
PythonLaunchDescriptionSource(os.path.join(get_package_share_directory(('rm_gazebo')),'launch', 'gazebo_65_6fb_demo.launch.py'))
|
||||
)
|
||||
rm_65_gazebo_moveit = IncludeLaunchDescription(
|
||||
PythonLaunchDescriptionSource(os.path.join(get_package_share_directory(('rm_65_config')),'launch', 'gazebo_moveit_demo_6fb.launch.py'))
|
||||
)
|
||||
|
||||
return LaunchDescription([
|
||||
rm_65_gazebo_up,
|
||||
rm_65_gazebo_moveit
|
||||
])
|
||||
@@ -0,0 +1,36 @@
|
||||
import os
|
||||
from ament_index_python.packages import get_package_share_directory
|
||||
from launch import LaunchDescription
|
||||
from launch.actions import SetEnvironmentVariable
|
||||
from launch_ros.actions import Node
|
||||
from launch.substitutions import LaunchConfiguration
|
||||
from launch.actions import DeclareLaunchArgument
|
||||
from launch.conditions import IfCondition
|
||||
from launch.actions import (DeclareLaunchArgument, GroupAction,
|
||||
IncludeLaunchDescription, SetEnvironmentVariable)
|
||||
from launch.launch_description_sources import PythonLaunchDescriptionSource
|
||||
|
||||
def generate_launch_description():
|
||||
|
||||
rm_65_driver = IncludeLaunchDescription(
|
||||
PythonLaunchDescriptionSource(os.path.join(get_package_share_directory(('rm_driver')),'launch', 'rm_65_driver.launch.py'))
|
||||
)
|
||||
|
||||
rm_65_description = IncludeLaunchDescription(
|
||||
PythonLaunchDescriptionSource(os.path.join(get_package_share_directory('rm_description'), 'launch', 'rm_65_display.launch.py')),
|
||||
)
|
||||
|
||||
rm_65_control = IncludeLaunchDescription(
|
||||
PythonLaunchDescriptionSource(os.path.join(get_package_share_directory(('rm_control')),'launch', 'rm_65_control.launch.py'))
|
||||
)
|
||||
|
||||
rm_65_moveit_config = IncludeLaunchDescription(
|
||||
PythonLaunchDescriptionSource(os.path.join(get_package_share_directory(('rm_65_config')),'launch', 'real_moveit_demo.launch.py'))
|
||||
)
|
||||
|
||||
return LaunchDescription([
|
||||
rm_65_driver,
|
||||
rm_65_description,
|
||||
rm_65_control,
|
||||
rm_65_moveit_config
|
||||
])
|
||||
@@ -0,0 +1,25 @@
|
||||
import os
|
||||
from ament_index_python.packages import get_package_share_directory
|
||||
from launch import LaunchDescription
|
||||
from launch.actions import SetEnvironmentVariable
|
||||
from launch_ros.actions import Node
|
||||
from launch.substitutions import LaunchConfiguration
|
||||
from launch.actions import DeclareLaunchArgument
|
||||
from launch.conditions import IfCondition
|
||||
from launch.actions import (DeclareLaunchArgument, GroupAction,
|
||||
IncludeLaunchDescription, SetEnvironmentVariable)
|
||||
from launch.launch_description_sources import PythonLaunchDescriptionSource
|
||||
|
||||
def generate_launch_description():
|
||||
|
||||
rm_65_gazebo_up = IncludeLaunchDescription(
|
||||
PythonLaunchDescriptionSource(os.path.join(get_package_share_directory(('rm_gazebo')),'launch', 'gazebo_65_demo.launch.py'))
|
||||
)
|
||||
rm_65_gazebo_moveit = IncludeLaunchDescription(
|
||||
PythonLaunchDescriptionSource(os.path.join(get_package_share_directory(('rm_65_config')),'launch', 'gazebo_moveit_demo.launch.py'))
|
||||
)
|
||||
|
||||
return LaunchDescription([
|
||||
rm_65_gazebo_up,
|
||||
rm_65_gazebo_moveit
|
||||
])
|
||||
@@ -0,0 +1,36 @@
|
||||
import os
|
||||
from ament_index_python.packages import get_package_share_directory
|
||||
from launch import LaunchDescription
|
||||
from launch.actions import SetEnvironmentVariable
|
||||
from launch_ros.actions import Node
|
||||
from launch.substitutions import LaunchConfiguration
|
||||
from launch.actions import DeclareLaunchArgument
|
||||
from launch.conditions import IfCondition
|
||||
from launch.actions import (DeclareLaunchArgument, GroupAction,
|
||||
IncludeLaunchDescription, SetEnvironmentVariable)
|
||||
from launch.launch_description_sources import PythonLaunchDescriptionSource
|
||||
|
||||
def generate_launch_description():
|
||||
|
||||
rm_75_driver = IncludeLaunchDescription(
|
||||
PythonLaunchDescriptionSource(os.path.join(get_package_share_directory(('rm_driver')),'launch', 'rm_75_driver.launch.py'))
|
||||
)
|
||||
|
||||
rm_75_description = IncludeLaunchDescription(
|
||||
PythonLaunchDescriptionSource(os.path.join(get_package_share_directory('rm_description'), 'launch', 'rm_75_6f_display.launch.py')),
|
||||
)
|
||||
|
||||
rm_75_control = IncludeLaunchDescription(
|
||||
PythonLaunchDescriptionSource(os.path.join(get_package_share_directory(('rm_control')),'launch', 'rm_75_control.launch.py'))
|
||||
)
|
||||
|
||||
rm_75_moveit_config = IncludeLaunchDescription(
|
||||
PythonLaunchDescriptionSource(os.path.join(get_package_share_directory(('rm_75_config')),'launch', 'real_moveit_demo_6f.launch.py'))
|
||||
)
|
||||
|
||||
return LaunchDescription([
|
||||
rm_75_driver,
|
||||
rm_75_description,
|
||||
rm_75_control,
|
||||
rm_75_moveit_config
|
||||
])
|
||||
@@ -0,0 +1,26 @@
|
||||
import os
|
||||
from ament_index_python.packages import get_package_share_directory
|
||||
from launch import LaunchDescription
|
||||
from launch.actions import SetEnvironmentVariable
|
||||
from launch_ros.actions import Node
|
||||
from launch.substitutions import LaunchConfiguration
|
||||
from launch.actions import DeclareLaunchArgument
|
||||
from launch.conditions import IfCondition
|
||||
from launch.actions import (DeclareLaunchArgument, GroupAction,
|
||||
IncludeLaunchDescription, SetEnvironmentVariable)
|
||||
from launch.launch_description_sources import PythonLaunchDescriptionSource
|
||||
|
||||
def generate_launch_description():
|
||||
|
||||
rm_75_gazebo_up = IncludeLaunchDescription(
|
||||
PythonLaunchDescriptionSource(os.path.join(get_package_share_directory(('rm_gazebo')),'launch', 'gazebo_75_6f_demo.launch.py'))
|
||||
)
|
||||
|
||||
rm_75_gazebo_moveit = IncludeLaunchDescription(
|
||||
PythonLaunchDescriptionSource(os.path.join(get_package_share_directory(('rm_75_config')),'launch', 'gazebo_moveit_demo_6f.launch.py'))
|
||||
)
|
||||
|
||||
return LaunchDescription([
|
||||
rm_75_gazebo_up,
|
||||
rm_75_gazebo_moveit
|
||||
])
|
||||
@@ -0,0 +1,36 @@
|
||||
import os
|
||||
from ament_index_python.packages import get_package_share_directory
|
||||
from launch import LaunchDescription
|
||||
from launch.actions import SetEnvironmentVariable
|
||||
from launch_ros.actions import Node
|
||||
from launch.substitutions import LaunchConfiguration
|
||||
from launch.actions import DeclareLaunchArgument
|
||||
from launch.conditions import IfCondition
|
||||
from launch.actions import (DeclareLaunchArgument, GroupAction,
|
||||
IncludeLaunchDescription, SetEnvironmentVariable)
|
||||
from launch.launch_description_sources import PythonLaunchDescriptionSource
|
||||
|
||||
def generate_launch_description():
|
||||
|
||||
rm_75_driver = IncludeLaunchDescription(
|
||||
PythonLaunchDescriptionSource(os.path.join(get_package_share_directory(('rm_driver')),'launch', 'rm_75_driver.launch.py'))
|
||||
)
|
||||
|
||||
rm_75_description = IncludeLaunchDescription(
|
||||
PythonLaunchDescriptionSource(os.path.join(get_package_share_directory('rm_description'), 'launch', 'rm_75_6fb_display.launch.py')),
|
||||
)
|
||||
|
||||
rm_75_control = IncludeLaunchDescription(
|
||||
PythonLaunchDescriptionSource(os.path.join(get_package_share_directory(('rm_control')),'launch', 'rm_75_control.launch.py'))
|
||||
)
|
||||
|
||||
rm_75_moveit_config = IncludeLaunchDescription(
|
||||
PythonLaunchDescriptionSource(os.path.join(get_package_share_directory(('rm_75_config')),'launch', 'real_moveit_demo_6fb.launch.py'))
|
||||
)
|
||||
|
||||
return LaunchDescription([
|
||||
rm_75_driver,
|
||||
rm_75_description,
|
||||
rm_75_control,
|
||||
rm_75_moveit_config
|
||||
])
|
||||
@@ -0,0 +1,26 @@
|
||||
import os
|
||||
from ament_index_python.packages import get_package_share_directory
|
||||
from launch import LaunchDescription
|
||||
from launch.actions import SetEnvironmentVariable
|
||||
from launch_ros.actions import Node
|
||||
from launch.substitutions import LaunchConfiguration
|
||||
from launch.actions import DeclareLaunchArgument
|
||||
from launch.conditions import IfCondition
|
||||
from launch.actions import (DeclareLaunchArgument, GroupAction,
|
||||
IncludeLaunchDescription, SetEnvironmentVariable)
|
||||
from launch.launch_description_sources import PythonLaunchDescriptionSource
|
||||
|
||||
def generate_launch_description():
|
||||
|
||||
rm_75_gazebo_up = IncludeLaunchDescription(
|
||||
PythonLaunchDescriptionSource(os.path.join(get_package_share_directory(('rm_gazebo')),'launch', 'gazebo_75_6fb_demo.launch.py'))
|
||||
)
|
||||
|
||||
rm_75_gazebo_moveit = IncludeLaunchDescription(
|
||||
PythonLaunchDescriptionSource(os.path.join(get_package_share_directory(('rm_75_config')),'launch', 'gazebo_moveit_demo_6fb.launch.py'))
|
||||
)
|
||||
|
||||
return LaunchDescription([
|
||||
rm_75_gazebo_up,
|
||||
rm_75_gazebo_moveit
|
||||
])
|
||||
@@ -0,0 +1,36 @@
|
||||
import os
|
||||
from ament_index_python.packages import get_package_share_directory
|
||||
from launch import LaunchDescription
|
||||
from launch.actions import SetEnvironmentVariable
|
||||
from launch_ros.actions import Node
|
||||
from launch.substitutions import LaunchConfiguration
|
||||
from launch.actions import DeclareLaunchArgument
|
||||
from launch.conditions import IfCondition
|
||||
from launch.actions import (DeclareLaunchArgument, GroupAction,
|
||||
IncludeLaunchDescription, SetEnvironmentVariable)
|
||||
from launch.launch_description_sources import PythonLaunchDescriptionSource
|
||||
|
||||
def generate_launch_description():
|
||||
|
||||
rm_75_driver = IncludeLaunchDescription(
|
||||
PythonLaunchDescriptionSource(os.path.join(get_package_share_directory(('rm_driver')),'launch', 'rm_75_driver.launch.py'))
|
||||
)
|
||||
|
||||
rm_75_description = IncludeLaunchDescription(
|
||||
PythonLaunchDescriptionSource(os.path.join(get_package_share_directory('rm_description'), 'launch', 'rm_75_display.launch.py')),
|
||||
)
|
||||
|
||||
rm_75_control = IncludeLaunchDescription(
|
||||
PythonLaunchDescriptionSource(os.path.join(get_package_share_directory(('rm_control')),'launch', 'rm_75_control.launch.py'))
|
||||
)
|
||||
|
||||
rm_75_moveit_config = IncludeLaunchDescription(
|
||||
PythonLaunchDescriptionSource(os.path.join(get_package_share_directory(('rm_75_config')),'launch', 'real_moveit_demo.launch.py'))
|
||||
)
|
||||
|
||||
return LaunchDescription([
|
||||
rm_75_driver,
|
||||
rm_75_description,
|
||||
rm_75_control,
|
||||
rm_75_moveit_config
|
||||
])
|
||||
@@ -0,0 +1,26 @@
|
||||
import os
|
||||
from ament_index_python.packages import get_package_share_directory
|
||||
from launch import LaunchDescription
|
||||
from launch.actions import SetEnvironmentVariable
|
||||
from launch_ros.actions import Node
|
||||
from launch.substitutions import LaunchConfiguration
|
||||
from launch.actions import DeclareLaunchArgument
|
||||
from launch.conditions import IfCondition
|
||||
from launch.actions import (DeclareLaunchArgument, GroupAction,
|
||||
IncludeLaunchDescription, SetEnvironmentVariable)
|
||||
from launch.launch_description_sources import PythonLaunchDescriptionSource
|
||||
|
||||
def generate_launch_description():
|
||||
|
||||
rm_75_gazebo_up = IncludeLaunchDescription(
|
||||
PythonLaunchDescriptionSource(os.path.join(get_package_share_directory(('rm_gazebo')),'launch', 'gazebo_75_demo.launch.py'))
|
||||
)
|
||||
|
||||
rm_75_gazebo_moveit = IncludeLaunchDescription(
|
||||
PythonLaunchDescriptionSource(os.path.join(get_package_share_directory(('rm_75_config')),'launch', 'gazebo_moveit_demo.launch.py'))
|
||||
)
|
||||
|
||||
return LaunchDescription([
|
||||
rm_75_gazebo_up,
|
||||
rm_75_gazebo_moveit
|
||||
])
|
||||
@@ -0,0 +1,36 @@
|
||||
import os
|
||||
from ament_index_python.packages import get_package_share_directory
|
||||
from launch import LaunchDescription
|
||||
from launch.actions import SetEnvironmentVariable
|
||||
from launch_ros.actions import Node
|
||||
from launch.substitutions import LaunchConfiguration
|
||||
from launch.actions import DeclareLaunchArgument
|
||||
from launch.conditions import IfCondition
|
||||
from launch.actions import (DeclareLaunchArgument, GroupAction,
|
||||
IncludeLaunchDescription, SetEnvironmentVariable)
|
||||
from launch.launch_description_sources import PythonLaunchDescriptionSource
|
||||
|
||||
def generate_launch_description():
|
||||
|
||||
rm_eco63_driver = IncludeLaunchDescription(
|
||||
PythonLaunchDescriptionSource(os.path.join(get_package_share_directory(('rm_driver')),'launch', 'rm_eco63_driver.launch.py'))
|
||||
)
|
||||
|
||||
rm_eco63_description = IncludeLaunchDescription(
|
||||
PythonLaunchDescriptionSource(os.path.join(get_package_share_directory('rm_description'), 'launch', 'rm_eco63_6fb_display.launch.py')),
|
||||
)
|
||||
|
||||
rm_eco63_control = IncludeLaunchDescription(
|
||||
PythonLaunchDescriptionSource(os.path.join(get_package_share_directory(('rm_control')),'launch', 'rm_eco63_control.launch.py'))
|
||||
)
|
||||
|
||||
rm_eco63_moveit_config = IncludeLaunchDescription(
|
||||
PythonLaunchDescriptionSource(os.path.join(get_package_share_directory(('rm_eco63_config')),'launch', 'real_moveit_demo_6fb.launch.py'))
|
||||
)
|
||||
|
||||
return LaunchDescription([
|
||||
rm_eco63_driver,
|
||||
rm_eco63_description,
|
||||
rm_eco63_control,
|
||||
rm_eco63_moveit_config
|
||||
])
|
||||
@@ -0,0 +1,26 @@
|
||||
import os
|
||||
from ament_index_python.packages import get_package_share_directory
|
||||
from launch import LaunchDescription
|
||||
from launch.actions import SetEnvironmentVariable
|
||||
from launch_ros.actions import Node
|
||||
from launch.substitutions import LaunchConfiguration
|
||||
from launch.actions import DeclareLaunchArgument
|
||||
from launch.conditions import IfCondition
|
||||
from launch.actions import (DeclareLaunchArgument, GroupAction,
|
||||
IncludeLaunchDescription, SetEnvironmentVariable)
|
||||
from launch.launch_description_sources import PythonLaunchDescriptionSource
|
||||
|
||||
def generate_launch_description():
|
||||
|
||||
rm_eco63_gazebo_up = IncludeLaunchDescription(
|
||||
PythonLaunchDescriptionSource(os.path.join(get_package_share_directory(('rm_gazebo')),'launch', 'gazebo_eco63_6fb_demo.launch.py'))
|
||||
)
|
||||
|
||||
rm_eco63_gazebo_moveit = IncludeLaunchDescription(
|
||||
PythonLaunchDescriptionSource(os.path.join(get_package_share_directory(('rm_eco63_config')),'launch', 'gazebo_moveit_demo_6fb.launch.py'))
|
||||
)
|
||||
|
||||
return LaunchDescription([
|
||||
rm_eco63_gazebo_up,
|
||||
rm_eco63_gazebo_moveit
|
||||
])
|
||||
@@ -0,0 +1,36 @@
|
||||
import os
|
||||
from ament_index_python.packages import get_package_share_directory
|
||||
from launch import LaunchDescription
|
||||
from launch.actions import SetEnvironmentVariable
|
||||
from launch_ros.actions import Node
|
||||
from launch.substitutions import LaunchConfiguration
|
||||
from launch.actions import DeclareLaunchArgument
|
||||
from launch.conditions import IfCondition
|
||||
from launch.actions import (DeclareLaunchArgument, GroupAction,
|
||||
IncludeLaunchDescription, SetEnvironmentVariable)
|
||||
from launch.launch_description_sources import PythonLaunchDescriptionSource
|
||||
|
||||
def generate_launch_description():
|
||||
|
||||
rm_eco63_driver = IncludeLaunchDescription(
|
||||
PythonLaunchDescriptionSource(os.path.join(get_package_share_directory(('rm_driver')),'launch', 'rm_eco63_driver.launch.py'))
|
||||
)
|
||||
|
||||
rm_eco63_description = IncludeLaunchDescription(
|
||||
PythonLaunchDescriptionSource(os.path.join(get_package_share_directory('rm_description'), 'launch', 'rm_eco63_display.launch.py')),
|
||||
)
|
||||
|
||||
rm_eco63_control = IncludeLaunchDescription(
|
||||
PythonLaunchDescriptionSource(os.path.join(get_package_share_directory(('rm_control')),'launch', 'rm_eco63_control.launch.py'))
|
||||
)
|
||||
|
||||
rm_eco63_moveit_config = IncludeLaunchDescription(
|
||||
PythonLaunchDescriptionSource(os.path.join(get_package_share_directory(('rm_eco63_config')),'launch', 'real_moveit_demo.launch.py'))
|
||||
)
|
||||
|
||||
return LaunchDescription([
|
||||
rm_eco63_driver,
|
||||
rm_eco63_description,
|
||||
rm_eco63_control,
|
||||
rm_eco63_moveit_config
|
||||
])
|
||||
@@ -0,0 +1,26 @@
|
||||
import os
|
||||
from ament_index_python.packages import get_package_share_directory
|
||||
from launch import LaunchDescription
|
||||
from launch.actions import SetEnvironmentVariable
|
||||
from launch_ros.actions import Node
|
||||
from launch.substitutions import LaunchConfiguration
|
||||
from launch.actions import DeclareLaunchArgument
|
||||
from launch.conditions import IfCondition
|
||||
from launch.actions import (DeclareLaunchArgument, GroupAction,
|
||||
IncludeLaunchDescription, SetEnvironmentVariable)
|
||||
from launch.launch_description_sources import PythonLaunchDescriptionSource
|
||||
|
||||
def generate_launch_description():
|
||||
|
||||
rm_eco63_gazebo_up = IncludeLaunchDescription(
|
||||
PythonLaunchDescriptionSource(os.path.join(get_package_share_directory(('rm_gazebo')),'launch', 'gazebo_eco63_demo.launch.py'))
|
||||
)
|
||||
|
||||
rm_eco63_gazebo_moveit = IncludeLaunchDescription(
|
||||
PythonLaunchDescriptionSource(os.path.join(get_package_share_directory(('rm_eco63_config')),'launch', 'gazebo_moveit_demo.launch.py'))
|
||||
)
|
||||
|
||||
return LaunchDescription([
|
||||
rm_eco63_gazebo_up,
|
||||
rm_eco63_gazebo_moveit
|
||||
])
|
||||
@@ -0,0 +1,36 @@
|
||||
import os
|
||||
from ament_index_python.packages import get_package_share_directory
|
||||
from launch import LaunchDescription
|
||||
from launch.actions import SetEnvironmentVariable
|
||||
from launch_ros.actions import Node
|
||||
from launch.substitutions import LaunchConfiguration
|
||||
from launch.actions import DeclareLaunchArgument
|
||||
from launch.conditions import IfCondition
|
||||
from launch.actions import (DeclareLaunchArgument, GroupAction,
|
||||
IncludeLaunchDescription, SetEnvironmentVariable)
|
||||
from launch.launch_description_sources import PythonLaunchDescriptionSource
|
||||
|
||||
def generate_launch_description():
|
||||
|
||||
rm_eco65_driver = IncludeLaunchDescription(
|
||||
PythonLaunchDescriptionSource(os.path.join(get_package_share_directory(('rm_driver')),'launch', 'rm_eco65_driver.launch.py'))
|
||||
)
|
||||
|
||||
rm_eco65_description = IncludeLaunchDescription(
|
||||
PythonLaunchDescriptionSource(os.path.join(get_package_share_directory('rm_description'), 'launch', 'rm_eco65_6f_display.launch.py')),
|
||||
)
|
||||
|
||||
rm_eco65_control = IncludeLaunchDescription(
|
||||
PythonLaunchDescriptionSource(os.path.join(get_package_share_directory(('rm_control')),'launch', 'rm_eco65_control.launch.py'))
|
||||
)
|
||||
|
||||
rm_eco65_moveit_config = IncludeLaunchDescription(
|
||||
PythonLaunchDescriptionSource(os.path.join(get_package_share_directory(('rm_eco65_config')),'launch', 'real_moveit_demo_6f.launch.py'))
|
||||
)
|
||||
|
||||
return LaunchDescription([
|
||||
rm_eco65_driver,
|
||||
rm_eco65_description,
|
||||
rm_eco65_control,
|
||||
rm_eco65_moveit_config
|
||||
])
|
||||
@@ -0,0 +1,26 @@
|
||||
import os
|
||||
from ament_index_python.packages import get_package_share_directory
|
||||
from launch import LaunchDescription
|
||||
from launch.actions import SetEnvironmentVariable
|
||||
from launch_ros.actions import Node
|
||||
from launch.substitutions import LaunchConfiguration
|
||||
from launch.actions import DeclareLaunchArgument
|
||||
from launch.conditions import IfCondition
|
||||
from launch.actions import (DeclareLaunchArgument, GroupAction,
|
||||
IncludeLaunchDescription, SetEnvironmentVariable)
|
||||
from launch.launch_description_sources import PythonLaunchDescriptionSource
|
||||
|
||||
def generate_launch_description():
|
||||
|
||||
rm_eco65_gazebo_up = IncludeLaunchDescription(
|
||||
PythonLaunchDescriptionSource(os.path.join(get_package_share_directory(('rm_gazebo')),'launch', 'gazebo_eco65_6f_demo.launch.py'))
|
||||
)
|
||||
|
||||
rm_eco65_gazebo_moveit = IncludeLaunchDescription(
|
||||
PythonLaunchDescriptionSource(os.path.join(get_package_share_directory(('rm_eco65_config')),'launch', 'gazebo_moveit_demo_6f.launch.py'))
|
||||
)
|
||||
|
||||
return LaunchDescription([
|
||||
rm_eco65_gazebo_up,
|
||||
rm_eco65_gazebo_moveit
|
||||
])
|
||||
@@ -0,0 +1,36 @@
|
||||
import os
|
||||
from ament_index_python.packages import get_package_share_directory
|
||||
from launch import LaunchDescription
|
||||
from launch.actions import SetEnvironmentVariable
|
||||
from launch_ros.actions import Node
|
||||
from launch.substitutions import LaunchConfiguration
|
||||
from launch.actions import DeclareLaunchArgument
|
||||
from launch.conditions import IfCondition
|
||||
from launch.actions import (DeclareLaunchArgument, GroupAction,
|
||||
IncludeLaunchDescription, SetEnvironmentVariable)
|
||||
from launch.launch_description_sources import PythonLaunchDescriptionSource
|
||||
|
||||
def generate_launch_description():
|
||||
|
||||
rm_eco65_driver = IncludeLaunchDescription(
|
||||
PythonLaunchDescriptionSource(os.path.join(get_package_share_directory(('rm_driver')),'launch', 'rm_eco65_driver.launch.py'))
|
||||
)
|
||||
|
||||
rm_eco65_description = IncludeLaunchDescription(
|
||||
PythonLaunchDescriptionSource(os.path.join(get_package_share_directory('rm_description'), 'launch', 'rm_eco65_6fb_display.launch.py')),
|
||||
)
|
||||
|
||||
rm_eco65_control = IncludeLaunchDescription(
|
||||
PythonLaunchDescriptionSource(os.path.join(get_package_share_directory(('rm_control')),'launch', 'rm_eco65_control.launch.py'))
|
||||
)
|
||||
|
||||
rm_eco65_moveit_config = IncludeLaunchDescription(
|
||||
PythonLaunchDescriptionSource(os.path.join(get_package_share_directory(('rm_eco65_config')),'launch', 'real_moveit_demo_6fb.launch.py'))
|
||||
)
|
||||
|
||||
return LaunchDescription([
|
||||
rm_eco65_driver,
|
||||
rm_eco65_description,
|
||||
rm_eco65_control,
|
||||
rm_eco65_moveit_config
|
||||
])
|
||||
@@ -0,0 +1,26 @@
|
||||
import os
|
||||
from ament_index_python.packages import get_package_share_directory
|
||||
from launch import LaunchDescription
|
||||
from launch.actions import SetEnvironmentVariable
|
||||
from launch_ros.actions import Node
|
||||
from launch.substitutions import LaunchConfiguration
|
||||
from launch.actions import DeclareLaunchArgument
|
||||
from launch.conditions import IfCondition
|
||||
from launch.actions import (DeclareLaunchArgument, GroupAction,
|
||||
IncludeLaunchDescription, SetEnvironmentVariable)
|
||||
from launch.launch_description_sources import PythonLaunchDescriptionSource
|
||||
|
||||
def generate_launch_description():
|
||||
|
||||
rm_eco65_gazebo_up = IncludeLaunchDescription(
|
||||
PythonLaunchDescriptionSource(os.path.join(get_package_share_directory(('rm_gazebo')),'launch', 'gazebo_eco65_6fb_demo.launch.py'))
|
||||
)
|
||||
|
||||
rm_eco65_gazebo_moveit = IncludeLaunchDescription(
|
||||
PythonLaunchDescriptionSource(os.path.join(get_package_share_directory(('rm_eco65_config')),'launch', 'gazebo_moveit_demo_6fb.launch.py'))
|
||||
)
|
||||
|
||||
return LaunchDescription([
|
||||
rm_eco65_gazebo_up,
|
||||
rm_eco65_gazebo_moveit
|
||||
])
|
||||
@@ -0,0 +1,36 @@
|
||||
import os
|
||||
from ament_index_python.packages import get_package_share_directory
|
||||
from launch import LaunchDescription
|
||||
from launch.actions import SetEnvironmentVariable
|
||||
from launch_ros.actions import Node
|
||||
from launch.substitutions import LaunchConfiguration
|
||||
from launch.actions import DeclareLaunchArgument
|
||||
from launch.conditions import IfCondition
|
||||
from launch.actions import (DeclareLaunchArgument, GroupAction,
|
||||
IncludeLaunchDescription, SetEnvironmentVariable)
|
||||
from launch.launch_description_sources import PythonLaunchDescriptionSource
|
||||
|
||||
def generate_launch_description():
|
||||
|
||||
rm_eco65_driver = IncludeLaunchDescription(
|
||||
PythonLaunchDescriptionSource(os.path.join(get_package_share_directory(('rm_driver')),'launch', 'rm_eco65_driver.launch.py'))
|
||||
)
|
||||
|
||||
rm_eco65_description = IncludeLaunchDescription(
|
||||
PythonLaunchDescriptionSource(os.path.join(get_package_share_directory('rm_description'), 'launch', 'rm_eco65_display.launch.py')),
|
||||
)
|
||||
|
||||
rm_eco65_control = IncludeLaunchDescription(
|
||||
PythonLaunchDescriptionSource(os.path.join(get_package_share_directory(('rm_control')),'launch', 'rm_eco65_control.launch.py'))
|
||||
)
|
||||
|
||||
rm_eco65_moveit_config = IncludeLaunchDescription(
|
||||
PythonLaunchDescriptionSource(os.path.join(get_package_share_directory(('rm_eco65_config')),'launch', 'real_moveit_demo.launch.py'))
|
||||
)
|
||||
|
||||
return LaunchDescription([
|
||||
rm_eco65_driver,
|
||||
rm_eco65_description,
|
||||
rm_eco65_control,
|
||||
rm_eco65_moveit_config
|
||||
])
|
||||
@@ -0,0 +1,26 @@
|
||||
import os
|
||||
from ament_index_python.packages import get_package_share_directory
|
||||
from launch import LaunchDescription
|
||||
from launch.actions import SetEnvironmentVariable
|
||||
from launch_ros.actions import Node
|
||||
from launch.substitutions import LaunchConfiguration
|
||||
from launch.actions import DeclareLaunchArgument
|
||||
from launch.conditions import IfCondition
|
||||
from launch.actions import (DeclareLaunchArgument, GroupAction,
|
||||
IncludeLaunchDescription, SetEnvironmentVariable)
|
||||
from launch.launch_description_sources import PythonLaunchDescriptionSource
|
||||
|
||||
def generate_launch_description():
|
||||
|
||||
rm_eco65_gazebo_up = IncludeLaunchDescription(
|
||||
PythonLaunchDescriptionSource(os.path.join(get_package_share_directory(('rm_gazebo')),'launch', 'gazebo_eco65_demo.launch.py'))
|
||||
)
|
||||
|
||||
rm_eco65_gazebo_moveit = IncludeLaunchDescription(
|
||||
PythonLaunchDescriptionSource(os.path.join(get_package_share_directory(('rm_eco65_config')),'launch', 'gazebo_moveit_demo.launch.py'))
|
||||
)
|
||||
|
||||
return LaunchDescription([
|
||||
rm_eco65_gazebo_up,
|
||||
rm_eco65_gazebo_moveit
|
||||
])
|
||||
@@ -0,0 +1,36 @@
|
||||
import os
|
||||
from ament_index_python.packages import get_package_share_directory
|
||||
from launch import LaunchDescription
|
||||
from launch.actions import SetEnvironmentVariable
|
||||
from launch_ros.actions import Node
|
||||
from launch.substitutions import LaunchConfiguration
|
||||
from launch.actions import DeclareLaunchArgument
|
||||
from launch.conditions import IfCondition
|
||||
from launch.actions import (DeclareLaunchArgument, GroupAction,
|
||||
IncludeLaunchDescription, SetEnvironmentVariable)
|
||||
from launch.launch_description_sources import PythonLaunchDescriptionSource
|
||||
|
||||
def generate_launch_description():
|
||||
|
||||
rm_gen72_driver = IncludeLaunchDescription(
|
||||
PythonLaunchDescriptionSource(os.path.join(get_package_share_directory(('rm_driver')),'launch', 'rm_gen72_driver.launch.py'))
|
||||
)
|
||||
|
||||
rm_gen72_description = IncludeLaunchDescription(
|
||||
PythonLaunchDescriptionSource(os.path.join(get_package_share_directory('rm_description'), 'launch', 'rm_gen72_II_display.launch.py')),
|
||||
)
|
||||
|
||||
rm_gen72_control = IncludeLaunchDescription(
|
||||
PythonLaunchDescriptionSource(os.path.join(get_package_share_directory(('rm_control')),'launch', 'rm_gen72_control.launch.py'))
|
||||
)
|
||||
|
||||
rm_gen72_moveit_config = IncludeLaunchDescription(
|
||||
PythonLaunchDescriptionSource(os.path.join(get_package_share_directory(('rm_gen72_config')),'launch', 'real_moveit_demo_II.launch.py'))
|
||||
)
|
||||
|
||||
return LaunchDescription([
|
||||
rm_gen72_driver,
|
||||
rm_gen72_description,
|
||||
rm_gen72_control,
|
||||
rm_gen72_moveit_config
|
||||
])
|
||||
@@ -0,0 +1,26 @@
|
||||
import os
|
||||
from ament_index_python.packages import get_package_share_directory
|
||||
from launch import LaunchDescription
|
||||
from launch.actions import SetEnvironmentVariable
|
||||
from launch_ros.actions import Node
|
||||
from launch.substitutions import LaunchConfiguration
|
||||
from launch.actions import DeclareLaunchArgument
|
||||
from launch.conditions import IfCondition
|
||||
from launch.actions import (DeclareLaunchArgument, GroupAction,
|
||||
IncludeLaunchDescription, SetEnvironmentVariable)
|
||||
from launch.launch_description_sources import PythonLaunchDescriptionSource
|
||||
|
||||
def generate_launch_description():
|
||||
|
||||
rm_gen72_gazebo_up = IncludeLaunchDescription(
|
||||
PythonLaunchDescriptionSource(os.path.join(get_package_share_directory(('rm_gazebo')),'launch', 'gazebo_gen72_II_demo.launch.py'))
|
||||
)
|
||||
|
||||
rm_gen72_gazebo_moveit = IncludeLaunchDescription(
|
||||
PythonLaunchDescriptionSource(os.path.join(get_package_share_directory(('rm_gen72_config')),'launch', 'gazebo_moveit_demo_II.launch.py'))
|
||||
)
|
||||
|
||||
return LaunchDescription([
|
||||
rm_gen72_gazebo_up,
|
||||
rm_gen72_gazebo_moveit
|
||||
])
|
||||
@@ -0,0 +1,36 @@
|
||||
import os
|
||||
from ament_index_python.packages import get_package_share_directory
|
||||
from launch import LaunchDescription
|
||||
from launch.actions import SetEnvironmentVariable
|
||||
from launch_ros.actions import Node
|
||||
from launch.substitutions import LaunchConfiguration
|
||||
from launch.actions import DeclareLaunchArgument
|
||||
from launch.conditions import IfCondition
|
||||
from launch.actions import (DeclareLaunchArgument, GroupAction,
|
||||
IncludeLaunchDescription, SetEnvironmentVariable)
|
||||
from launch.launch_description_sources import PythonLaunchDescriptionSource
|
||||
|
||||
def generate_launch_description():
|
||||
|
||||
rm_gen72_driver = IncludeLaunchDescription(
|
||||
PythonLaunchDescriptionSource(os.path.join(get_package_share_directory(('rm_driver')),'launch', 'rm_gen72_driver.launch.py'))
|
||||
)
|
||||
|
||||
rm_gen72_description = IncludeLaunchDescription(
|
||||
PythonLaunchDescriptionSource(os.path.join(get_package_share_directory('rm_description'), 'launch', 'rm_gen72_display.launch.py')),
|
||||
)
|
||||
|
||||
rm_gen72_control = IncludeLaunchDescription(
|
||||
PythonLaunchDescriptionSource(os.path.join(get_package_share_directory(('rm_control')),'launch', 'rm_gen72_control.launch.py'))
|
||||
)
|
||||
|
||||
rm_gen72_moveit_config = IncludeLaunchDescription(
|
||||
PythonLaunchDescriptionSource(os.path.join(get_package_share_directory(('rm_gen72_config')),'launch', 'real_moveit_demo.launch.py'))
|
||||
)
|
||||
|
||||
return LaunchDescription([
|
||||
rm_gen72_driver,
|
||||
rm_gen72_description,
|
||||
rm_gen72_control,
|
||||
rm_gen72_moveit_config
|
||||
])
|
||||
@@ -0,0 +1,26 @@
|
||||
import os
|
||||
from ament_index_python.packages import get_package_share_directory
|
||||
from launch import LaunchDescription
|
||||
from launch.actions import SetEnvironmentVariable
|
||||
from launch_ros.actions import Node
|
||||
from launch.substitutions import LaunchConfiguration
|
||||
from launch.actions import DeclareLaunchArgument
|
||||
from launch.conditions import IfCondition
|
||||
from launch.actions import (DeclareLaunchArgument, GroupAction,
|
||||
IncludeLaunchDescription, SetEnvironmentVariable)
|
||||
from launch.launch_description_sources import PythonLaunchDescriptionSource
|
||||
|
||||
def generate_launch_description():
|
||||
|
||||
rm_gen72_gazebo_up = IncludeLaunchDescription(
|
||||
PythonLaunchDescriptionSource(os.path.join(get_package_share_directory(('rm_gazebo')),'launch', 'gazebo_gen72_demo.launch.py'))
|
||||
)
|
||||
|
||||
rm_gen72_gazebo_moveit = IncludeLaunchDescription(
|
||||
PythonLaunchDescriptionSource(os.path.join(get_package_share_directory(('rm_gen72_config')),'launch', 'gazebo_moveit_demo.launch.py'))
|
||||
)
|
||||
|
||||
return LaunchDescription([
|
||||
rm_gen72_gazebo_up,
|
||||
rm_gen72_gazebo_moveit
|
||||
])
|
||||
18
HiveCoreR0/src/ros2_rm_robot-humble/rm_bringup/package.xml
Normal file
@@ -0,0 +1,18 @@
|
||||
<?xml version="1.0"?>
|
||||
<?xml-model href="http://download.ros.org/schema/package_format3.xsd" schematypens="http://www.w3.org/2001/XMLSchema"?>
|
||||
<package format="3">
|
||||
<name>rm_bringup</name>
|
||||
<version>0.0.0</version>
|
||||
<description>TODO: Package description</description>
|
||||
<maintainer email="rm@todo.todo">rm</maintainer>
|
||||
<license>TODO: License declaration</license>
|
||||
|
||||
<buildtool_depend>ament_cmake</buildtool_depend>
|
||||
|
||||
<test_depend>ament_lint_auto</test_depend>
|
||||
<test_depend>ament_lint_common</test_depend>
|
||||
|
||||
<export>
|
||||
<build_type>ament_cmake</build_type>
|
||||
</export>
|
||||
</package>
|
||||
@@ -0,0 +1,60 @@
|
||||
cmake_minimum_required(VERSION 3.5)
|
||||
project(rm_control)
|
||||
|
||||
# Default to C99
|
||||
if(NOT CMAKE_C_STANDARD)
|
||||
set(CMAKE_C_STANDARD 99)
|
||||
endif()
|
||||
|
||||
# Default to C++14
|
||||
if(NOT CMAKE_CXX_STANDARD)
|
||||
set(CMAKE_CXX_STANDARD 14)
|
||||
endif()
|
||||
|
||||
# if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang")
|
||||
# add_compile_options(-Wall -Wextra -Wpedantic)
|
||||
# endif()
|
||||
## Compile as C++11, supported in ROS Kinetic and newer
|
||||
# add_compile_options(-std=c++11)
|
||||
|
||||
## Find catkin macros and libraries
|
||||
## if COMPONENTS list like find_package(catkin REQUIRED COMPONENTS xyz)
|
||||
## is used, also find other catkin packages
|
||||
find_package(ament_cmake REQUIRED)
|
||||
find_package(rclcpp_action REQUIRED)
|
||||
find_package(actionlib_msgs REQUIRED)
|
||||
find_package(control_msgs REQUIRED)
|
||||
find_package(rclcpp REQUIRED)
|
||||
find_package(std_msgs REQUIRED)
|
||||
find_package(rm_ros_interfaces REQUIRED)
|
||||
|
||||
include_directories(
|
||||
${PROJECT_SOURCE_DIR}
|
||||
${PROJECT_SOURCE_DIR}/include
|
||||
${PROJECT_SOURCE_DIR}/include/${PROJECT_NAME}
|
||||
)
|
||||
|
||||
install(
|
||||
DIRECTORY launch
|
||||
DESTINATION share/${PROJECT_NAME}
|
||||
)
|
||||
|
||||
if(BUILD_TESTING)
|
||||
find_package(ament_lint_auto REQUIRED)
|
||||
# the following line skips the linter which checks for copyrights
|
||||
# uncomment the line when a copyright and license is not present in all source files
|
||||
#set(ament_cmake_copyright_FOUND TRUE)
|
||||
# the following line skips cpplint (only works in a git repo)
|
||||
# uncomment the line when this package is not in a git repo
|
||||
#set(ament_cmake_cpplint_FOUND TRUE)
|
||||
ament_lint_auto_find_test_dependencies()
|
||||
endif()
|
||||
add_executable(rm_control src/rm_control.cpp)
|
||||
|
||||
ament_target_dependencies(rm_control rclcpp std_msgs sensor_msgs rm_ros_interfaces rclcpp_action actionlib_msgs control_msgs)
|
||||
|
||||
install(TARGETS
|
||||
rm_control
|
||||
DESTINATION lib/${PROJECT_NAME})
|
||||
|
||||
ament_package()
|
||||
117
HiveCoreR0/src/ros2_rm_robot-humble/rm_control/README.md
Normal file
@@ -0,0 +1,117 @@
|
||||
<div align="right">
|
||||
|
||||
[简体中文](https://github.com/RealManRobot/ros2_rm_robot/blob/humble/rm_control/README_CN.md)|[English](https://github.com/RealManRobot/ros2_rm_robot/blob/humble/rm_control/README.md)
|
||||
|
||||
</div>
|
||||
|
||||
<div align="center">
|
||||
|
||||
# RealMan Robot rm_control User Manual V1.2
|
||||
|
||||
RealMan Intelligent Technology (Beijing) Co., Ltd.
|
||||
|
||||
Revision History:
|
||||
|
||||
|No. | Date | Comment |
|
||||
| :---: | :----: | :---: |
|
||||
|V1.0 | 2/19/2024 | Draft |
|
||||
|V1.1 | 7/8 /2024 | Amend(Add GEN72 adapter files) |
|
||||
|V1.2 | 9/10 /2024| Amend(Add ECO63 adapter files) |
|
||||
</div>
|
||||
|
||||
## Content
|
||||
* 1.[rm_control Package Description](#rm_control_Package_Description)
|
||||
* 2.[rm_control Package Function](#rm_control_Package_Function)
|
||||
* 2.1[Basic use of the package](#Basic_use_of_the_package)
|
||||
* 2.2[Advanced use of the package](#Advanced_use_of_the_package)
|
||||
* 3.[rm_control Package Architecture Description](#rm_control_Package_Architecture_Description)
|
||||
* 3.1[Overview of Package Files](#Overview_of_Package_Files)
|
||||
* 4.[rm_control Topic Description](#rm_control_Topic_Description)
|
||||
|
||||
## rm_control_Package_Description
|
||||
rm_control is a function package for realizing the moveit2 control of a real robotic arm. The package is mainly used to further subdivide the path points planned by moveit2, and give the subdivided path points to rm_driver in a through-transmission way to realize the planning and running of the robotic arm. This package is introduced in detail in the following aspects.
|
||||
* 1.Package use.
|
||||
* 2.Package architecture description.
|
||||
* 3.Package topic description.
|
||||
Through the introduction of the three parts, it can help you:
|
||||
* 1.Understand the package use.
|
||||
* 2.Familiar with the file structure and function of the package.
|
||||
* 3.Familiar with the topic related to the package for easy development and use.
|
||||
Source code address: https://github.com/RealManRobot/ros2_rm_robot.git。
|
||||
## rm_control_Package_Function
|
||||
### Basic_use_of_the_package
|
||||
First, after configuring the environment and completing the connection, we can directly start the node and run the rm_control package.
|
||||
```
|
||||
rm@rm-desktop:~$ ros2 launch rm_control rm_<arm_type>_control.launch.py
|
||||
```
|
||||
In practice, the above <arm_type> needs to be replaced by the actual model of the robotic arm. The available models of the robotic arm are 65, 63, eco65、eco63, 75, and gen72.
|
||||
For example, the launch command of 65 robotic arm:
|
||||
```
|
||||
rm@rm-desktop:~$ ros2 launch rm_control rm_65_control.launch.py
|
||||
```
|
||||
The following screen appears in the interface after successful node startup.
|
||||

|
||||
It does not play a role when the node of the package is launched alone. It needs to be combined with the rm_driver package and the relevant nodes of moveit2 to play a role. For details, please refer to the relevant content of "rm_moveit2_config Detailed Description".
|
||||
### Advanced_use_of_the_package
|
||||
Some parameters can be configured in the rm_control package. Because there are not many parameters, the parameters are directly configured in the launch file.
|
||||

|
||||
As shown in the figure above, the position of the first red box is the file path, and the position of the second box is the current configurable parameter.
|
||||
Parameter follows: represents the following mode used by the current transmission, where true is high following and false is low following. The high following indicates that the robotic arm's movement mode is consistent with the transmission. It must do detailed calculations based on its transmission rate, speed, and acceleration. The threshold is set too high, but the control is fine. The low following indicates that the robotic arm moves to the transmission point based on its transmission rate, speed, and acceleration. If there are points that cannot be reached in time, there may be abandonment. The threshold is set low, and the control is not very fine but meets the use.
|
||||
Parameter arm_type: represents the current model of the robotic arm. The parameters that can be selected are 65 (RM65 series), 651 (ECO65 series), 634 (ECO63 series), 632 (RM63 series), 75 (RM75 series) and 72 (GEN72 series).
|
||||
In practice, we choose the corresponding launch file to start, which will automatically select the correct model. If there are special requirements, you can modify the corresponding parameters here. After modification, recompile the configuration in the workspace directory, and then the modified configuration will take effect.
|
||||
Run colcon build command in the workspace directory.
|
||||
```
|
||||
rm@rm-desktop: ~/ros2_ws$ colcon build
|
||||
```
|
||||
After successful compilation, follow the above commands to start the package.
|
||||
## rm_control_Package_Architecture_Description
|
||||
### Overview_of_package_files
|
||||
The current rm_control package is composed of the following files.
|
||||
```
|
||||
├── CMakeLists.txt # compilation rule file
|
||||
├── doc
|
||||
│ ├── rm_control1.png
|
||||
│ └── rm_control2.png
|
||||
├── include # dependency header file folder
|
||||
│ ├── cubicSpline.h # cubic spline interpolation header file
|
||||
│ └── rm_control.h #rm_control header file
|
||||
├── launch
|
||||
│ ├── rm_63_control.launch.py # 63 launch file
|
||||
│ ├── rm_65_control.launch.py # 65 launch file
|
||||
│ ├── rm_75_control.launch.py # 75 launch file
|
||||
│ ├── rm_eco65_control.launch.py # eco65 launch file
|
||||
│ ├── rm_eco63_control.launch.py # eco63 launch file
|
||||
│ └── rm_gen72_control.launch.py # gen72 launch file
|
||||
├── package.xml # dependency declaration file
|
||||
├── README_CN.md
|
||||
├── README.md
|
||||
└── src
|
||||
└── rm_control.cpp # code source file
|
||||
```
|
||||
## rm_control_Topic_Description
|
||||
The following is the topic description of the package.
|
||||
```
|
||||
Subscribers:
|
||||
/parameter_events: rcl_interfaces/msg/ParameterEvent
|
||||
/rm_driver/move_stop_cmd: std_msgs::msg::Bool
|
||||
Publishers:
|
||||
/parameter_events: rcl_interfaces/msg/ParameterEvent
|
||||
/rm_driver/movej_canfd_cmd: rm_ros_interfaces/msg/Jointpos
|
||||
/rosout: rcl_interfaces/msg/Log
|
||||
Service Servers:
|
||||
/rm_control/describe_parameters: rcl_interfaces/srv/DescribeParameters
|
||||
/rm_control/get_parameter_types: rcl_interfaces/srv/GetParameterTypes
|
||||
/rm_control/get_parameters: rcl_interfaces/srv/GetParameters
|
||||
/rm_control/list_parameters: rcl_interfaces/srv/ListParameters
|
||||
/rm_control/set_parameters: rcl_interfaces/srv/SetParameters
|
||||
/rm_control/set_parameters_atomically: rcl_interfaces/srv/SetParametersAtomically
|
||||
Service Clients:
|
||||
|
||||
Action Servers:
|
||||
/rm_group_controller/follow_joint_trajectory: control_msgs/action/FollowJointTrajectory
|
||||
Action Clients:
|
||||
```
|
||||
We mainly focus on the following topics.
|
||||
Publishers: represents its current published topic, the most important published topic is /rm_driver/movej_canfd_cmd, through which we publish the subdivided points to rm_driver node, and then rm_driver node gives the corresponding path to the robotic arm through the transmission way.
|
||||
Action Servers: represents the action information it receives and publishes, /rm_group controller/follow_joint_trajectory action as the bridge of communication between rm_control and moveit2, through which rm_control receives the path planned by moveit2, and rm_control further subdivides these paths from the above topic to rm_driver.
|
||||
There are relatively few remaining topics and service use scenarios, so we do not introduce them in detail here, and you can learn by yourself.
|
||||
116
HiveCoreR0/src/ros2_rm_robot-humble/rm_control/README_CN.md
Normal file
@@ -0,0 +1,116 @@
|
||||
<div align="right">
|
||||
|
||||
[简体中文](https://github.com/RealManRobot/ros2_rm_robot/blob/humble/rm_control/README_CN.md)|[English](https://github.com/RealManRobot/ros2_rm_robot/blob/humble/rm_control/README.md)
|
||||
|
||||
</div>
|
||||
|
||||
<div align="center">
|
||||
|
||||
# 睿尔曼机器人rm_control使用说明书V1.2
|
||||
|
||||
睿尔曼智能科技(北京)有限公司
|
||||
文件修订记录:
|
||||
|
||||
| 版本号| 时间 | 备注 |
|
||||
| :---: | :-----: | :---: |
|
||||
|V1.0 |2024-2-19 |拟制 |
|
||||
|V1.1 |2024-7-3 |修订(添加GEN72相关适配文件) |
|
||||
|V1.2 |2024-9-10 |修订(添加ECO63相关适配文件) |
|
||||
|
||||
</div>
|
||||
|
||||
## 目录
|
||||
* 1.[rm_control功能包说明](#rm_control功能包说明)
|
||||
* 2.[rm_control功能包使用](#rm_control功能包使用)
|
||||
* 2.1[功能包基础使用](#功能包基础使用)
|
||||
* 2.2[功能包进阶使用](#功能包进阶使用)
|
||||
* 3.[rm_control功能包架构说明](#rm_control功能包架构说明)
|
||||
* 3.1[功能包文件总览](#功能包文件总览)
|
||||
* 4.[rm_control话题说明](#rm_control话题说明)
|
||||
|
||||
## rm_control功能包说明
|
||||
rm_control功能包为实现moveit2控制真实机械臂时所必须的一个功能包,该功能包的主要作用为将moveit2规划好的路径点进行进一步的细分,将细分后的路径点以透传的方式给到rm_driver,实现机械臂的规划运行。
|
||||
* 1.功能包使用。
|
||||
* 2.功能包架构说明。
|
||||
* 3.功能包话题说明。
|
||||
通过这三部分内容的介绍可以帮助大家:
|
||||
* 1.了解该功能包的使用。
|
||||
* 2.熟悉功能包中的文件构成及作用。
|
||||
* 3.熟悉功能包相关的话题,方便开发和使用
|
||||
## rm_control功能包使用
|
||||
### 功能包基础使用
|
||||
首先配置好环境完成连接后我们可以通过以下命令直接启动节点,运行rm_control功能包。
|
||||
```
|
||||
rm@rm-desktop:~$ ros2 launch rm_control rm_<arm_type>_control.launch.py
|
||||
```
|
||||
在实际使用时需要将以上的<arm_type>更换为实际的机械臂型号,可选择的机械臂型号有65、63、eco65、eco63、75、gen72。
|
||||
例如65机械臂的启动命令:
|
||||
```
|
||||
rm@rm-desktop:~$ ros2 launch rm_control rm_65_control.launch.py
|
||||
```
|
||||
节点启动成功后,将显示以下画面。
|
||||

|
||||
在单独启动该功能包的节点时并不发挥作用,需要结合rm_driver功能包和moveit2的相关节点一起使用才能发挥作用,详细请查看《rm_moveit2_config详解》相关内容。
|
||||
### 功能包进阶使用
|
||||
在rm_control功能包中也有一些参数可以进行配置,由于参数并不是很多,这边将参数直接在launch文件中进行了配置。
|
||||

|
||||
如上图所示第一个红框框出的位置为文件的路径,第二个框出的位置为当前可配置的参数。
|
||||
参数follow:代表当前透传使用的跟随模式,true:高跟随,false:低跟随。高跟随即机械臂运动方式与透传完全一致,需要根据透传的速率和机械臂的速度、加速度参数进行较详细的计算,使用门槛较高,但控制精细。低跟随即机械臂会基本根据透传速率和速度、加速度向透传点运动,若有来不及到达的点可能会有丢弃现象发生,使用门槛低,控制不太精细,但基本满足使用。
|
||||
参数arm_type:代表当前使用的机械臂型号,可以选择的参数有65(RM65系列)、651(ECO65系列)、634(ECO63系列)、632(63系列)、634(ECO63系列)、75(75系列)72(GEN72系列)。
|
||||
再实际使用时,我们选择对应的launch文件启动时会自动选择正确的型号,若有特殊要求可在此处进行相应的参数修改,修改之后需要在工作空间目录下进行重新编译,之后修改的配置才会生效。
|
||||
在工作空间目录运行colcon build指令。
|
||||
```
|
||||
rm@rm-desktop: ~/ros2_ws$ colcon build
|
||||
```
|
||||
编译成功后可按如上指令进行功能包启动。
|
||||
## rm_control功能包架构说明
|
||||
### 功能包文件总览
|
||||
当前rm_control功能包的文件构成如下。
|
||||
```
|
||||
├── CMakeLists.txt #编译规则文件
|
||||
├── doc #辅助文档、图片存放文件夹
|
||||
│ ├── rm_control1.png
|
||||
│ └── rm_control2.png
|
||||
├── include #依赖头文件文件夹
|
||||
│ ├── cubicSpline.h #三次样条插值头文件
|
||||
│ └── rm_control.h #rm_control头文件
|
||||
├── launch
|
||||
│ ├── rm_63_control.launch.py #63启动文件
|
||||
│ ├── rm_65_control.launch.py #65启动文件
|
||||
│ ├── rm_75_control.launch.py #75启动文件
|
||||
│ ├── rm_eco65_control.launch.py #eco65启动文件
|
||||
│ ├── rm_eco63_control.launch.py #eco63启动文件
|
||||
│ └── rm_gen72_control.launch.py #gen72启动文件
|
||||
├── package.xml #依赖声明文件
|
||||
├── README_CN.md
|
||||
├── README.md
|
||||
└── src
|
||||
└── rm_control.cpp #代码源文件
|
||||
```
|
||||
## rm_control话题说明
|
||||
如下为该功能包的话题说明。
|
||||
```
|
||||
Subscribers:
|
||||
/parameter_events: rcl_interfaces/msg/ParameterEvent
|
||||
/rm_driver/move_stop_cmd: std_msgs::msg::Bool
|
||||
Publishers:
|
||||
/parameter_events: rcl_interfaces/msg/ParameterEvent
|
||||
/rm_driver/movej_canfd_cmd: rm_ros_interfaces/msg/Jointpos
|
||||
/rosout: rcl_interfaces/msg/Log
|
||||
Service Servers:
|
||||
/rm_control/describe_parameters: rcl_interfaces/srv/DescribeParameters
|
||||
/rm_control/get_parameter_types: rcl_interfaces/srv/GetParameterTypes
|
||||
/rm_control/get_parameters: rcl_interfaces/srv/GetParameters
|
||||
/rm_control/list_parameters: rcl_interfaces/srv/ListParameters
|
||||
/rm_control/set_parameters: rcl_interfaces/srv/SetParameters
|
||||
/rm_control/set_parameters_atomically: rcl_interfaces/srv/SetParametersAtomically
|
||||
Service Clients:
|
||||
|
||||
Action Servers:
|
||||
/rm_group_controller/follow_joint_trajectory: control_msgs/action/FollowJointTrajectory
|
||||
Action Clients:
|
||||
```
|
||||
我们主要关注以下几个话题。
|
||||
Publishers:代表其当前发布的话题,其最主要发布的话题为/rm_driver/movej_canfd_cmd,我们通过该话题将细分后的点发布给rm_driver节点,rm_driver节点再通过透传的指令方式给到机械臂执行相对应的路径。
|
||||
Action Servers:代表其接受和发布的动作信息,/rm_group_controller/follow_joint_trajectory动作为rm_control与moveit2进行通信的桥梁,通过该动作rm_control接收到moveit2规划的路径,rm_control会将这些路径进行进一步细分由以上话题给到rm_driver。
|
||||
剩余话题和服务使用场景较少,这里不做详细介绍,大家可自行了解。
|
||||
|
After Width: | Height: | Size: 73 KiB |
|
After Width: | Height: | Size: 491 KiB |
@@ -0,0 +1,34 @@
|
||||
#ifndef _CUBIC_SPLINE_H_
|
||||
#define _CUBIC_SPLINE_H_
|
||||
// #define RAD_DEGREE 57.2958
|
||||
|
||||
class cubicSpline
|
||||
{
|
||||
public:
|
||||
typedef enum _BoundType
|
||||
{
|
||||
BoundType_First_Derivative,
|
||||
BoundType_Second_Derivative
|
||||
}BoundType;
|
||||
|
||||
public:
|
||||
cubicSpline();
|
||||
~cubicSpline();
|
||||
|
||||
void initParam();
|
||||
void releaseMem();
|
||||
|
||||
bool loadData(double *x_data, double *y_data, int count, double bound1, double bound2, BoundType type);
|
||||
bool getYbyX(double &x_in, double &y_out);
|
||||
|
||||
protected:
|
||||
bool spline(BoundType type);
|
||||
|
||||
protected:
|
||||
double *x_sample_, *y_sample_;
|
||||
double *M_;
|
||||
int sample_count_;
|
||||
double bound1_, bound2_;
|
||||
};
|
||||
|
||||
#endif /* _CUBIC_SPLINE_H_ */
|
||||
@@ -0,0 +1,58 @@
|
||||
#ifndef RM_CONTROL_H
|
||||
#define RM_CONTROL_H
|
||||
|
||||
#include "rclcpp/rclcpp.hpp"
|
||||
#include "rclcpp_action/rclcpp_action.hpp"
|
||||
|
||||
#include <iostream>
|
||||
#include "control_msgs/action/follow_joint_trajectory.hpp"
|
||||
#include <sensor_msgs/msg/joint_state.hpp>
|
||||
#include <std_msgs/msg/bool.hpp>
|
||||
|
||||
//RM Robot msg
|
||||
#include "rm_ros_interfaces/msg/jointpos.hpp"
|
||||
//#include "rm_ros_interfaces/msg/jointpos75.hpp"
|
||||
|
||||
/* 使用变长数组 */
|
||||
#include <vector>
|
||||
#include <algorithm>
|
||||
|
||||
using namespace std;
|
||||
|
||||
class Rm_Control : public rclcpp::Node
|
||||
{
|
||||
public:
|
||||
using FollowJointTrajectory = control_msgs::action::FollowJointTrajectory;
|
||||
using GoalHandleFJT = rclcpp_action::ServerGoalHandle<FollowJointTrajectory>;
|
||||
|
||||
explicit Rm_Control(std::string name);
|
||||
~Rm_Control(){}
|
||||
|
||||
void timer_callback();
|
||||
|
||||
private:
|
||||
rm_ros_interfaces::msg::Jointpos joint_msg;
|
||||
// rm_ros_interfaces::msg::Jointpos75 joint7_msg;
|
||||
int arm_type_ = 75;
|
||||
bool follow_ = false;
|
||||
// 实例化样条
|
||||
rclcpp_action::Server<FollowJointTrajectory>::SharedPtr action_server_;
|
||||
|
||||
// 声明话题发布者
|
||||
rclcpp::Publisher<rm_ros_interfaces::msg::Jointpos>::SharedPtr joint_pos_publisher;
|
||||
// rclcpp::Publisher<rm_ros_interfaces::msg::Jointpos75>::SharedPtr joint_pos_publisher_75;
|
||||
|
||||
//声明话题订阅者
|
||||
rclcpp::Subscription<std_msgs::msg::Bool>::SharedPtr Get_Move_Stop_Cmd;
|
||||
|
||||
rclcpp::TimerBase::SharedPtr State_Timer;
|
||||
|
||||
rclcpp_action::GoalResponse handle_goal(const rclcpp_action::GoalUUID &uuid, std::shared_ptr<const FollowJointTrajectory::Goal> goal);
|
||||
rclcpp_action::CancelResponse handle_cancel(const std::shared_ptr<GoalHandleFJT> goal_handle);
|
||||
void execute_move(const std::shared_ptr<GoalHandleFJT> goal_handle);
|
||||
void handle_accepted(const std::shared_ptr<GoalHandleFJT> goal_handle);
|
||||
void get_move_stop_callback(std_msgs::msg::Bool::SharedPtr msg);
|
||||
};
|
||||
|
||||
#endif // Rm_Control_H
|
||||
|
||||
@@ -0,0 +1,17 @@
|
||||
from launch import LaunchDescription
|
||||
from launch_ros.actions import Node
|
||||
def generate_launch_description():
|
||||
ld = LaunchDescription()
|
||||
control_node = Node(
|
||||
package='rm_control', #节点所在的功能包
|
||||
executable='rm_control', #表示要运行的可执行文件名或脚本名字.py
|
||||
parameters= [
|
||||
{'follow': False},
|
||||
{'arm_type': 632}
|
||||
], #接入参数文件
|
||||
output='screen', #用于将话题信息打印到屏幕
|
||||
)
|
||||
|
||||
ld.add_action(control_node)
|
||||
return ld
|
||||
|
||||
@@ -0,0 +1,17 @@
|
||||
from launch import LaunchDescription
|
||||
from launch_ros.actions import Node
|
||||
def generate_launch_description():
|
||||
ld = LaunchDescription()
|
||||
control_node = Node(
|
||||
package='rm_control', #节点所在的功能包
|
||||
executable='rm_control', #表示要运行的可执行文件名或脚本名字.py
|
||||
parameters= [
|
||||
{'follow': False},
|
||||
{'arm_type': 65}
|
||||
], #接入参数文件
|
||||
output='screen', #用于将话题信息打印到屏幕
|
||||
)
|
||||
|
||||
ld.add_action(control_node)
|
||||
return ld
|
||||
|
||||
@@ -0,0 +1,17 @@
|
||||
from launch import LaunchDescription
|
||||
from launch_ros.actions import Node
|
||||
def generate_launch_description():
|
||||
ld = LaunchDescription()
|
||||
control_node = Node(
|
||||
package='rm_control', #节点所在的功能包
|
||||
executable='rm_control', #表示要运行的可执行文件名或脚本名字.py
|
||||
parameters= [
|
||||
{'follow': True},
|
||||
{'arm_type': 75}
|
||||
], #接入参数文件
|
||||
output='screen', #用于将话题信息打印到屏幕
|
||||
)
|
||||
|
||||
ld.add_action(control_node)
|
||||
return ld
|
||||
|
||||
@@ -0,0 +1,17 @@
|
||||
from launch import LaunchDescription
|
||||
from launch_ros.actions import Node
|
||||
def generate_launch_description():
|
||||
ld = LaunchDescription()
|
||||
control_node = Node(
|
||||
package='rm_control', #节点所在的功能包
|
||||
executable='rm_control', #表示要运行的可执行文件名或脚本名字.py
|
||||
parameters= [
|
||||
{'follow': False},
|
||||
{'arm_type': 634}
|
||||
], #接入参数文件
|
||||
output='screen', #用于将话题信息打印到屏幕
|
||||
)
|
||||
|
||||
ld.add_action(control_node)
|
||||
return ld
|
||||
|
||||
@@ -0,0 +1,17 @@
|
||||
from launch import LaunchDescription
|
||||
from launch_ros.actions import Node
|
||||
def generate_launch_description():
|
||||
ld = LaunchDescription()
|
||||
control_node = Node(
|
||||
package='rm_control', #节点所在的功能包
|
||||
executable='rm_control', #表示要运行的可执行文件名或脚本名字.py
|
||||
parameters= [
|
||||
{'follow': False},
|
||||
{'arm_type': 651}
|
||||
], #接入参数文件
|
||||
output='screen', #用于将话题信息打印到屏幕
|
||||
)
|
||||
|
||||
ld.add_action(control_node)
|
||||
return ld
|
||||
|
||||
@@ -0,0 +1,17 @@
|
||||
from launch import LaunchDescription
|
||||
from launch_ros.actions import Node
|
||||
def generate_launch_description():
|
||||
ld = LaunchDescription()
|
||||
control_node = Node(
|
||||
package='rm_control', #节点所在的功能包
|
||||
executable='rm_control', #表示要运行的可执行文件名或脚本名字.py
|
||||
parameters= [
|
||||
{'follow': True},
|
||||
{'arm_type': 72}
|
||||
], #接入参数文件
|
||||
output='screen', #用于将话题信息打印到屏幕
|
||||
)
|
||||
|
||||
ld.add_action(control_node)
|
||||
return ld
|
||||
|
||||
23
HiveCoreR0/src/ros2_rm_robot-humble/rm_control/package.xml
Normal file
@@ -0,0 +1,23 @@
|
||||
<?xml version="1.0"?>
|
||||
<?xml-model href="http://download.ros.org/schema/package_format3.xsd" schematypens="http://www.w3.org/2001/XMLSchema"?>
|
||||
<package format="3">
|
||||
<name>rm_control</name>
|
||||
<version>0.0.0</version>
|
||||
<description>TODO: Package description</description>
|
||||
<maintainer email="2209099554@qq.com">xtark</maintainer>
|
||||
<license>TODO: License declaration</license>
|
||||
|
||||
<buildtool_depend>ament_cmake</buildtool_depend>
|
||||
|
||||
<depend>rclcpp</depend>
|
||||
<!-- <depend>std_msgs</depend>
|
||||
<depend>sensor_msgs</depend> -->
|
||||
<depend>rm_ros_interfaces</depend>
|
||||
|
||||
<test_depend>ament_lint_auto</test_depend>
|
||||
<test_depend>ament_lint_common</test_depend>
|
||||
|
||||
<export>
|
||||
<build_type>ament_cmake</build_type>
|
||||
</export>
|
||||
</package>
|
||||
@@ -0,0 +1,743 @@
|
||||
|
||||
//* ROS action server */
|
||||
#include "rm_control.h"
|
||||
/* 三次样条插补 */
|
||||
#include "cubicSpline.h"
|
||||
|
||||
using namespace std;
|
||||
vector<double> time_from_start_;
|
||||
vector<double> p_joint1_;
|
||||
vector<double> p_joint2_;
|
||||
vector<double> p_joint3_;
|
||||
vector<double> p_joint4_;
|
||||
vector<double> p_joint5_;
|
||||
vector<double> p_joint6_;
|
||||
vector<double> p_joint7_;
|
||||
vector<double> v_joint1_;
|
||||
vector<double> v_joint2_;
|
||||
vector<double> v_joint3_;
|
||||
vector<double> v_joint4_;
|
||||
vector<double> v_joint5_;
|
||||
vector<double> v_joint6_;
|
||||
vector<double> v_joint7_;
|
||||
vector<double> a_joint1_;
|
||||
vector<double> a_joint2_;
|
||||
vector<double> a_joint3_;
|
||||
vector<double> a_joint4_;
|
||||
vector<double> a_joint5_;
|
||||
vector<double> a_joint6_;
|
||||
vector<double> a_joint7_;
|
||||
|
||||
/* 存储的结构体 p2*/
|
||||
struct vel_data
|
||||
{
|
||||
int vector_len; //toatal num
|
||||
int vector_cnt; //current num
|
||||
};
|
||||
|
||||
/* 数据收发结构体 */
|
||||
struct vel_data p2;
|
||||
|
||||
/* action 服务端声明 */
|
||||
// typedef actionlib::SimpleActionServer<control_msgs::FollowJointTrajectoryAction> Server;
|
||||
|
||||
/* 初始化输入输出速度加速度 */
|
||||
double acc = 0, vel = 0;
|
||||
double x_out = 0, y_out = 0;
|
||||
|
||||
/* 判断路点数据是否改变 */
|
||||
bool point_changed = false;
|
||||
|
||||
/*三次样条插值后周期*/
|
||||
double rate = 0.020; // 5ms
|
||||
|
||||
float min_interval = 20; //透传周期,单位:秒
|
||||
float wait_move_finish_time = 1.5; //等待运动到位时间,单位:秒
|
||||
int count_keep_send = 0;
|
||||
int count_final_joint = 0;
|
||||
|
||||
/* 三次样条无参构造 */
|
||||
cubicSpline::cubicSpline()
|
||||
{
|
||||
}
|
||||
/* 析构 */
|
||||
cubicSpline::~cubicSpline()
|
||||
{
|
||||
releaseMem();
|
||||
}
|
||||
/* 初始化参数 */
|
||||
void cubicSpline::initParam()
|
||||
{
|
||||
x_sample_ = y_sample_ = M_ = NULL;
|
||||
sample_count_ = 0;
|
||||
bound1_ = bound2_ = 0;
|
||||
}
|
||||
/* 释放参数 */
|
||||
void cubicSpline::releaseMem()
|
||||
{
|
||||
delete x_sample_;
|
||||
delete y_sample_;
|
||||
delete M_;
|
||||
|
||||
initParam();
|
||||
}
|
||||
/* 加载关节位置数组等信息 */
|
||||
bool cubicSpline::loadData(double *x_data, double *y_data, int count, double bound1, double bound2, BoundType type)
|
||||
{
|
||||
if ((NULL == x_data) || (NULL == y_data) || (count < 3) || (type > BoundType_Second_Derivative) || (type < BoundType_First_Derivative))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
initParam();
|
||||
|
||||
x_sample_ = new double[count];
|
||||
y_sample_ = new double[count];
|
||||
M_ = new double[count];
|
||||
sample_count_ = count;
|
||||
|
||||
memcpy(x_sample_, x_data, sample_count_*sizeof(double));
|
||||
memcpy(y_sample_, y_data, sample_count_*sizeof(double));
|
||||
|
||||
bound1_ = bound1;
|
||||
bound2_ = bound2;
|
||||
|
||||
return spline(type);
|
||||
}
|
||||
/* 计算样条插值 */
|
||||
bool cubicSpline::spline(BoundType type)
|
||||
{
|
||||
if ((type < BoundType_First_Derivative) || (type > BoundType_Second_Derivative))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
// 追赶法解方程求二阶偏导数
|
||||
double f1=bound1_, f2=bound2_;
|
||||
|
||||
double *a=new double[sample_count_]; // a:稀疏矩阵最下边一串数
|
||||
double *b=new double[sample_count_]; // b:稀疏矩阵最中间一串数
|
||||
double *c=new double[sample_count_]; // c:稀疏矩阵最上边一串数
|
||||
double *d=new double[sample_count_];
|
||||
|
||||
double *f=new double[sample_count_];
|
||||
|
||||
double *bt=new double[sample_count_];
|
||||
double *gm=new double[sample_count_];
|
||||
|
||||
double *h=new double[sample_count_];
|
||||
|
||||
for(int i=0;i<sample_count_;i++)
|
||||
b[i]=2; // 中间一串数为2
|
||||
for(int i=0;i<sample_count_-1;i++)
|
||||
{
|
||||
if (x_sample_[i+1] == x_sample_[i])
|
||||
{
|
||||
h[i] = 0.005;
|
||||
}
|
||||
else
|
||||
{
|
||||
h[i]=x_sample_[i+1]-x_sample_[i]; // 各段步长
|
||||
}
|
||||
}
|
||||
for(int i=1;i<sample_count_-1;i++)
|
||||
a[i]=h[i-1]/(h[i-1]+h[i]);
|
||||
a[sample_count_-1]=1;
|
||||
|
||||
c[0]=1;
|
||||
for(int i=1;i<sample_count_-1;i++)
|
||||
c[i]=h[i]/(h[i-1]+h[i]);
|
||||
|
||||
for(int i=0;i<sample_count_-1;i++)
|
||||
{
|
||||
if (x_sample_[i+1] == x_sample_[i])
|
||||
{
|
||||
f[i]=(y_sample_[i+1]-y_sample_[i])/0.005;
|
||||
}
|
||||
else
|
||||
{
|
||||
f[i]=(y_sample_[i+1]-y_sample_[i])/(x_sample_[i+1]-x_sample_[i]);
|
||||
}
|
||||
}
|
||||
|
||||
for(int i=1;i<sample_count_-1;i++)
|
||||
d[i]=6*(f[i]-f[i-1])/(h[i-1]+h[i]);
|
||||
|
||||
// 追赶法求解方程
|
||||
if(BoundType_First_Derivative == type)
|
||||
{
|
||||
d[0]=6*(f[0]-f1)/h[0];
|
||||
d[sample_count_-1]=6*(f2-f[sample_count_-2])/h[sample_count_-2];
|
||||
|
||||
bt[0]=c[0]/b[0];
|
||||
for(int i=1;i<sample_count_-1;i++)
|
||||
bt[i]=c[i]/(b[i]-a[i]*bt[i-1]);
|
||||
|
||||
gm[0]=d[0]/b[0];
|
||||
for(int i=1;i<=sample_count_-1;i++)
|
||||
gm[i]=(d[i]-a[i]*gm[i-1])/(b[i]-a[i]*bt[i-1]);
|
||||
|
||||
M_[sample_count_-1]=gm[sample_count_-1];
|
||||
for(int i=sample_count_-2;i>=0;i--)
|
||||
M_[i]=gm[i]-bt[i]*M_[i+1];
|
||||
}
|
||||
else if(BoundType_Second_Derivative == type)
|
||||
{
|
||||
d[1]=d[1]-a[1]*f1;
|
||||
d[sample_count_-2]=d[sample_count_-2]-c[sample_count_-2]*f2;
|
||||
|
||||
bt[1]=c[1]/b[1];
|
||||
for(int i=2;i<sample_count_-2;i++)
|
||||
bt[i]=c[i]/(b[i]-a[i]*bt[i-1]);
|
||||
|
||||
gm[1]=d[1]/b[1];
|
||||
for(int i=2;i<=sample_count_-2;i++)
|
||||
gm[i]=(d[i]-a[i]*gm[i-1])/(b[i]-a[i]*bt[i-1]);
|
||||
|
||||
M_[sample_count_-2]=gm[sample_count_-2];
|
||||
for(int i=sample_count_-3;i>=1;i--)
|
||||
M_[i]=gm[i]-bt[i]*M_[i+1];
|
||||
|
||||
M_[0]=f1;
|
||||
M_[sample_count_-1]=f2;
|
||||
}
|
||||
else
|
||||
return false;
|
||||
|
||||
delete a;
|
||||
delete b;
|
||||
delete c;
|
||||
delete d;
|
||||
delete gm;
|
||||
delete bt;
|
||||
delete f;
|
||||
delete h;
|
||||
|
||||
return true;
|
||||
}
|
||||
/* 得到速度和加速度数组 */
|
||||
bool cubicSpline::getYbyX(double &x_in, double &y_out)
|
||||
{
|
||||
int klo,khi,k;
|
||||
klo=0;
|
||||
khi=sample_count_-1;
|
||||
double hh,bb,aa;
|
||||
|
||||
// 二分法查找x所在区间段
|
||||
while(khi-klo>1)
|
||||
{
|
||||
k=(khi+klo)>>1;
|
||||
if(x_sample_[k]>x_in)
|
||||
khi=k;
|
||||
else
|
||||
klo=k;
|
||||
}
|
||||
hh=x_sample_[khi]-x_sample_[klo];
|
||||
|
||||
aa=(x_sample_[khi]-x_in)/hh;
|
||||
bb=(x_in-x_sample_[klo])/hh;
|
||||
|
||||
y_out=aa*y_sample_[klo]+bb*y_sample_[khi]+((aa*aa*aa-aa)*M_[klo]+(bb*bb*bb-bb)*M_[khi])*hh*hh/6.0;
|
||||
|
||||
//test
|
||||
acc = (M_[klo]*(x_sample_[khi]-x_in) + M_[khi]*(x_in - x_sample_[klo])) / hh;
|
||||
vel = M_[khi]*(x_in - x_sample_[klo]) * (x_in - x_sample_[klo]) / (2 * hh)
|
||||
- M_[klo]*(x_sample_[khi]-x_in) * (x_sample_[khi]-x_in) / (2 * hh)
|
||||
+ (y_sample_[khi] - y_sample_[klo])/hh
|
||||
- hh*(M_[khi] - M_[klo])/6;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
Rm_Control::Rm_Control(std::string name) : Node(name)
|
||||
{
|
||||
|
||||
using namespace std::placeholders;
|
||||
|
||||
|
||||
this->declare_parameter<int>("arm_type", arm_type_);
|
||||
this->get_parameter("arm_type", arm_type_);
|
||||
|
||||
this->declare_parameter<bool>("follow", follow_);
|
||||
this->get_parameter("follow", follow_);
|
||||
|
||||
if((arm_type_ == 75)||(arm_type_ == 72))
|
||||
{
|
||||
joint_msg.joint.resize(7);
|
||||
joint_msg.dof = 7;
|
||||
arm_type_ = 75;
|
||||
}
|
||||
else
|
||||
{
|
||||
joint_msg.joint.resize(6);
|
||||
joint_msg.dof = 6;
|
||||
}
|
||||
|
||||
State_Timer = this->create_wall_timer(std::chrono::milliseconds(20),
|
||||
std::bind(&Rm_Control::timer_callback,this));
|
||||
|
||||
this->action_server_ = rclcpp_action::create_server<FollowJointTrajectory>(
|
||||
this, "/rm_group_controller/follow_joint_trajectory",
|
||||
std::bind(&Rm_Control::handle_goal, this, _1, _2),
|
||||
std::bind(&Rm_Control::handle_cancel, this, _1),
|
||||
std::bind(&Rm_Control::handle_accepted, this, _1));
|
||||
|
||||
rclcpp::QoS qos(10);
|
||||
|
||||
joint_pos_publisher = this->create_publisher<rm_ros_interfaces::msg::Jointpos>("/rm_driver/movej_canfd_cmd", qos);
|
||||
|
||||
Get_Move_Stop_Cmd = this->create_subscription<std_msgs::msg::Bool>("rm_driver/move_stop_cmd",rclcpp::ParametersQoS(),
|
||||
std::bind(&Rm_Control::get_move_stop_callback,this,std::placeholders::_1));
|
||||
|
||||
}
|
||||
|
||||
rclcpp_action::GoalResponse Rm_Control::handle_goal(const rclcpp_action::GoalUUID &uuid, std::shared_ptr<const FollowJointTrajectory::Goal> goal)
|
||||
{
|
||||
std::cout << "---handle goal:" << goal->trajectory.joint_names.size() << std::endl;
|
||||
std::cout << goal->trajectory.header.frame_id.c_str() << goal->trajectory.header.stamp.sec << goal->trajectory.header.stamp.nanosec << std::endl;
|
||||
|
||||
int pointSize = goal->trajectory.points.size();
|
||||
if(pointSize > 0)
|
||||
{
|
||||
for(int i = 0; i < pointSize; i++)
|
||||
{
|
||||
auto point = goal->trajectory.points.at(i);
|
||||
}
|
||||
}
|
||||
|
||||
(void)uuid;
|
||||
|
||||
return rclcpp_action::GoalResponse::ACCEPT_AND_EXECUTE;
|
||||
}
|
||||
|
||||
rclcpp_action::CancelResponse Rm_Control::handle_cancel(const std::shared_ptr<GoalHandleFJT> goal_handle)
|
||||
{
|
||||
RCLCPP_INFO(this->get_logger(), "Received request to cancel goal");
|
||||
|
||||
return rclcpp_action::CancelResponse::ACCEPT;
|
||||
}
|
||||
|
||||
void Rm_Control::handle_accepted(const std::shared_ptr<GoalHandleFJT> goal_handle)
|
||||
{
|
||||
using std::placeholders::_1;
|
||||
|
||||
std::thread{std::bind(&Rm_Control::execute_move, this, _1), goal_handle}
|
||||
.detach();
|
||||
}
|
||||
|
||||
/* 收到action的goal后调用的回调函数 */
|
||||
void Rm_Control::execute_move(const std::shared_ptr<GoalHandleFJT> goal_handle)
|
||||
{
|
||||
int i = 0;
|
||||
const auto goal = goal_handle->get_goal();
|
||||
auto result = std::make_shared<FollowJointTrajectory::Result>();
|
||||
int point_num = goal->trajectory.points.size();
|
||||
RCLCPP_INFO(this->get_logger(), "First Move_group give us %d points",point_num);
|
||||
point_changed = false;
|
||||
|
||||
/***********Start gubs 2021/9/16 修复Moveit在同一位姿重复规划执行导致rm_contorl异常停止的Bug***********/
|
||||
if (point_num > 3) //判断当moveit规划的路点数大于3时为有效规划并进行三次样条插值
|
||||
{
|
||||
|
||||
/* 各个关节位置 */
|
||||
double p_joint1[point_num];
|
||||
double p_joint2[point_num];
|
||||
double p_joint3[point_num];
|
||||
double p_joint4[point_num];
|
||||
double p_joint5[point_num];
|
||||
double p_joint6[point_num];
|
||||
double p_joint7[point_num];
|
||||
|
||||
/* 各个关节速度 */
|
||||
double v_joint1[point_num];
|
||||
double v_joint2[point_num];
|
||||
double v_joint3[point_num];
|
||||
double v_joint4[point_num];
|
||||
double v_joint5[point_num];
|
||||
double v_joint6[point_num];
|
||||
double v_joint7[point_num];
|
||||
|
||||
/* 各个关节加速度 */
|
||||
double a_joint1[point_num];
|
||||
double a_joint2[point_num];
|
||||
double a_joint3[point_num];
|
||||
double a_joint4[point_num];
|
||||
double a_joint5[point_num];
|
||||
double a_joint6[point_num];
|
||||
double a_joint7[point_num];
|
||||
|
||||
/* 时间数组 */
|
||||
double time_from_start[point_num];
|
||||
double timens_from_start[point_num];
|
||||
|
||||
for (i = 0; i < point_num; i++)
|
||||
{
|
||||
p_joint1[i] = goal->trajectory.points[i].positions[0];
|
||||
p_joint2[i] = goal->trajectory.points[i].positions[1];
|
||||
p_joint3[i] = goal->trajectory.points[i].positions[2];
|
||||
p_joint4[i] = goal->trajectory.points[i].positions[3];
|
||||
p_joint5[i] = goal->trajectory.points[i].positions[4];
|
||||
p_joint6[i] = goal->trajectory.points[i].positions[5];
|
||||
if(arm_type_ == 75)
|
||||
{
|
||||
p_joint7[i] = goal->trajectory.points[i].positions[6];
|
||||
}
|
||||
|
||||
|
||||
v_joint1[i] = goal->trajectory.points[i].velocities[0];
|
||||
v_joint2[i] = goal->trajectory.points[i].velocities[1];
|
||||
v_joint3[i] = goal->trajectory.points[i].velocities[2];
|
||||
v_joint4[i] = goal->trajectory.points[i].velocities[3];
|
||||
v_joint5[i] = goal->trajectory.points[i].velocities[4];
|
||||
v_joint6[i] = goal->trajectory.points[i].velocities[5];
|
||||
if(arm_type_ == 75)
|
||||
{
|
||||
v_joint7[i] = goal->trajectory.points[i].velocities[6];
|
||||
}
|
||||
|
||||
a_joint1[i] = goal->trajectory.points[i].accelerations[0];
|
||||
a_joint2[i] = goal->trajectory.points[i].accelerations[1];
|
||||
a_joint3[i] = goal->trajectory.points[i].accelerations[2];
|
||||
a_joint4[i] = goal->trajectory.points[i].accelerations[3];
|
||||
a_joint5[i] = goal->trajectory.points[i].accelerations[4];
|
||||
a_joint6[i] = goal->trajectory.points[i].accelerations[5];
|
||||
if(arm_type_ == 75)
|
||||
{
|
||||
a_joint7[i] = goal->trajectory.points[i].accelerations[6];
|
||||
}
|
||||
|
||||
time_from_start[i] = goal->trajectory.points[i].time_from_start.sec + goal->trajectory.points[i].time_from_start.nanosec/1e9;
|
||||
timens_from_start[i] = goal->trajectory.points[i].time_from_start.nanosec;
|
||||
|
||||
}
|
||||
cubicSpline spline;
|
||||
double max_time = time_from_start[point_num-1];
|
||||
RCLCPP_INFO(this->get_logger(), "Second Move_group max_time is %f", max_time);
|
||||
time_from_start_.clear();
|
||||
|
||||
// joint1
|
||||
if (spline.loadData(time_from_start, p_joint1, point_num, 0, 0, cubicSpline::BoundType_First_Derivative))
|
||||
{
|
||||
p_joint1_.clear();
|
||||
v_joint1_.clear();
|
||||
a_joint1_.clear();
|
||||
x_out = -rate;
|
||||
while(x_out < max_time) {
|
||||
x_out += rate;
|
||||
spline.getYbyX(x_out, y_out);
|
||||
time_from_start_.push_back(x_out); // 将新的时间存储,只需操作一次即可
|
||||
p_joint1_.push_back(y_out);
|
||||
v_joint1_.push_back(vel);
|
||||
a_joint1_.push_back(acc);
|
||||
}
|
||||
|
||||
// joint2
|
||||
if (spline.loadData(time_from_start, p_joint2, point_num, 0, 0, cubicSpline::BoundType_First_Derivative))
|
||||
{
|
||||
|
||||
p_joint2_.clear();
|
||||
v_joint2_.clear();
|
||||
a_joint2_.clear();
|
||||
x_out = -rate;
|
||||
while(x_out < max_time) {
|
||||
x_out += rate;
|
||||
spline.getYbyX(x_out, y_out);
|
||||
p_joint2_.push_back(y_out);
|
||||
v_joint2_.push_back(vel);
|
||||
a_joint2_.push_back(acc);
|
||||
}
|
||||
|
||||
// joint3
|
||||
if (spline.loadData(time_from_start, p_joint3, point_num, 0, 0, cubicSpline::BoundType_First_Derivative))
|
||||
{
|
||||
p_joint3_.clear();
|
||||
v_joint3_.clear();
|
||||
a_joint3_.clear();
|
||||
x_out = -rate;
|
||||
while(x_out < max_time) {
|
||||
x_out += rate;
|
||||
spline.getYbyX(x_out, y_out);
|
||||
p_joint3_.push_back(y_out);
|
||||
v_joint3_.push_back(vel);
|
||||
a_joint3_.push_back(acc);
|
||||
}
|
||||
|
||||
// joint4
|
||||
if (spline.loadData(time_from_start, p_joint4, point_num, 0, 0, cubicSpline::BoundType_First_Derivative))
|
||||
{
|
||||
p_joint4_.clear();
|
||||
v_joint4_.clear();
|
||||
a_joint4_.clear();
|
||||
x_out = -rate;
|
||||
while(x_out < max_time) {
|
||||
x_out += rate;
|
||||
spline.getYbyX(x_out, y_out);
|
||||
p_joint4_.push_back(y_out);
|
||||
v_joint4_.push_back(vel);
|
||||
a_joint4_.push_back(acc);
|
||||
}
|
||||
|
||||
// joint5
|
||||
if (spline.loadData(time_from_start, p_joint5, point_num, 0, 0, cubicSpline::BoundType_First_Derivative))
|
||||
{
|
||||
p_joint5_.clear();
|
||||
v_joint5_.clear();
|
||||
a_joint5_.clear();
|
||||
x_out = -rate;
|
||||
while(x_out < max_time) {
|
||||
x_out += rate;
|
||||
spline.getYbyX(x_out, y_out);
|
||||
p_joint5_.push_back(y_out);
|
||||
v_joint5_.push_back(vel);
|
||||
a_joint5_.push_back(acc);
|
||||
}
|
||||
|
||||
// joint6
|
||||
if (spline.loadData(time_from_start, p_joint6, point_num, 0, 0, cubicSpline::BoundType_First_Derivative))
|
||||
{
|
||||
p_joint6_.clear();
|
||||
v_joint6_.clear();
|
||||
a_joint6_.clear();
|
||||
x_out = -rate;
|
||||
while(x_out < max_time) {
|
||||
x_out += rate;
|
||||
spline.getYbyX(x_out, y_out);
|
||||
p_joint6_.push_back(y_out);
|
||||
v_joint6_.push_back(vel);
|
||||
a_joint6_.push_back(acc);
|
||||
}
|
||||
|
||||
// joint7
|
||||
if(arm_type_ == 75)
|
||||
{
|
||||
if (spline.loadData(time_from_start, p_joint7, point_num, 0, 0, cubicSpline::BoundType_First_Derivative))
|
||||
{
|
||||
p_joint7_.clear();
|
||||
v_joint7_.clear();
|
||||
a_joint7_.clear();
|
||||
x_out = -rate;
|
||||
while(x_out < max_time) {
|
||||
x_out += rate;
|
||||
spline.getYbyX(x_out, y_out);
|
||||
p_joint7_.push_back(y_out);
|
||||
v_joint7_.push_back(vel);
|
||||
a_joint7_.push_back(acc);
|
||||
}
|
||||
|
||||
|
||||
p2.vector_len = time_from_start_.size();
|
||||
p2.vector_cnt = 0;
|
||||
|
||||
point_changed = true;
|
||||
//等待定时器将数据取出并发送完
|
||||
while(point_changed)
|
||||
{
|
||||
// ros::WallDuration(0.002).sleep();
|
||||
if (!rclcpp::ok() || goal_handle->is_canceling())
|
||||
{
|
||||
result->error_code = -1;
|
||||
result->error_string = "has cancel";
|
||||
goal_handle->canceled(result);
|
||||
RCLCPP_INFO(this->get_logger(), "Goal Canceled");
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
p2.vector_len = time_from_start_.size();
|
||||
p2.vector_cnt = 0;
|
||||
|
||||
point_changed = true;
|
||||
//等待定时器将数据取出并发送完
|
||||
while(point_changed)
|
||||
{
|
||||
// ros::WallDuration(0.002).sleep();
|
||||
if (!rclcpp::ok() || goal_handle->is_canceling())
|
||||
{
|
||||
result->error_code = -1;
|
||||
result->error_string = "has cancel";
|
||||
goal_handle->canceled(result);
|
||||
RCLCPP_INFO(this->get_logger(), "Goal Canceled");
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
else if (point_num > 0)
|
||||
{
|
||||
p_joint1_.clear();
|
||||
v_joint1_.clear();
|
||||
a_joint1_.clear();
|
||||
p_joint2_.clear();
|
||||
v_joint2_.clear();
|
||||
a_joint2_.clear();
|
||||
p_joint3_.clear();
|
||||
v_joint3_.clear();
|
||||
a_joint3_.clear();
|
||||
p_joint4_.clear();
|
||||
v_joint4_.clear();
|
||||
a_joint4_.clear();
|
||||
p_joint5_.clear();
|
||||
v_joint5_.clear();
|
||||
a_joint5_.clear();
|
||||
p_joint6_.clear();
|
||||
v_joint6_.clear();
|
||||
a_joint6_.clear();
|
||||
if(arm_type_ == 75)
|
||||
{
|
||||
p_joint7_.clear();
|
||||
v_joint7_.clear();
|
||||
a_joint7_.clear();
|
||||
}
|
||||
for (int i = 0; i < point_num; i++) {
|
||||
p_joint1_.push_back(goal->trajectory.points[i].positions[0]);
|
||||
v_joint1_.push_back(goal->trajectory.points[i].velocities[0]);
|
||||
a_joint1_.push_back(goal->trajectory.points[i].accelerations[0]);
|
||||
p_joint2_.push_back(goal->trajectory.points[i].positions[1]);
|
||||
v_joint2_.push_back(goal->trajectory.points[i].velocities[1]);
|
||||
a_joint2_.push_back(goal->trajectory.points[i].accelerations[1]);
|
||||
p_joint3_.push_back(goal->trajectory.points[i].positions[2]);
|
||||
v_joint3_.push_back(goal->trajectory.points[i].velocities[2]);
|
||||
a_joint3_.push_back(goal->trajectory.points[i].accelerations[2]);
|
||||
p_joint4_.push_back(goal->trajectory.points[i].positions[3]);
|
||||
v_joint4_.push_back(goal->trajectory.points[i].velocities[3]);
|
||||
a_joint4_.push_back(goal->trajectory.points[i].accelerations[3]);
|
||||
p_joint5_.push_back(goal->trajectory.points[i].positions[4]);
|
||||
v_joint5_.push_back(goal->trajectory.points[i].velocities[4]);
|
||||
a_joint5_.push_back(goal->trajectory.points[i].accelerations[4]);
|
||||
p_joint6_.push_back(goal->trajectory.points[i].positions[5]);
|
||||
v_joint6_.push_back(goal->trajectory.points[i].velocities[5]);
|
||||
a_joint6_.push_back(goal->trajectory.points[i].accelerations[5]);
|
||||
if(arm_type_ == 75)
|
||||
{
|
||||
p_joint7_.push_back(goal->trajectory.points[i].positions[6]);
|
||||
v_joint7_.push_back(goal->trajectory.points[i].velocities[6]);
|
||||
a_joint7_.push_back(goal->trajectory.points[i].accelerations[6]);
|
||||
}
|
||||
}
|
||||
p2.vector_len = point_num;
|
||||
p2.vector_cnt = 0;
|
||||
|
||||
point_changed = true;
|
||||
//等待定时器将数据取出并发送完
|
||||
while(point_changed)
|
||||
{
|
||||
// ros::WallDuration(0.002).sleep();
|
||||
if (!rclcpp::ok() || goal_handle->is_canceling())
|
||||
{
|
||||
result->error_code = -1;
|
||||
result->error_string = "has cancel";
|
||||
goal_handle->canceled(result);
|
||||
RCLCPP_INFO(this->get_logger(), "Goal Canceled");
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
result->error_code = 0;
|
||||
result->error_string = "";
|
||||
|
||||
goal_handle->succeed(result);
|
||||
RCLCPP_INFO(this->get_logger(), "Goal Succeeded");
|
||||
}
|
||||
|
||||
void Rm_Control::timer_callback()
|
||||
{
|
||||
|
||||
joint_msg.follow = follow_;
|
||||
|
||||
|
||||
if(point_changed)
|
||||
{
|
||||
if(p2.vector_cnt < p2.vector_len)
|
||||
{
|
||||
// RCLCPP_INFO(this->get_logger(), "Pos:[%f, %f, %f, %f, %f, %f]", p_joint1_.at(p2.vector_cnt), p_joint2_.at(p2.vector_cnt), p_joint3_.at(p2.vector_cnt), p_joint4_.at(p2.vector_cnt), p_joint5_.at(p2.vector_cnt), p_joint6_.at(p2.vector_cnt));
|
||||
if(arm_type_ == 75)
|
||||
{
|
||||
joint_msg.joint[0] = p_joint1_.at(p2.vector_cnt);
|
||||
joint_msg.joint[1] = p_joint2_.at(p2.vector_cnt);
|
||||
joint_msg.joint[2] = p_joint3_.at(p2.vector_cnt);
|
||||
joint_msg.joint[3] = p_joint4_.at(p2.vector_cnt);
|
||||
joint_msg.joint[4] = p_joint5_.at(p2.vector_cnt);
|
||||
joint_msg.joint[5] = p_joint6_.at(p2.vector_cnt);
|
||||
joint_msg.joint[6] = p_joint7_.at(p2.vector_cnt);
|
||||
this->joint_pos_publisher->publish(joint_msg);
|
||||
}
|
||||
else
|
||||
{
|
||||
joint_msg.joint[0] = p_joint1_.at(p2.vector_cnt);
|
||||
joint_msg.joint[1] = p_joint2_.at(p2.vector_cnt);
|
||||
joint_msg.joint[2] = p_joint3_.at(p2.vector_cnt);
|
||||
joint_msg.joint[3] = p_joint4_.at(p2.vector_cnt);
|
||||
joint_msg.joint[4] = p_joint5_.at(p2.vector_cnt);
|
||||
joint_msg.joint[5] = p_joint6_.at(p2.vector_cnt);
|
||||
this->joint_pos_publisher->publish(joint_msg);
|
||||
}
|
||||
|
||||
p2.vector_cnt++;
|
||||
}
|
||||
else
|
||||
{
|
||||
if(count_final_joint <= count_keep_send)
|
||||
{
|
||||
if(arm_type_ == 75)
|
||||
{
|
||||
joint_msg.joint[0] = p_joint1_.at(p2.vector_cnt-1);
|
||||
joint_msg.joint[1] = p_joint2_.at(p2.vector_cnt-1);
|
||||
joint_msg.joint[2] = p_joint3_.at(p2.vector_cnt-1);
|
||||
joint_msg.joint[3] = p_joint4_.at(p2.vector_cnt-1);
|
||||
joint_msg.joint[4] = p_joint5_.at(p2.vector_cnt-1);
|
||||
joint_msg.joint[5] = p_joint6_.at(p2.vector_cnt-1);
|
||||
joint_msg.joint[6] = p_joint7_.at(p2.vector_cnt-1);
|
||||
this->joint_pos_publisher->publish(joint_msg);
|
||||
}
|
||||
else
|
||||
{
|
||||
joint_msg.joint[0] = p_joint1_.at(p2.vector_cnt-1);
|
||||
joint_msg.joint[1] = p_joint2_.at(p2.vector_cnt-1);
|
||||
joint_msg.joint[2] = p_joint3_.at(p2.vector_cnt-1);
|
||||
joint_msg.joint[3] = p_joint4_.at(p2.vector_cnt-1);
|
||||
joint_msg.joint[4] = p_joint5_.at(p2.vector_cnt-1);
|
||||
joint_msg.joint[5] = p_joint6_.at(p2.vector_cnt-1);
|
||||
this->joint_pos_publisher->publish(joint_msg);
|
||||
}
|
||||
count_final_joint++;
|
||||
}
|
||||
else
|
||||
{
|
||||
count_final_joint = 0;
|
||||
p2.vector_cnt = 0;
|
||||
p2.vector_len = 0;
|
||||
point_changed = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void Rm_Control::get_move_stop_callback(const std_msgs::msg::Bool::SharedPtr msg)
|
||||
{
|
||||
bool result;
|
||||
result = msg->data;
|
||||
point_changed=false;
|
||||
//RCLCPP_INFO(this->get_logger(), "move stop is true!!! ");
|
||||
}
|
||||
/* 主函数主要用于动作订阅和套接字通信 */
|
||||
int main(int argc, char** argv)
|
||||
{
|
||||
rclcpp::init(argc, argv);
|
||||
count_keep_send = wait_move_finish_time / min_interval;
|
||||
rclcpp::spin(std::make_shared<Rm_Control>("rm_control"));
|
||||
rclcpp::shutdown();
|
||||
return 0;
|
||||
}
|
||||
@@ -0,0 +1,40 @@
|
||||
cmake_minimum_required(VERSION 3.5)
|
||||
project(rm_description)
|
||||
|
||||
# Default to C99
|
||||
if(NOT CMAKE_C_STANDARD)
|
||||
set(CMAKE_C_STANDARD 99)
|
||||
endif()
|
||||
|
||||
# Default to C++14
|
||||
if(NOT CMAKE_CXX_STANDARD)
|
||||
set(CMAKE_CXX_STANDARD 14)
|
||||
endif()
|
||||
|
||||
if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang")
|
||||
add_compile_options(-Wall -Wextra -Wpedantic)
|
||||
endif()
|
||||
|
||||
# find dependencies
|
||||
find_package(ament_cmake REQUIRED)
|
||||
# uncomment the following section in order to fill in
|
||||
# further dependencies manually.
|
||||
# find_package(<dependency> REQUIRED)
|
||||
|
||||
install(
|
||||
DIRECTORY launch urdf meshes
|
||||
DESTINATION share/${PROJECT_NAME}
|
||||
)
|
||||
|
||||
if(BUILD_TESTING)
|
||||
find_package(ament_lint_auto REQUIRED)
|
||||
# the following line skips the linter which checks for copyrights
|
||||
# uncomment the line when a copyright and license is not present in all source files
|
||||
#set(ament_cmake_copyright_FOUND TRUE)
|
||||
# the following line skips cpplint (only works in a git repo)
|
||||
# uncomment the line when this package is not in a git repo
|
||||
#set(ament_cmake_cpplint_FOUND TRUE)
|
||||
ament_lint_auto_find_test_dependencies()
|
||||
endif()
|
||||
|
||||
ament_package()
|
||||
236
HiveCoreR0/src/ros2_rm_robot-humble/rm_description/README.md
Normal file
@@ -0,0 +1,236 @@
|
||||
<div align="right">
|
||||
|
||||
[简体中文](https://github.com/RealManRobot/ros2_rm_robot/blob/humble/rm_description/README_CN.md)|[English](https://github.com/RealManRobot/ros2_rm_robot/blob/humble/rm_description/README.md)
|
||||
|
||||
</div>
|
||||
|
||||
<div align="center">
|
||||
|
||||
# RealMan Robot rm_description User Manual V1.4
|
||||
|
||||
RealMan Intelligent Technology (Beijing) Co., Ltd.
|
||||
|
||||
Revision History:
|
||||
|
||||
|No. | Date | Comment |
|
||||
| :---: | :----: | :---: |
|
||||
|V1.0 | 2/19/2024 | Draft |
|
||||
|V1.1 | 7/8 /2024 | Amend(Add GEN72 adapter files) |
|
||||
|V1.2 | 9/11 /2024| Amend(Add ECO63 adapter files) |
|
||||
|V1.3 | 25/12/2024| Amend(Add 63, 65, 75, ECO65 six-axis force adapter files and 63, 65, 75, ECO63, ECO65 integrated six-axis force adapter files) |
|
||||
|V1.4 |2025-4-7 |Amend(AddGEN72_II adapter files) |
|
||||
</div>
|
||||
|
||||
## Content
|
||||
* 1.[rm_description Package Description](#rm_description_Package_Description)
|
||||
* 2.[rm_description Package Use](#rm_description_Package_Use)
|
||||
* 3.[rm_description Package Architecture Description](#rm_description_Package_Architecture_Description)
|
||||
* 3.1[Overview of Package Files](#Overview_of_Package_Files)
|
||||
* 4.[rm_description Topic Description](#rm_description_Topic_Description)
|
||||
|
||||
## rm_description_Package_Description
|
||||
rm_description is a function package for displaying the robot model and TF transformation. Through this package, we can realize the linkage effect between a virtual robotic arm in a computer and a real robot arm in reality. In the moveit2 control, we also need the support of this package. This package is introduced in detail in the following aspects.
|
||||
* 1.Package use.
|
||||
* 2.Package architecture description.
|
||||
* 3.Package topic description.
|
||||
Through the introduction of the three parts, it can help you:
|
||||
* 1.Understand the package use.
|
||||
* 2.Familiar with the file structure and function of the package.
|
||||
* 3.Familiar with the topic related to the package for easy development and use.
|
||||
Source code address:https://github.com/RealManRobot/ros2_rm_robot.git.
|
||||
## rm_description_Package_Use
|
||||
First, after configuring the environment and completing the connection, we can directly start the node and run the rm_description package.
|
||||
```
|
||||
rm@rm-desktop:~$ ros2 launch rm_description rm_<arm_type>_display.launch.py
|
||||
```
|
||||
In practice, the above <arm_type> needs to be replaced by the actual model of the robotic arm. The available models of the robotic arm are 65, 63, eco65, eco63, 75, and gen72.
|
||||
|
||||
The command to start the six-axis force version of the manipulator is (note: eco63 is not available):
|
||||
```
|
||||
rm@rm-desktop:~$ ros2 launch rm_description rm_<arm_type>_6f_display.launch.py
|
||||
```
|
||||
The command to start the integrated six-axis force version of the manipulator is :
|
||||
```
|
||||
rm@rm-desktop:~$ ros2 launch rm_description rm_<arm_type>_6fb_display.launch.py
|
||||
```
|
||||
For example, the launch command of 65 robotic arm:
|
||||
```
|
||||
rm@rm-desktop:~$ ros2 launch rm_description rm_65_display.launch.py
|
||||
```
|
||||
The following screen appears in the interface after successful node startup.
|
||||

|
||||
Then we need to launch the rm_driver node.
|
||||
```
|
||||
rm@rm-desktop:~$ ros2 launch rm_driver rm_<arm_type>_driver.launch.py
|
||||
```
|
||||
After a successful launch, we can check the state of the robotic arm in rviz2. Run the following command to launch rviz2.
|
||||
```
|
||||
rm@rm-desktop:~$ rviz2
|
||||
```
|
||||
Open the robot model with the following configuration.
|
||||

|
||||
Find the corresponding configuration file under the rviz folder of the rm_description package.
|
||||

|
||||
After loading, you can see the current state of the robotic arm in the interface of rviz2.
|
||||

|
||||
## rm_description_Package_Architecture_Description
|
||||
### Overview_of_package_files
|
||||
The current rm_description package is composed of the following files.
|
||||
```
|
||||
├── CMakeLists.txt # compilation rule file
|
||||
├── launch
|
||||
│ ├── rm_63_6f_display.launch.py # 63 six-axis force launch file
|
||||
│ ├── rm_63_6fb_display.launch.py # 63 integrated six-axis force launch file
|
||||
│ ├── rm_63_display.launch.py # 63 launch file
|
||||
│ ├── rm_65_6f_display.launch.py # 65 six-axis force launch file
|
||||
│ ├── rm_65_6fb_display.launch.py # 65 integrated six-axis force launch file
|
||||
│ ├── rm_65_display.launch.py # 65 launch file
|
||||
│ ├── rm_75_6f_display.launch.py # 75 six-axis force launch file
|
||||
│ ├── rm_75_6fb_display.launch.py # 75 integrated six-axis force launch file
|
||||
│ ├── rm_75_display.launch.py # 75 launch file
|
||||
│ ├── rm_eco65_6f_display.launch.py # eco65 six-axis force launch file
|
||||
│ ├── rm_eco65_6fb_display.launch.py # eco65 integrated six-axis force launch file
|
||||
│ ├── rm_eco65_display.launch.py # eco65 launch file
|
||||
│ ├── rm_eco63_6fb_display.launch.py # eco63 integrated six-axis force launch file
|
||||
│ ├── rm_eco63_display.launch.py # eco63 launch file
|
||||
│ └── rm_gen72_display.launch.py # gen72 launch file
|
||||
├── meshes # model file storage folder
|
||||
│ ├── rm_63_arm #63 robotic arm model file storage folder
|
||||
│ │ ├── base_link.STL
|
||||
│ │ ├── link1.STL
|
||||
│ │ ├── link2.STL
|
||||
│ │ ├── link3.STL
|
||||
│ │ ├── link4.STL
|
||||
│ │ ├── link5.STL
|
||||
│ │ ├── link6_6f.STL
|
||||
│ │ ├── link6_6fb.STL
|
||||
│ │ └── link6.STL
|
||||
│ ├── rm_65_arm #65 robotic arm model file storage folder
|
||||
│ │ ├── base_link.STL
|
||||
│ │ ├── link1.STL
|
||||
│ │ ├── link2.STL
|
||||
│ │ ├── link3.STL
|
||||
│ │ ├── link4.STL
|
||||
│ │ ├── link5.STL
|
||||
│ │ ├── link6_6f.STL
|
||||
│ │ ├── link6_6fb.STL
|
||||
│ │ └── link6.STL
|
||||
│ ├── rm_75_arm #75 robotic arm model file storage folder
|
||||
│ │ ├── base_link.STL
|
||||
│ │ ├── link1.STL
|
||||
│ │ ├── link2.STL
|
||||
│ │ ├── link3.STL
|
||||
│ │ ├── link4.STL
|
||||
│ │ ├── link5.STL
|
||||
│ │ ├── link6.STL
|
||||
│ │ ├── link7_6f.STL
|
||||
│ │ ├── link7_6fb.STL
|
||||
│ │ └── link7.STL
|
||||
│ └── rm_eco65_arm #eco65 robotic arm model file storage folder
|
||||
│ │ ├── baselink.STL
|
||||
│ │ ├── Link1.STL
|
||||
│ │ ├── Link2.STL
|
||||
│ │ ├── Link3.STL
|
||||
│ │ ├── Link4.STL
|
||||
│ │ ├── Link5.STL
|
||||
│ │ ├── Link6_6f.STL
|
||||
│ │ ├── Link6_6fb.STL
|
||||
│ │ └── Link6.STL
|
||||
│ └── rm_eco63_arm #eco63 robotic arm model file storage folder
|
||||
│ │ ├── baselink.STL
|
||||
│ │ ├── Link1.STL
|
||||
│ │ ├── Link2.STL
|
||||
│ │ ├── Link3.STL
|
||||
│ │ ├── Link4.STL
|
||||
│ │ ├── Link5.STL
|
||||
│ │ ├── Link6_6fb.STL
|
||||
│ │ └── Link6.STL
|
||||
│ └── rm_gen72_arm #gen72 robotic arm model file storage folder
|
||||
│ ├── base_link.STL
|
||||
│ ├── Link1.STL
|
||||
│ ├── Link2.STL
|
||||
│ ├── Link3.STL
|
||||
│ ├── Link4.STL
|
||||
│ ├── Link5.STL
|
||||
│ ├── Link6.STL
|
||||
│ └── Link7.STL
|
||||
├── package.xml
|
||||
├── README_CN.md
|
||||
├── README.md
|
||||
├── rviz #rviz2 configuration file storage folder
|
||||
│ ├── rm_63.rviz
|
||||
│ ├── rm_65.rviz
|
||||
│ ├── rm_75.rviz
|
||||
│ └── rm_eco65.rviz
|
||||
│ └── rm_eco63.rviz
|
||||
│ └── rm_gen72.rviz
|
||||
├── textures
|
||||
└── urdf
|
||||
├── display_arm.rviz
|
||||
├── rm_65_6f.urdf #65 six-axis force urdf description file
|
||||
├── rm_65_6fb.urdf #65 integrated six-axis force urdf description file
|
||||
├── rm_65_description.csv
|
||||
├── rm_65_gazebo.urdf #65 gazebo simulation urdf description file
|
||||
├── rm_65_gazebo.urdf.xacro #65 gazebo simulation xacro description file
|
||||
├── rm_65.urdf #65 urdf description file
|
||||
├── rm_65.urdf.xacro #65 xacro description file
|
||||
├── rm_75_6f.urdf #75 six-axis force urdf description file
|
||||
├── rm_75_6fb.urdf #75 integrated six-axis force urdf description file
|
||||
├── rm_75_description.csv
|
||||
├── rm_75_gazebo.urdf #75 gazebo simulation urdf description file
|
||||
├── rm_75_gazebo.urdf.xacro #75 gazebo simulation xacro description file
|
||||
├── rm_75.urdf #75 urdf description file
|
||||
├── rm_75.urdf.xacro #75 xacro description file
|
||||
├── rm_eco65_6f.urdf #eco65 six-axis force urdf description file
|
||||
├── rm_eco65_6fb.urdf #eco65 integrated six-axis force urdf description file
|
||||
├── rm_eco65.csv
|
||||
├── rm_eco65_gazebo.urdf #eco65 gazebo simulation urdf description file
|
||||
├── rm_eco65_gazebo.urdf.xacro #eco65 gazebo simulation xacro description file
|
||||
├── rm_eco65.urdf #eco65 urdf description file
|
||||
├── rm_eco65.urdf.xacro #eco65 xacro description file
|
||||
├── rm_eco63_6fb.urdf #eco63 integrated six-axis force urdf description file
|
||||
├── rm_eco63.csv
|
||||
├── rm_eco63_gazebo.urdf #eco63 gazebo simulation urdf description file
|
||||
├── rm_eco63_gazebo.urdf.xacro #eco63 gazebo simulation xacro description file
|
||||
├── rm_eco63.urdf #eco63 urdf description file
|
||||
├── rm_eco63.urdf.xacro #eco63 xacro description file
|
||||
├── rm_gen72.csv
|
||||
├── rm_gen72_gazebo.urdf #gen72 gazebo simulation urdf description file
|
||||
├── rm_gen72.urdf #gen72 urdf description file
|
||||
├── rml_63_6f.urdf #63 six-axis force urdf description file
|
||||
├── rml_63_6fb.urdf #63 integrated six-axis force urdf description file
|
||||
├── rml_63_description.csv
|
||||
├── rml_63_gazebo.urdf #63 gazebo simulation urdf description file
|
||||
├── rml_63_gazebo.urdf.xacro #63 gazebo simulation xacro description file
|
||||
├── rml_63.urdf #63 urdf description file
|
||||
└── rml_63.urdf.xacro #63 xacro description file
|
||||
```
|
||||
## rm_description_Topic_Description
|
||||
The following is the topic description of the package.
|
||||
```
|
||||
Subscribers:
|
||||
/joint_states: sensor_msgs/msg/JointState
|
||||
/parameter_events: rcl_interfaces/msg/ParameterEvent
|
||||
Publishers:
|
||||
/parameter_events: rcl_interfaces/msg/ParameterEvent
|
||||
/robot_description: std_msgs/msg/String
|
||||
/rosout: rcl_interfaces/msg/Log
|
||||
/tf: tf2_msgs/msg/TFMessage
|
||||
/tf_static: tf2_msgs/msg/TFMessage
|
||||
Service Servers:
|
||||
/robot_state_publisher/describe_parameters: rcl_interfaces/srv/DescribeParameters
|
||||
/robot_state_publisher/get_parameter_types: rcl_interfaces/srv/GetParameterTypes
|
||||
/robot_state_publisher/get_parameters: rcl_interfaces/srv/GetParameters
|
||||
/robot_state_publisher/list_parameters: rcl_interfaces/srv/ListParameters
|
||||
/robot_state_publisher/set_parameters: rcl_interfaces/srv/SetParameters
|
||||
/robot_state_publisher/set_parameters_atomically: rcl_interfaces/srv/SetParametersAtomically
|
||||
Service Clients:
|
||||
|
||||
Action Servers:
|
||||
|
||||
Action Clients:
|
||||
```
|
||||
We mainly focus on the following topics.
|
||||
Subscribers: represents the topics it subscribes to, where /joint_states represents the current state of the robotic arm, which is published by our rm_driver package when running so that the model in rviz moves according to the actual state of the robotic arm.
|
||||
Publishers: represents the topics it currently publishes, where the most important published topics are /tf and /tf_static, which describe the coordinate transformation relationship between the joints of the robotic arm, namely TF transformation.
|
||||
There are relatively few remaining topics and service use scenarios and you can learn by yourself.
|
||||
232
HiveCoreR0/src/ros2_rm_robot-humble/rm_description/README_CN.md
Normal file
@@ -0,0 +1,232 @@
|
||||
<div align="right">
|
||||
|
||||
[简体中文](https://github.com/RealManRobot/ros2_rm_robot/blob/humble/rm_description/README_CN.md)|[English](https://github.com/RealManRobot/ros2_rm_robot/blob/humble/rm_description/README.md)
|
||||
|
||||
</div>
|
||||
|
||||
<div align="center">
|
||||
|
||||
# 睿尔曼机器人rm_description使用说明书V1.4
|
||||
|
||||
睿尔曼智能科技(北京)有限公司
|
||||
文件修订记录:
|
||||
|
||||
| 版本号| 时间 | 备注 |
|
||||
| :---: | :-----: | :---: |
|
||||
|V1.0 |2024-2-19 |拟制 |
|
||||
|V1.1 |2024-7-3 |修订(添加GEN72适配文件) |
|
||||
|V1.2 |2024-9-11 |修订(添加ECO63适配文件) |
|
||||
|V1.3 |2024-12-25 |修订(添加了63、65、75、ECO65的六维力适配文件,以及63、65、75、ECO63、ECO65的一体化六维力适配文件) |
|
||||
|V1.4 |2025-4-7 |修订(添加了GEN72_II适配文件) |
|
||||
|
||||
</div>
|
||||
|
||||
## 目录
|
||||
* 1.[rm_description功能包说明](#rm_description功能包说明)
|
||||
* 2.[rm_description功能包使用](#rm_description功能包使用)
|
||||
* 3.[rm_description功能包架构说明](#rm_description功能包架构说明)
|
||||
* 3.1[功能包文件总览](#功能包文件总览)
|
||||
* 4.[rm_description话题说明](#rm_description话题说明)
|
||||
|
||||
## rm_description功能包说明
|
||||
rm_description功能包为显示机器人模型和TF变换的功能包,通过该功能包,我们可以实现电脑中的虚拟机械臂与现实中的实际机械臂的联动的效果,在之后的moveit2的控制中我们也需要该功能包的支持。
|
||||
* 1.功能包使用。
|
||||
* 2.功能包架构说明。
|
||||
* 3.功能包话题说明。
|
||||
通过这三部分内容的介绍可以帮助大家:
|
||||
* 1.了解该功能包的使用。
|
||||
* 2.熟悉功能包中的文件构成及作用。
|
||||
* 3.熟悉功能包相关的话题,方便开发和使用
|
||||
## rm_description功能包使用
|
||||
首先配置好环境完成连接后我们可以通过以下命令直接启动节点,运行rm_description功能包。
|
||||
```
|
||||
rm@rm-desktop:~$ ros2 launch rm_description rm_<arm_type>_display.launch.py
|
||||
```
|
||||
在实际使用时需要将以上的<arm_type>更换为实际的机械臂型号,可选择的机械臂型号有65、63、eco65, eco63、75、gen72。
|
||||
启动六维力版本机械臂的命令为(注意:eco63不可用):
|
||||
```
|
||||
rm@rm-desktop:~$ ros2 launch rm_description rm_<arm_type>_6f_display.launch.py
|
||||
```
|
||||
启动一体化六维力版本机械臂的命令为:
|
||||
```
|
||||
rm@rm-desktop:~$ ros2 launch rm_description rm_<arm_type>_6fb_display.launch.py
|
||||
```
|
||||
例如65机械臂的启动命令:
|
||||
```
|
||||
rm@rm-desktop:~$ ros2 launch rm_description rm_65_display.launch.py
|
||||
```
|
||||
节点启动成功后,将显示以下画面。
|
||||

|
||||
之后我们还需要启动rm_driver节点。
|
||||
```
|
||||
rm@rm-desktop:~$ ros2 launch rm_driver rm_<arm_type>_driver.launch.py
|
||||
```
|
||||
启动成功后我们就可以在rviz2中,查看机械臂状态了,运行如下命令启动rviz2。
|
||||
```
|
||||
rm@rm-desktop:~$ rviz2
|
||||
```
|
||||
通过如下配置打开机器人模型。
|
||||

|
||||
在rm_description功能包的rviz文件夹下找到对应的配置文件。
|
||||

|
||||
加载后就可以在rviz2的界面中看到当前的机械臂状态了。
|
||||

|
||||
## rm_description功能包架构说明
|
||||
## 功能包文件总览
|
||||
当前rm_description功能包的文件构成如下。
|
||||
```
|
||||
├── CMakeLists.txt #编译规则文件
|
||||
├── launch
|
||||
│ ├── rm_63_6f_display.launch.py #63六维力启动文件
|
||||
│ ├── rm_63_6fb_display.launch.py #63一体化六维力启动文件
|
||||
│ ├── rm_63_display.launch.py #63启动文件
|
||||
│ ├── rm_65_6f_display.launch.py #65六维力启动文件
|
||||
│ ├── rm_65_6fb_display.launch.py #65一体化六维力启动文件
|
||||
│ ├── rm_65_display.launch.py #65启动文件
|
||||
│ ├── rm_75_6f_display.launch.py #75六维力启动文件
|
||||
│ ├── rm_75_6fb_display.launch.py #75一体化六维力启动文件
|
||||
│ ├── rm_75_display.launch.py #75启动文件
|
||||
│ ├── rm_eco63_6fb_display.launch.py #eco63一体化六维力启动文件
|
||||
│ ├── rm_eco63_display.launch.py #eco63启动文件
|
||||
│ ├── rm_eco65_6f_display.launch.py #eco65六维力启动文件
|
||||
│ ├── rm_eco65_6fb_display.launch.py #eco65一体化六维力启动文件
|
||||
│ ├── rm_eco65_display.launch.py #eco65启动文件
|
||||
│ └── rm_gen72_display.launch.py #gen72启动文件
|
||||
├── meshes #模型文件存放文件夹
|
||||
│ ├── rm_63_arm #63机械臂模型文件存放文件夹
|
||||
│ │ ├── base_link.STL
|
||||
│ │ ├── link1.STL
|
||||
│ │ ├── link2.STL
|
||||
│ │ ├── link3.STL
|
||||
│ │ ├── link4.STL
|
||||
│ │ ├── link5.STL
|
||||
│ │ ├── link6_6f.STL
|
||||
│ │ ├── link6_6fb.STL
|
||||
│ │ └── link6.STL
|
||||
│ ├── rm_65_arm #65机械臂模型文件存放文件夹
|
||||
│ │ ├── base_link.STL
|
||||
│ │ ├── link1.STL
|
||||
│ │ ├── link2.STL
|
||||
│ │ ├── link3.STL
|
||||
│ │ ├── link4.STL
|
||||
│ │ ├── link5.STL
|
||||
│ │ ├── link6_6f.STL
|
||||
│ │ ├── link6_6fb.STL
|
||||
│ │ └── link6.STL
|
||||
│ ├── rm_75_arm #75机械臂模型文件存放文件夹
|
||||
│ │ ├── base_link.STL
|
||||
│ │ ├── link1.STL
|
||||
│ │ ├── link2.STL
|
||||
│ │ ├── link3.STL
|
||||
│ │ ├── link4.STL
|
||||
│ │ ├── link5.STL
|
||||
│ │ ├── link6.STL
|
||||
│ │ ├── link7_6f.STL
|
||||
│ │ ├── link7_6fb.STL
|
||||
│ │ └── link7.STL
|
||||
│ └── rm_eco65_arm #eco65机械臂模型文件存放文件夹
|
||||
│ │ ├── baselink.STL
|
||||
│ │ ├── Link1.STL
|
||||
│ │ ├── Link2.STL
|
||||
│ │ ├── Link3.STL
|
||||
│ │ ├── Link4.STL
|
||||
│ │ ├── Link5.STL
|
||||
│ │ ├── Link6_6f.STL
|
||||
│ │ ├── Link6_6fb.STL
|
||||
│ │ └── Link6.STL
|
||||
│ └── rm_eco63_arm #eco63机械臂模型文件存放文件夹
|
||||
│ │ ├── baselink.STL
|
||||
│ │ ├── Link1.STL
|
||||
│ │ ├── Link2.STL
|
||||
│ │ ├── Link3.STL
|
||||
│ │ ├── Link4.STL
|
||||
│ │ ├── Link5.STL
|
||||
│ │ ├── Link6_6fb.STL
|
||||
│ │ └── Link6.STL
|
||||
│ └── rm_gen72_arm #gen72机械臂模型文件存放文件夹
|
||||
│ ├── base_link.STL
|
||||
│ ├── Link1.STL
|
||||
│ ├── Link2.STL
|
||||
│ ├── Link3.STL
|
||||
│ ├── Link4.STL
|
||||
│ ├── Link5.STL
|
||||
│ ├── Link6.STL
|
||||
│ └── Link7.STL
|
||||
├── package.xml
|
||||
├── rviz #rviz2配置文件存放文件夹
|
||||
│ ├── rm_63.rviz
|
||||
│ ├── rm_65.rviz
|
||||
│ ├── rm_75.rviz
|
||||
│ ├── rm_eco65.rviz
|
||||
│ ├── rm_eco63.rviz
|
||||
│ └── rm_gen72.rviz
|
||||
├── textures
|
||||
└── urdf
|
||||
├── display_arm.rviz
|
||||
├── rm_65_6f.urdf #65 六维力urdf描述文件
|
||||
├── rm_65_6fb.urdf #65 一体化六维力urdf描述文件
|
||||
├── rm_65_description.csv
|
||||
├── rm_65_gazebo.urdf #65 gazebo仿真urdf描述文件
|
||||
├── rm_65_gazebo.urdf.xacro #65 gazebo仿真xacro描述文件
|
||||
├── rm_65.urdf #65 urdf描述文件
|
||||
├── rm_65.urdf.xacro #65 xacro描述文件
|
||||
├── rm_75_6f.urdf #75 六维力urdf描述文件
|
||||
├── rm_75_6fb.urdf #75 一体化六维力urdf描述文件
|
||||
├── rm_75_description.csv
|
||||
├── rm_75_gazebo.urdf #75 gazebo仿真urdf描述文件
|
||||
├── rm_75_gazebo.urdf.xacro #75 gazebo仿真xacro描述文件
|
||||
├── rm_75.urdf #75 urdf描述文件
|
||||
├── rm_75.urdf.xacro #75 xacro描述文件
|
||||
├── rm_eco65_6f.urdf #eco65 六维力urdf描述文件
|
||||
├── rm_eco65_6fb.urdf #eco65 一体化六维力urdf描述文件
|
||||
├── rm_eco65.csv
|
||||
├── rm_eco65_gazebo.urdf #eco65 gazebo仿真urdf描述文件
|
||||
├── rm_eco65_gazebo.urdf.xacro #eco65 gazebo仿真xacro描述文件
|
||||
├── rm_eco65.urdf #eco65 urdf描述文件
|
||||
├── rm_eco65.urdf.xacro #eco65 xacro描述文件
|
||||
├── rm_eco63_6fb.urdf #eco63 一体化六维力urdf描述文件
|
||||
├── rm_eco63_gazebo.urdf #eco63 gazebo仿真urdf描述文件
|
||||
├── rm_eco63_gazebo.urdf.xacro #eco63 gazebo仿真xacro描述文件
|
||||
├── rm_eco63.csv
|
||||
├── rm_eco63.urdf #eco63 urdf描述文件
|
||||
├── rm_eco63.urdf.xacro #eco63 xacro描述文件
|
||||
├── rm_gen72.csv
|
||||
├── rm_gen72_gazebo.urdf #gen72gazebo仿真urdf描述文件
|
||||
├── rm_gen72.urdf #gen72 urdf描述文件
|
||||
├── rml_63_6f.urdf #63 六维力urdf描述文件
|
||||
├── rml_63_6fb.urdf #63 一体化六维力urdf描述文件
|
||||
├── rml_63_description.csv
|
||||
├── rml_63_gazebo.urdf #63 gazebo仿真urdf描述文件
|
||||
├── rml_63_gazebo.urdf.xacro #63 gazebo仿真xacro描述文件
|
||||
├── rml_63.urdf #63 urdf描述文件
|
||||
└── rml_63.urdf.xacro #63 xacro描述文件
|
||||
```
|
||||
## rm_description话题说明
|
||||
如下为该功能包的话题说明。
|
||||
```
|
||||
Subscribers:
|
||||
/joint_states: sensor_msgs/msg/JointState
|
||||
/parameter_events: rcl_interfaces/msg/ParameterEvent
|
||||
Publishers:
|
||||
/parameter_events: rcl_interfaces/msg/ParameterEvent
|
||||
/robot_description: std_msgs/msg/String
|
||||
/rosout: rcl_interfaces/msg/Log
|
||||
/tf: tf2_msgs/msg/TFMessage
|
||||
/tf_static: tf2_msgs/msg/TFMessage
|
||||
Service Servers:
|
||||
/robot_state_publisher/describe_parameters: rcl_interfaces/srv/DescribeParameters
|
||||
/robot_state_publisher/get_parameter_types: rcl_interfaces/srv/GetParameterTypes
|
||||
/robot_state_publisher/get_parameters: rcl_interfaces/srv/GetParameters
|
||||
/robot_state_publisher/list_parameters: rcl_interfaces/srv/ListParameters
|
||||
/robot_state_publisher/set_parameters: rcl_interfaces/srv/SetParameters
|
||||
/robot_state_publisher/set_parameters_atomically: rcl_interfaces/srv/SetParametersAtomically
|
||||
Service Clients:
|
||||
|
||||
Action Servers:
|
||||
|
||||
Action Clients:
|
||||
```
|
||||
我们主要关注以下几个话题。
|
||||
Subscribers:代表其订阅的话题,其中的/joint_states代表机械臂当前的状态,我们的rm_driver功能包运行时会发布该话题,这样rviz中的模型就会根据实际的机械臂状态进行运动。
|
||||
Publishers:代表其当前发布的话题,其最主要发布的话题为/tf和/tf_static,这两个话题描述了机械臂关节与关节之间的坐标变换关系,也就是TF变换。
|
||||
剩余话题和服务使用场景较少,大家可自行了解。
|
||||
@@ -0,0 +1 @@
|
||||
controller_joint_names: ['', 'joint1', 'joint2', 'joint3', 'joint4', 'joint5', 'joint6', ]
|
||||
@@ -0,0 +1 @@
|
||||
controller_joint_names: ['', 'joint1', 'joint2', 'joint3', 'joint4', 'joint5', 'joint6', ]
|
||||
|
After Width: | Height: | Size: 111 KiB |
|
After Width: | Height: | Size: 402 KiB |
|
After Width: | Height: | Size: 265 KiB |
|
After Width: | Height: | Size: 133 KiB |
@@ -0,0 +1,33 @@
|
||||
import os
|
||||
from ament_index_python.packages import get_package_share_directory
|
||||
from launch import LaunchDescription
|
||||
from launch.actions import DeclareLaunchArgument
|
||||
from launch_ros.actions import Node
|
||||
from launch.substitutions import Command, FindExecutable, LaunchConfiguration
|
||||
|
||||
import xacro
|
||||
|
||||
def generate_launch_description():
|
||||
# 声明参数 link6_type
|
||||
declare_link6_type_arg = DeclareLaunchArgument(
|
||||
'link6_type',
|
||||
default_value='Link6_6f',
|
||||
description='Type of link6'
|
||||
)
|
||||
|
||||
realman_xacro_file = os.path.join(get_package_share_directory('rm_description'), 'urdf',
|
||||
'rml_63.urdf.xacro')
|
||||
robot_description = Command(
|
||||
[FindExecutable(name='xacro'), ' ', realman_xacro_file,' ','link6_type:=',LaunchConfiguration('link6_type')])
|
||||
|
||||
return LaunchDescription([
|
||||
declare_link6_type_arg,
|
||||
Node(
|
||||
package='robot_state_publisher',
|
||||
executable='robot_state_publisher',
|
||||
name='robot_state_publisher',
|
||||
respawn=True,
|
||||
parameters=[{'robot_description': robot_description}],
|
||||
output='screen'
|
||||
)
|
||||
])
|
||||
@@ -0,0 +1,33 @@
|
||||
import os
|
||||
from ament_index_python.packages import get_package_share_directory
|
||||
from launch import LaunchDescription
|
||||
from launch.actions import DeclareLaunchArgument
|
||||
from launch_ros.actions import Node
|
||||
from launch.substitutions import Command, FindExecutable, LaunchConfiguration
|
||||
|
||||
import xacro
|
||||
|
||||
def generate_launch_description():
|
||||
# 声明参数 link6_type
|
||||
declare_link6_type_arg = DeclareLaunchArgument(
|
||||
'link6_type',
|
||||
default_value='Link6_6fb',
|
||||
description='Type of link6'
|
||||
)
|
||||
|
||||
realman_xacro_file = os.path.join(get_package_share_directory('rm_description'), 'urdf',
|
||||
'rml_63.urdf.xacro')
|
||||
robot_description = Command(
|
||||
[FindExecutable(name='xacro'), ' ', realman_xacro_file,' ','link6_type:=',LaunchConfiguration('link6_type')])
|
||||
|
||||
return LaunchDescription([
|
||||
declare_link6_type_arg,
|
||||
Node(
|
||||
package='robot_state_publisher',
|
||||
executable='robot_state_publisher',
|
||||
name='robot_state_publisher',
|
||||
respawn=True,
|
||||
parameters=[{'robot_description': robot_description}],
|
||||
output='screen'
|
||||
)
|
||||
])
|
||||
@@ -0,0 +1,26 @@
|
||||
import os
|
||||
from ament_index_python.packages import get_package_share_directory
|
||||
from launch import LaunchDescription
|
||||
from launch.actions import DeclareLaunchArgument
|
||||
from launch_ros.actions import Node
|
||||
from launch.substitutions import Command, FindExecutable, LaunchConfiguration
|
||||
|
||||
import xacro
|
||||
|
||||
def generate_launch_description():
|
||||
|
||||
realman_xacro_file = os.path.join(get_package_share_directory('rm_description'), 'urdf',
|
||||
'rml_63.urdf')
|
||||
robot_description = Command(
|
||||
[FindExecutable(name='xacro'), ' ', realman_xacro_file])
|
||||
|
||||
return LaunchDescription([
|
||||
Node(
|
||||
package='robot_state_publisher',
|
||||
executable='robot_state_publisher',
|
||||
name='robot_state_publisher',
|
||||
respawn=True,
|
||||
parameters=[{'robot_description': robot_description}],
|
||||
output='screen'
|
||||
)
|
||||
])
|
||||
@@ -0,0 +1,34 @@
|
||||
import os
|
||||
from ament_index_python.packages import get_package_share_directory
|
||||
from launch import LaunchDescription
|
||||
from launch.actions import DeclareLaunchArgument
|
||||
from launch_ros.actions import Node
|
||||
from launch.substitutions import Command, FindExecutable, LaunchConfiguration
|
||||
|
||||
import xacro
|
||||
|
||||
def generate_launch_description():
|
||||
|
||||
# 声明参数 link6_type
|
||||
declare_link6_type_arg = DeclareLaunchArgument(
|
||||
'link6_type',
|
||||
default_value='Link6_6f',
|
||||
description='Type of link6'
|
||||
)
|
||||
|
||||
realman_xacro_file = os.path.join(get_package_share_directory('rm_description'), 'urdf',
|
||||
'rm_65.urdf.xacro')
|
||||
robot_description = Command(
|
||||
[FindExecutable(name='xacro'), ' ', realman_xacro_file, ' ', 'link6_type:=', LaunchConfiguration('link6_type')])
|
||||
|
||||
return LaunchDescription([
|
||||
declare_link6_type_arg,
|
||||
Node(
|
||||
package='robot_state_publisher',
|
||||
executable='robot_state_publisher',
|
||||
name='robot_state_publisher',
|
||||
respawn=True,
|
||||
parameters=[{'robot_description': robot_description}],
|
||||
output='screen'
|
||||
)
|
||||
])
|
||||
@@ -0,0 +1,34 @@
|
||||
import os
|
||||
from ament_index_python.packages import get_package_share_directory
|
||||
from launch import LaunchDescription
|
||||
from launch.actions import DeclareLaunchArgument
|
||||
from launch_ros.actions import Node
|
||||
from launch.substitutions import Command, FindExecutable, LaunchConfiguration
|
||||
|
||||
import xacro
|
||||
|
||||
def generate_launch_description():
|
||||
|
||||
# 声明参数 link6_type
|
||||
declare_link6_type_arg = DeclareLaunchArgument(
|
||||
'link6_type',
|
||||
default_value='Link6_6fb',
|
||||
description='Type of link6'
|
||||
)
|
||||
|
||||
realman_xacro_file = os.path.join(get_package_share_directory('rm_description'), 'urdf',
|
||||
'rm_65.urdf.xacro')
|
||||
robot_description = Command(
|
||||
[FindExecutable(name='xacro'), ' ', realman_xacro_file, ' ', 'link6_type:=', LaunchConfiguration('link6_type')])
|
||||
|
||||
return LaunchDescription([
|
||||
declare_link6_type_arg,
|
||||
Node(
|
||||
package='robot_state_publisher',
|
||||
executable='robot_state_publisher',
|
||||
name='robot_state_publisher',
|
||||
respawn=True,
|
||||
parameters=[{'robot_description': robot_description}],
|
||||
output='screen'
|
||||
)
|
||||
])
|
||||
@@ -0,0 +1,26 @@
|
||||
import os
|
||||
from ament_index_python.packages import get_package_share_directory
|
||||
from launch import LaunchDescription
|
||||
from launch.actions import DeclareLaunchArgument
|
||||
from launch_ros.actions import Node
|
||||
from launch.substitutions import Command, FindExecutable, LaunchConfiguration
|
||||
|
||||
import xacro
|
||||
|
||||
def generate_launch_description():
|
||||
|
||||
realman_xacro_file = os.path.join(get_package_share_directory('rm_description'), 'urdf',
|
||||
'rm_65.urdf')
|
||||
robot_description = Command(
|
||||
[FindExecutable(name='xacro'), ' ', realman_xacro_file])
|
||||
|
||||
return LaunchDescription([
|
||||
Node(
|
||||
package='robot_state_publisher',
|
||||
executable='robot_state_publisher',
|
||||
name='robot_state_publisher',
|
||||
respawn=True,
|
||||
parameters=[{'robot_description': robot_description}],
|
||||
output='screen'
|
||||
)
|
||||
])
|
||||
@@ -0,0 +1,31 @@
|
||||
import os
|
||||
from ament_index_python.packages import get_package_share_directory
|
||||
from launch import LaunchDescription
|
||||
from launch.actions import DeclareLaunchArgument
|
||||
from launch_ros.actions import Node
|
||||
from launch.substitutions import Command, FindExecutable, LaunchConfiguration
|
||||
|
||||
import xacro
|
||||
|
||||
def generate_launch_description():
|
||||
# 声明参数 link7_type
|
||||
declare_link7_type_arg = DeclareLaunchArgument(
|
||||
'link7_type',
|
||||
default_value='Link7_6f',
|
||||
description='Type of link7'
|
||||
)
|
||||
realman_xacro_file = os.path.join(get_package_share_directory('rm_description'), 'urdf',
|
||||
'rm_75.urdf.xacro')
|
||||
robot_description = Command(
|
||||
[FindExecutable(name='xacro'), ' ', realman_xacro_file, ' ','link7_type:=', LaunchConfiguration('link7_type')])
|
||||
|
||||
return LaunchDescription([
|
||||
Node(
|
||||
package='robot_state_publisher',
|
||||
executable='robot_state_publisher',
|
||||
name='robot_state_publisher',
|
||||
respawn=True,
|
||||
parameters=[{'robot_description': robot_description}],
|
||||
output='screen'
|
||||
)
|
||||
])
|
||||
@@ -0,0 +1,32 @@
|
||||
import os
|
||||
from ament_index_python.packages import get_package_share_directory
|
||||
from launch import LaunchDescription
|
||||
from launch.actions import DeclareLaunchArgument
|
||||
from launch_ros.actions import Node
|
||||
from launch.substitutions import Command, FindExecutable, LaunchConfiguration
|
||||
|
||||
import xacro
|
||||
|
||||
def generate_launch_description():
|
||||
# 声明参数 link7_type
|
||||
declare_link7_type_arg = DeclareLaunchArgument(
|
||||
'link7_type',
|
||||
default_value='Link7_6fb',
|
||||
description='Type of link7'
|
||||
)
|
||||
realman_xacro_file = os.path.join(get_package_share_directory('rm_description'), 'urdf',
|
||||
'rm_75.urdf.xacro')
|
||||
robot_description = Command(
|
||||
[FindExecutable(name='xacro'), ' ', realman_xacro_file, ' ','link7_type:=', LaunchConfiguration('link7_type')])
|
||||
|
||||
return LaunchDescription([
|
||||
declare_link7_type_arg,
|
||||
Node(
|
||||
package='robot_state_publisher',
|
||||
executable='robot_state_publisher',
|
||||
name='robot_state_publisher',
|
||||
respawn=True,
|
||||
parameters=[{'robot_description': robot_description}],
|
||||
output='screen'
|
||||
)
|
||||
])
|
||||
@@ -0,0 +1,26 @@
|
||||
import os
|
||||
from ament_index_python.packages import get_package_share_directory
|
||||
from launch import LaunchDescription
|
||||
from launch.actions import DeclareLaunchArgument
|
||||
from launch_ros.actions import Node
|
||||
from launch.substitutions import Command, FindExecutable, LaunchConfiguration
|
||||
|
||||
import xacro
|
||||
|
||||
def generate_launch_description():
|
||||
|
||||
realman_xacro_file = os.path.join(get_package_share_directory('rm_description'), 'urdf',
|
||||
'rm_75.urdf')
|
||||
robot_description = Command(
|
||||
[FindExecutable(name='xacro'), ' ', realman_xacro_file])
|
||||
|
||||
return LaunchDescription([
|
||||
Node(
|
||||
package='robot_state_publisher',
|
||||
executable='robot_state_publisher',
|
||||
name='robot_state_publisher',
|
||||
respawn=True,
|
||||
parameters=[{'robot_description': robot_description}],
|
||||
output='screen'
|
||||
)
|
||||
])
|
||||
@@ -0,0 +1,32 @@
|
||||
import os
|
||||
from ament_index_python.packages import get_package_share_directory
|
||||
from launch import LaunchDescription
|
||||
from launch.actions import DeclareLaunchArgument
|
||||
from launch_ros.actions import Node
|
||||
from launch.substitutions import Command, FindExecutable, LaunchConfiguration
|
||||
|
||||
import xacro
|
||||
|
||||
def generate_launch_description():
|
||||
# 声明参数 link6_type
|
||||
declare_link6_type_arg = DeclareLaunchArgument(
|
||||
'link6_type',
|
||||
default_value='Link6_6fb',
|
||||
description='Type of link6'
|
||||
)
|
||||
realman_xacro_file = os.path.join(get_package_share_directory('rm_description'), 'urdf',
|
||||
'rm_eco63.urdf.xacro')
|
||||
robot_description = Command(
|
||||
[FindExecutable(name='xacro'), ' ', realman_xacro_file,' ','link6_type:=',LaunchConfiguration('link6_type')])
|
||||
|
||||
return LaunchDescription([
|
||||
declare_link6_type_arg,
|
||||
Node(
|
||||
package='robot_state_publisher',
|
||||
executable='robot_state_publisher',
|
||||
name='robot_state_publisher',
|
||||
respawn=True,
|
||||
parameters=[{'robot_description': robot_description}],
|
||||
output='screen'
|
||||
),
|
||||
])
|
||||
@@ -0,0 +1,26 @@
|
||||
import os
|
||||
from ament_index_python.packages import get_package_share_directory
|
||||
from launch import LaunchDescription
|
||||
from launch.actions import DeclareLaunchArgument
|
||||
from launch_ros.actions import Node
|
||||
from launch.substitutions import Command, FindExecutable, LaunchConfiguration
|
||||
|
||||
import xacro
|
||||
|
||||
def generate_launch_description():
|
||||
|
||||
realman_xacro_file = os.path.join(get_package_share_directory('rm_description'), 'urdf',
|
||||
'rm_eco63.urdf')
|
||||
robot_description = Command(
|
||||
[FindExecutable(name='xacro'), ' ', realman_xacro_file])
|
||||
|
||||
return LaunchDescription([
|
||||
Node(
|
||||
package='robot_state_publisher',
|
||||
executable='robot_state_publisher',
|
||||
name='robot_state_publisher',
|
||||
respawn=True,
|
||||
parameters=[{'robot_description': robot_description}],
|
||||
output='screen'
|
||||
),
|
||||
])
|
||||
@@ -0,0 +1,34 @@
|
||||
import os
|
||||
from ament_index_python.packages import get_package_share_directory
|
||||
from launch import LaunchDescription
|
||||
from launch.actions import DeclareLaunchArgument
|
||||
from launch_ros.actions import Node
|
||||
from launch.substitutions import Command, FindExecutable, LaunchConfiguration
|
||||
|
||||
import xacro
|
||||
|
||||
def generate_launch_description():
|
||||
|
||||
# 声明参数 link6_type
|
||||
declare_link6_type_arg = DeclareLaunchArgument(
|
||||
'link6_type',
|
||||
default_value='Link6_6f',
|
||||
description='Type of link6'
|
||||
)
|
||||
|
||||
realman_xacro_file = os.path.join(get_package_share_directory('rm_description'), 'urdf',
|
||||
'rm_eco65.urdf')
|
||||
robot_description = Command(
|
||||
[FindExecutable(name='xacro'), ' ', realman_xacro_file,' ','link6_type:=',LaunchConfiguration('link6_type')])
|
||||
|
||||
return LaunchDescription([
|
||||
declare_link6_type_arg,
|
||||
Node(
|
||||
package='robot_state_publisher',
|
||||
executable='robot_state_publisher',
|
||||
name='robot_state_publisher',
|
||||
respawn=True,
|
||||
parameters=[{'robot_description': robot_description}],
|
||||
output='screen'
|
||||
),
|
||||
])
|
||||
@@ -0,0 +1,34 @@
|
||||
import os
|
||||
from ament_index_python.packages import get_package_share_directory
|
||||
from launch import LaunchDescription
|
||||
from launch.actions import DeclareLaunchArgument
|
||||
from launch_ros.actions import Node
|
||||
from launch.substitutions import Command, FindExecutable, LaunchConfiguration
|
||||
|
||||
import xacro
|
||||
|
||||
def generate_launch_description():
|
||||
|
||||
# 声明参数 link6_type
|
||||
declare_link6_type_arg = DeclareLaunchArgument(
|
||||
'link6_type',
|
||||
default_value='Link6_6fb',
|
||||
description='Type of link6'
|
||||
)
|
||||
|
||||
realman_xacro_file = os.path.join(get_package_share_directory('rm_description'), 'urdf',
|
||||
'rm_eco65.urdf')
|
||||
robot_description = Command(
|
||||
[FindExecutable(name='xacro'), ' ', realman_xacro_file,' ','link6_type:=',LaunchConfiguration('link6_type')])
|
||||
|
||||
return LaunchDescription([
|
||||
declare_link6_type_arg,
|
||||
Node(
|
||||
package='robot_state_publisher',
|
||||
executable='robot_state_publisher',
|
||||
name='robot_state_publisher',
|
||||
respawn=True,
|
||||
parameters=[{'robot_description': robot_description}],
|
||||
output='screen'
|
||||
),
|
||||
])
|
||||
@@ -0,0 +1,26 @@
|
||||
import os
|
||||
from ament_index_python.packages import get_package_share_directory
|
||||
from launch import LaunchDescription
|
||||
from launch.actions import DeclareLaunchArgument
|
||||
from launch_ros.actions import Node
|
||||
from launch.substitutions import Command, FindExecutable, LaunchConfiguration
|
||||
|
||||
import xacro
|
||||
|
||||
def generate_launch_description():
|
||||
|
||||
realman_xacro_file = os.path.join(get_package_share_directory('rm_description'), 'urdf',
|
||||
'rm_eco65.urdf')
|
||||
robot_description = Command(
|
||||
[FindExecutable(name='xacro'), ' ', realman_xacro_file])
|
||||
|
||||
return LaunchDescription([
|
||||
Node(
|
||||
package='robot_state_publisher',
|
||||
executable='robot_state_publisher',
|
||||
name='robot_state_publisher',
|
||||
respawn=True,
|
||||
parameters=[{'robot_description': robot_description}],
|
||||
output='screen'
|
||||
),
|
||||
])
|
||||
@@ -0,0 +1,26 @@
|
||||
import os
|
||||
from ament_index_python.packages import get_package_share_directory
|
||||
from launch import LaunchDescription
|
||||
from launch.actions import DeclareLaunchArgument
|
||||
from launch_ros.actions import Node
|
||||
from launch.substitutions import Command, FindExecutable, LaunchConfiguration
|
||||
|
||||
import xacro
|
||||
|
||||
def generate_launch_description():
|
||||
|
||||
realman_xacro_file = os.path.join(get_package_share_directory('rm_description'), 'urdf',
|
||||
'rm_gen72_II.urdf')
|
||||
robot_description = Command(
|
||||
[FindExecutable(name='xacro'), ' ', realman_xacro_file])
|
||||
|
||||
return LaunchDescription([
|
||||
Node(
|
||||
package='robot_state_publisher',
|
||||
executable='robot_state_publisher',
|
||||
name='robot_state_publisher',
|
||||
respawn=True,
|
||||
parameters=[{'robot_description': robot_description}],
|
||||
output='screen'
|
||||
)
|
||||
])
|
||||