【ros2 control 机器人驱动开发】双关节多控制器机器人学习-example 6

前言

本篇文章在上篇文章的基础上主要讲解双轴机器人驱动怎么编写双轴机器各个轴风别用不同的驱动器控制,实际应用场景可能是机器人地轨与机械臂控制器是两个控制单元,需要分别实现底层驱动控制。

对于Hardware Interfaces常见接口可见《ROS2 Control hardware_interface说明》

一、创建controller相关

cd ~/ros2_control_demos

ros2 pkg create --build-type ament_cmake ros2_control_demo_example_6

# 文件结构
$ tree ros2_control_demo_example_6
ros2_control_demo_example_6
├── CMakeLists.txt
├── bringup
│   ├── config
│   │   └── rrbot_modular_actuators.yaml
│   └── launch
│       └── rrbot_modular_actuators.launch.py
├── description
│   ├── launch
│   │   └── view_robot.launch.py
│   ├── ros2_control
│   │   └── rrbot_modular_actuators.ros2_control.xacro
│   └── urdf
│       └── rrbot_modular_actuators.urdf.xacro
├── hardware
│   ├── include
│   │   └── ros2_control_demo_example_6
│   │       ├── rrbot_actuator.hpp
│   │       └── visibility_control.h
│   └── rrbot_actuator.cpp
├── package.xml
└── ros2_control_demo_example_6.xml

10 directories, 11 files
<?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>ros2_control_demo_example_6</name>
  <version>0.0.0</version>
  <description>TODO: Package description</description>
  <maintainer email="[email protected]">Bing Lee</maintainer>
  <url type="website">https://blog.csdn.net/Bing_Lee</url>
  <license>TODO: License declaration</license>

  <buildtool_depend>ament_cmake</buildtool_depend>

  <depend>hardware_interface</depend>
  <depend>pluginlib</depend>
  <depend>rclcpp</depend>
  <depend>rclcpp_lifecycle</depend>

  <exec_depend>controller_manager</exec_depend>
  <exec_depend>forward_command_controller</exec_depend>
  <exec_depend>joint_state_broadcaster</exec_depend>
  <exec_depend>joint_state_publisher_gui</exec_depend>
  <exec_depend>robot_state_publisher</exec_depend>
  <exec_depend
03-09 07:52