Dynamixel X系列舵机快速使用(Windows与ROS)

参考:

DYNAMIXEL Starter Set Quick Start :DYNAMIXEL Wizard 20 Software:https://www.bilibili.com/video/BV1EU4y147eA

01 硬件连接

电源等连接关系:

方式1方式2方式3
在这里插入图片描述在这里插入图片描述在这里插入图片描述

02 Windows使用

  1. 使用DYNAMIXEL Wizard 2.0
    下载地址:http://en.robotis.com/service/downloadpage.php?ca_id=10
    在这里插入图片描述
  2. 软件使用参考下图:
    注意:需要在电源开启下,才能找到需要的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
      
  • 1
    点赞
  • 17
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值