参考:
- 【ROBOTIS DYNAMIXEL 快速使用指南】 ROS 1:https://www.bilibili.com/video/BV1944y1y7Qc
- 【ROBOTIS DYNAMIXEL 快速使用指南】 C++:https://www.bilibili.com/video/BV1Sf4y1P7h5
- 【ROBOTIS DYNAMIXEL 快速使用指南】 Python:https://www.bilibili.com/video/BV1Lb4y127q6
- 【ROBOTIS DYNAMIXEL 快速使用指南】 MATLAB on Linux:https://www.bilibili.com/video/BV1pq4y1D7fW
DYNAMIXEL Starter Set Quick Start :DYNAMIXEL Wizard 20 Software:https://www.bilibili.com/video/BV1EU4y147eA
01 硬件连接
电源等连接关系:
方式1 | 方式2 | 方式3 |
---|---|---|
02 Windows使用
- 使用DYNAMIXEL Wizard 2.0
下载地址:http://en.robotis.com/service/downloadpage.php?ca_id=10
- 软件使用参考下图:
注意:需要在电源开启下,才能找到需要的COM口
注意:
串联的多个舵机,需要id不同,如果id相同,需要每次单独连接一个舵机,修改为id不同
03 ROS使用
-
S1:创建工作空间,下载SDK
mkdir -p am_ws/src cd am_ws catkin_make
cd ~/am_ws/src git clone https://github.com/ROBOTIS-GIT/DynamixelSDK.git cd .. catkin_make
workbench下载:
git clone https://github.com/ROBOTIS-GIT/dynamixel-workbench.git
git clone https://github.com/ROBOTIS-GIT/dynamixel-workbench-msgs.git
-
S2:修改USB口权限
ls /dev/tty* sudo chmod 666 /dev/ttyUSB0
说明:
第一次运行下一步报下述错误,重启重新运行就好了
/opt/ros/melodic/bin/rosrun: 行 56: /dev/null: 权限不够
[rosrun] Couldn't find executable named read_write below /home/guyue/am_ws/src/DynamixelSDK/ros/dynamixel_sdk_examples
-
S3:运行示例
roscore
rosrun dynamixel_sdk_examples read_write_node.py
说明:
运行rosrun dynamixel_sdk_examples read_write_node
报错:
[ERROR] [1648868048.885886683]: Failed to enable torque for Dynamixel ID 2
所以我运行的是.py文件 -
S4:驱动舵机&状态查看
目前启动的话题和服务为:guyue@guyue:~$ rostopic list /rosout /rosout_agg /set_position guyue@guyue:~$ rosservice list /get_position /read_write_py_node/get_loggers /read_write_py_node/set_logger_level /rosout/get_loggers /rosout/set_logger_level
-
驱动舵机
guyue@guyue:~$ rostopic pub -1 /set_position dynamixel_sdk_examples/SetPosition "{id: 1,position: 100}" publishing and latching message for 3.0 seconds
说明:
rostopic pub -1 [话题名] [数据类型] [发布内容]
-
查看状态
guyue@guyue:~$ rosservice call /get_position "id: 1" position: 100
-