【ros2 control 机器人驱动开发】简单双关节机器人学习-example 1

文章目录

前言

一、RR机器人

创建description pkg

创建demos pkg

二、创建controller相关

创建example pkg

三、测试运行

测试forward_command_controller

测试joint_trajectory_controller

总结

前言

本系列文件主要有以下目标和内容:

为系统、传感器和执行器创建 HardwareInterface

以URDF文件的形式创建机器人描述

加载配置并使用启动文件启动机器人

控制RRBot的两个关节(两旋转关节机器人)

六自由度机器人的控制

实现机器人的控制器切换策略

使用 ros2_control 中的关节限制和传输概念

一、RR机器人

RRBot( Revolute-Revolute Manipulator Robot)是一个简单的3连杆,2关节的机械臂,我们将使用它来演示各种功能。

它本质上是一个双倒立摆,并在模拟器中演示了一些有趣的控制概念,最初是为Gazebo教程介绍的。1

创建description pkg

这里主要是完成机器人描述文件的创建,各个轴的物理尺寸、模型信息,各个轴的关节链接方式、链接点。

mkdir ~/ros2_control_demos

cd ~/ros2_control_demos

ros2 pkg create --build-type ament_cmake ros2_control_demo_description

# 文件结构

$ tree ros2_control_demo_description/

ros2_control_demo_description/

├── CMakeLists.txt

├── package.xml

└── rrbot

├── rviz

│ └── rrbot.rviz

└── urdf

├── rrbot.materials.xacro

└── rrbot_description.urdf.xacro

# CMakeLists.txt

cmake_minimum_required(VERSION 3.8)

project(ros2_control_demo_description)

# find dependencies

find_package(ament_cmake REQUIRED)

install(

DIRECTORY rrbot/urdf rrbot/rviz

DESTINATION share/${PROJECT_NAME}/rrbot

)

ament_package()

# packages.xml

ros2_control_demo_description

0.0.0

TODO: Package description

Bing_Lee

https://blog.csdn.net/Bing_Lee

TODO: License declaration

ament_cmake

joint_state_publisher_gui

robot_state_publisher

rviz2

ament_cmake

# rrbot.rviz

Panels:

- Class: rviz_common/Displays

Help Height: 87

Name: Displays

Property Tree Widget:

Expanded: ~

Splitter Ratio: 0.5

Tree Height: 1096

- Class: rviz_common/Selection

Name: Selection

- Class: rviz_common/Tool Properties

Expanded:

- /2D Goal Pose1

- /Publish Point1

Name: Tool Properties

Splitter Ratio: 0.5886790156364441

- Class: rviz_common/Views

Expanded:

- /Current View1

Name: Views

Splitter Ratio: 0.5

Visualization Manager:

Class: ""

Displays:

- Alpha: 0.5

Cell Size: 1

Class: rviz_default_plugins/Grid

Color: 160; 160; 164

Enabled: true

Line Style:

Line Width: 0.029999999329447746

Value: Lines

Name: Grid

Normal Cell Count: 0

Offset:

X: 0

Y: 0

Z: 0

Plane: XY

Plane Cell Count: 10

Reference Frame:

Value: true

- Alpha: 1

Class: rviz_default_plugins/RobotModel

Collision Enabled: false

Description File: ""

Description Source: Topic

Description Topic:

Depth: 5

Durability Policy: Volatile

History Policy: Keep Last

Reliability Policy: Reliable

Value: /robot_description

Enabled: true

Links:

All Links Enabled: true

Expand Joint Details: false

Expand Link Details: false

Expand Tree: false

Link Tree Style: Links in Alphabetic Order

base_link:

Alpha: 1

Show Axes: false

Show Trail: false

Value: true

camera_link:

Alpha: 1

Show Axes: false

Show Trail: false

Value: true

camera_link_optical:

Alpha: 1

Show Axes: false

Show Trail: false

hokuyo_link:

Alpha: 1

Show Axes: false

Show Trail: false

Value: true

link1:

Alpha: 1

Show Axes: false

Show Trail: false

Value: true

link2:

Alpha: 1

Show Axes: false

Show Trail: false

Value: true

tool_link:

Alpha: 1

Show Axes: false

Show Trail: false

world:

Alpha: 1

Show Axes: false

Show Trail: false

Mass Properties:

Inertia: false

Mass: false

Name: RobotModel

TF Prefix: ""

Update Interval: 0

Value: true

Visual Enabled: true

Enabled: true

Global Options:

Background Color: 48; 48; 48

Fixed Frame: base_link

Frame Rate: 30

Name: root

Tools:

- Class: rviz_default_plugins/Interact

Hide Inactive Objects: true

- Class: rviz_default_plugins/MoveCamera

- Class: rviz_default_plugins/Select

- Class: rviz_default_plugins/FocusCamera

- Class: rviz_default_plugins/Measure

Line color: 128; 128; 0

- Class: rviz_default_plugins/SetInitialPose

Covariance x: 0.25

Covariance y: 0.25

Covariance yaw: 0.06853891909122467

Topic:

Depth: 5

Durability Policy: Volatile

History Policy: Keep Last

Reliability Policy: Reliable

Value: /initialpose

- Class: rviz_default_plugins/SetGoal

Topic:

Depth: 5

Durability Policy: Volatile

History Policy: Keep Last

Reliability Policy: Reliable

Value: /goal_pose

- Class: rviz_default_plugins/PublishPoint

Single click: true

Topic:

Depth: 5

Durability Policy: Volatile

History Policy: Keep Last

Reliability Policy: Reliable

Value: /clicked_point

Transformation:

Current:

Class: rviz_default_plugins/TF

Value: true

Views:

Current:

Class: rviz_default_plugins/Orbit

Distance: 8.443930625915527

Enable Stereo Rendering:

Stereo Eye Separation: 0.05999999865889549

Stereo Focal Distance: 1

Swap Stereo Eyes: false

Value: false

Focal Point:

X: 0.0044944556429982185

Y: 1.0785865783691406

Z: 2.4839563369750977

Focal Shape Fixed Size: true

Focal Shape Size: 0.05000000074505806

Invert Z Axis: false

Name

好文推荐

评论可见,请评论后查看内容,谢谢!!!
 您阅读本篇文章共花了: