< >
Home » OpenManipulator-X入门教程 » OpenManipulator机械臂入门教程-舵机检测

OpenManipulator机械臂入门教程-舵机检测

说明

  • 介绍如何在PC连上OpenManipulator机械臂后进行舵机检测

操作步骤

  • 首先连接上机械臂和OpenCR板,同时用电源线供电给OpenCR板,再用usb数据线连接PC和OpenCR板

  • 查看端口是否存在,同时为端口添加权限

$ ls /dev/ttyACM0
$ sudo chmod a+rw /dev/ttyACM0

注:如果使用U2D2连接PC和OpenManipulator机械臂,其端口为/dev/ttyUSB@(@为端口号);但若使用的是OpenCR,则端口为/dev/ttyACM@,如/dev/ttyACM0

  • 检测舵机是否连接
$ rosrun dynamixel_workbench_controllers find_dynamixel /dev/ttyACM0
[ INFO] [1552462788.529875515]: Succeed to init(9600)
[ INFO] [1552462788.529920006]: Wait for scanning...
[ INFO] [1552462810.312049099]: Find 0 Dynamixels
[ INFO] [1552462810.312687345]: Succeed to init(57600)
[ INFO] [1552462810.312744155]: Wait for scanning...
[ INFO] [1552462828.345327435]: Find 0 Dynamixels
[ INFO] [1552462828.345742917]: Succeed to init(115200)
[ INFO] [1552462828.345779356]: Wait for scanning...
[ INFO] [1552462846.004015407]: Find 0 Dynamixels
[ INFO] [1552462846.004563964]: Succeed to init(1000000)
[ INFO] [1552462846.004600281]: Wait for scanning...
[ INFO] [1552462863.170552974]: Find 5 Dynamixels
[ INFO] [1552462863.170630409]: id : 1, model name : XM430-W350
[ INFO] [1552462863.170664650]: id : 2, model name : XM430-W350
[ INFO] [1552462863.170689940]: id : 3, model name : XM430-W350
[ INFO] [1552462863.170716421]: id : 4, model name : XM430-W350
[ INFO] [1552462863.170739894]: id : 5, model name : XM430-W350
[ INFO] [1552462863.171516050]: Succeed to init(2000000)
[ INFO] [1552462863.171570620]: Wait for scanning...
[ INFO] [1552462880.476509572]: Find 0 Dynamixels
[ INFO] [1552462880.477389330]: Succeed to init(3000000)
[ INFO] [1552462880.477443347]: Wait for scanning...
[ INFO] [1552462897.779664422]: Find 0 Dynamixels
[ INFO] [1552462897.780424593]: Succeed to init(4000000)
[ INFO] [1552462897.780511258]: Wait for scanning...
[ INFO] [1552462915.078663649]: Find 0 Dynamixels

注:但若找不到Dynamixel ID,请使用相关软件(R+ Manager 2.0 or R+ Manager 1.0)检查 Dynamixel舵机的固件

  • Dynamixel ID的默认ID:11,12,13,14,15,前四个为关节ID,15为抓手ID。如果检测到的Dynamixel ID不是默认的ID,那么需要在rosed open_manipulator_libs包的 open_manipulator.cpp文件修改默认ID

  • 修改rosed open_manipulator_libs包的 open_manipulator.cpp文件

$ rosed open_manipulator_libs open_manipulator.cpp
  • 使用OpenCR连接PC和机械臂,则需要修改open_manipulator_controller.launch文件中的dynamixel_usb_port 参数值
$ rosed open_manipulator_controller open_manipulator_controller.launch
  • open_manipulator_controller.launch文件中的相关参数:

    • use_robot_name: a parameter to set manipulator name(namespace of ROS messages)
    • dynamixel_usb_port: a parameter to set use port to connected with Dynamixel of OpenManipulator. If you use U2D2, it should be set /dev/ttyUSB@. If you use OpenCR, it should be set /dev/ttyACM@ (@ indicates the port number connected to the Dynamixel).
    • dynamixel_baud_rate: a parameter to set baud rate of dynamixel. default baud rate of dynamixel used in OpenManipulator is 1000000.
    • control_period: a parameter to set communication period between dynamixel and PC (control loop time).
      use_platform is a parameter that sets whether to use the actual OpenManipulator or OpenManipulator simulation. please refer Gazebo Simulation chapter.
    • use_platform:a parameter that sets whether to use the actual OpenManipulator or OpenManipulator simulation. please refer Gazebo Simulation chapter.
    • use_moveit,planning_group_name,moveit_sample_duration:parameters supposed to set loading move_group package. please refer MoveIt! chapter.

NOTE: open_manipulator_controller is compatible with Protocol 2.0. Since Protocol 1.0 doesn't support SyncRead instructions that has access to multiple Dynamixels simultaneously. Protocol 2.0 supports MX2, X and Pro series, but it does not support AX, RX and EX.

  • 机械臂测试

  • 建议启动机械臂前请将机械臂手动设置以下姿势,以避免启动后出现无法控制的问题

请输入图片描述

  • 启动机械臂
$ roslaunch open_manipulator_controller open_manipulator_controller.launch usb_port:=/dev/ttyACM0
SUMMARY
========

PARAMETERS
 * /open_manipulator/control_period: 0.01
 * /open_manipulator/moveit_sample_duration: 0.05
 * /open_manipulator/planning_group_name: arm
 * /open_manipulator/using_moveit: False
 * /open_manipulator/using_platform: True
 * /rosdistro: kinetic
 * /rosversion: 1.12.14

NODES
  /
    open_manipulator (open_manipulator_controller/open_manipulator_controller)

ROS_MASTER_URI=http://localhost:11311

process[open_manipulator-1]: started with pid [23452]
Joint Dynamixel ID : 1, Model Name : XM430-W350
Joint Dynamixel ID : 2, Model Name : XM430-W350
Joint Dynamixel ID : 3, Model Name : XM430-W350
Joint Dynamixel ID : 4, Model Name : XM430-W350
Gripper Dynamixel ID : 5, Model Name :XM430-W350
[ INFO] [1544509070.096942788]: Succeeded to init /open_manipulator
  • 打开RViz,RViz中的模型将会与实际机器人同步
$ roslaunch open_manipulator_description open_manipulator_rviz.launch

请输入图片描述

  • 检查设置,查看机械臂的当前状态
$ rostopic pub /open_manipulator/option std_msgs/String "print_open_manipulator_setting"
##在启动机械臂的终端上会输出以下信息
    ----------<Manipulator Description>----------
<Degree of freedom>
 4.000
<Size of Components>
 5.000

<Configuration of world>
 [Name]
 -World Name : world
 -Child Name : joint1
 [Static Pose]
 -Position :
(0.000, 0.000, 0.000)
 -Orientation :
(1.000, 0.000, 0.000
 0.000, 1.000, 0.000
 0.000, 0.000, 1.000)
 [Dynamic Pose]
 -Linear Velocity :
(0.000, 0.000, 0.000)
 -Linear acceleration :
(0.000, 0.000, 0.000)
 -Angular Velocity :
(0.000, 0.000, 0.000)
 -Angular acceleration :
(0.000, 0.000, 0.000)

<Configuration of gripper>
 [Component Type]
  Tool
 [Name]
 -Parent Name : joint4
 [Actuator]
 -Actuator Name : tool_dxl
 -ID :  15
 -Joint Axis :
(0.000, 0.000, 0.000)
 -Coefficient :  -0.015
 -Limit :
    Maximum : 0.010, Minimum : -0.010
 [Actuator Value]
 -Value :  0.008
 -Velocity :  0.000
 -Acceleration :  0.000
 -Effort :  0.000
 [Constant]
 -Relative Position from parent component :
(0.130, 0.000, 0.000)
 -Relative Orientation from parent component :
(1.000, 0.000, 0.000
 0.000, 1.000, 0.000
 0.000, 0.000, 1.000)
 -Mass :  0.000
 -Inertia Tensor :
(1.000, 0.000, 0.000
 0.000, 1.000, 0.000
 0.000, 0.000, 1.000)
 -Center of Mass :
(0.000, 0.000, 0.000)
 [Variable]
 -Position :
(0.138, -0.005, 0.015)
 -Orientation :
(-0.006, 0.043, 0.999
 0.000, 0.999, -0.043
 -1.000, 0.000, -0.006)
 -Linear Velocity :
(0.000, 0.000, 0.000)
 -Linear acceleration :
(0.000, 0.000, 0.000)
 -Angular Velocity :
(0.000, 0.000, 0.000)
 -Angular acceleration :
(0.000, 0.000, 0.000)

<Configuration of joint1>
 [Component Type]
  Active Joint
 [Name]
 -Parent Name : world
 -Child Name 1 : joint2
 [Actuator]
 -Actuator Name : joint_dxl
 -ID :  11
 -Joint Axis :
(0.000, 0.000, 1.000)
 -Coefficient :  1.000
 -Limit :
    Maximum : 3.142, Minimum : -3.142
 [Actuator Value]
 -Value :  -0.043
 -Velocity :  0.000
 -Acceleration :  0.000
 -Effort :  0.000
 [Constant]
 -Relative Position from parent component :
(0.012, 0.000, 0.017)
 -Relative Orientation from parent component :
(1.000, 0.000, 0.000
 0.000, 1.000, 0.000
 0.000, 0.000, 1.000)
 -Mass :  0.000
 -Inertia Tensor :
(1.000, 0.000, 0.000
 0.000, 1.000, 0.000
 0.000, 0.000, 1.000)
 -Center of Mass :
(0.000, 0.000, 0.000)
 [Variable]
 -Position :
(0.012, 0.000, 0.017)
 -Orientation :
(0.999, 0.043, 0.000
 -0.043, 0.999, 0.000
 0.000, 0.000, 1.000)
 -Linear Velocity :
(0.000, 0.000, 0.000)
 -Linear acceleration :
(0.000, 0.000, 0.000)
 -Angular Velocity :
(0.000, 0.000, 0.000)
 -Angular acceleration :
(0.000, 0.000, 0.000)

<Configuration of joint2>
 [Component Type]
  Active Joint
 [Name]
 -Parent Name : joint1
 -Child Name 1 : joint3
 [Actuator]
 -Actuator Name : joint_dxl
 -ID :  12
 -Joint Axis :
(0.000, 1.000, 0.000)
 -Coefficient :  1.000
 -Limit :
    Maximum : 1.571, Minimum : -2.050
 [Actuator Value]
 -Value :  -0.052
 -Velocity :  0.000
 -Acceleration :  0.000
 -Effort :  0.000
 [Constant]
 -Relative Position from parent component :
(0.000, 0.000, 0.058)
 -Relative Orientation from parent component :
(1.000, 0.000, 0.000
 0.000, 1.000, 0.000
 0.000, 0.000, 1.000)
 -Mass :  0.000
 -Inertia Tensor :
(1.000, 0.000, 0.000
 0.000, 1.000, 0.000
 0.000, 0.000, 1.000)
 -Center of Mass :
(0.000, 0.000, 0.000)
 [Variable]
 -Position :
(0.012, 0.000, 0.075)
 -Orientation :
(0.998, 0.043, -0.052
 -0.043, 0.999, 0.002
 0.052, 0.000, 0.999)
 -Linear Velocity :
(0.000, 0.000, 0.000)
 -Linear acceleration :
(0.000, 0.000, 0.000)
 -Angular Velocity :
(0.000, 0.000, 0.000)
 -Angular acceleration :
(0.000, 0.000, 0.000)

<Configuration of joint3>
 [Component Type]
  Active Joint
 [Name]
 -Parent Name : joint2
 -Child Name 1 : joint4
 [Actuator]
 -Actuator Name : joint_dxl
 -ID :  13
 -Joint Axis :
(0.000, 1.000, 0.000)
 -Coefficient :  1.000
 -Limit :
    Maximum : 1.530, Minimum : -1.571
 [Actuator Value]
 -Value :  0.546
 -Velocity :  0.000
 -Acceleration :  0.000
 -Effort :  0.000
 [Constant]
 -Relative Position from parent component :
(0.024, 0.000, 0.128)
 -Relative Orientation from parent component :
(1.000, 0.000, 0.000
 0.000, 1.000, 0.000
 0.000, 0.000, 1.000)
 -Mass :  0.000
 -Inertia Tensor :
(1.000, 0.000, 0.000
 0.000, 1.000, 0.000
 0.000, 0.000, 1.000)
 -Center of Mass :
(0.000, 0.000, 0.000)
 [Variable]
 -Position :
(0.029, -0.001, 0.204)
 -Orientation :
(0.880, 0.043, 0.474
 -0.038, 0.999, -0.020
 -0.474, 0.000, 0.880)
 -Linear Velocity :
(0.000, 0.000, 0.000)
 -Linear acceleration :
(0.000, 0.000, 0.000)
 -Angular Velocity :
(0.000, 0.000, 0.000)
 -Angular acceleration :
(0.000, 0.000, 0.000)

<Configuration of joint4>
 [Component Type]
  Active Joint
 [Name]
 -Parent Name : joint3
 -Child Name 1 : gripper
 [Actuator]
 -Actuator Name : joint_dxl
 -ID :  14
 -Joint Axis :
(0.000, 1.000, 0.000)
 -Coefficient :  1.000
 -Limit :
    Maximum : 2.000, Minimum : -1.800
 [Actuator Value]
 -Value :  1.083
 -Velocity :  0.000
 -Acceleration :  0.000
 -Effort :  -2.690
 [Constant]
 -Relative Position from parent component :
(0.124, 0.000, 0.000)
 -Relative Orientation from parent component :
(1.000, 0.000, 0.000
 0.000, 1.000, 0.000
 0.000, 0.000, 1.000)
 -Mass :  0.000
 -Inertia Tensor :
(1.000, 0.000, 0.000
 0.000, 1.000, 0.000
 0.000, 0.000, 1.000)
 -Center of Mass :
(0.000, 0.000, 0.000)
 [Variable]
 -Position :
(0.138, -0.005, 0.145)
 -Orientation :
(-0.006, 0.043, 0.999
 0.000, 0.999, -0.043
 -1.000, 0.000, -0.006)
 -Linear Velocity :
(0.000, 0.000, 0.000)
 -Linear acceleration :
(0.000, 0.000, 0.000)
 -Angular Velocity :
(0.000, 0.000, 0.000)
 -Angular acceleration :
(0.000, 0.000, 0.000)
---------------------------------------------

演示视频

纠错,疑问,交流: 请进入讨论区点击加入Q群

获取最新文章: 扫一扫右上角的二维码加入“创客智造”公众号


标签: openmanipulator 机械臂入门教程