Some info here to control the DXL motors with dynamixel SDK.

First, you need these two components for comms and power:

https://s3-us-west-2.amazonaws.com/secure.notion-static.com/197d624e-9c65-43c2-8f86-5a7efd449669/Untitled.png

Set up the above components as the link shows here: https://emanual.robotis.com/docs/en/parts/interface/u2d2/

Then set up the dynamixel wizard for your OS: https://emanual.robotis.com/docs/en/software/dynamixel/dynamixel_wizard2/

To get started with ROS, check out this link: https://emanual.robotis.com/docs/en/software/dynamixel/dynamixel_workbench/#tutorials

Code Samples:

  1. Python-ROS Code: HumaRobotics ROS Bindings for Dynamixel Motors is a ROS package that provides bindings to access Dynamixel motors. It relies on the HumaRobotics Dynamixel Library provided on https://github.com/HumaRobotics/dynamixel_hr_ros

    1. Current Position of the motors: The /dxl/chain_state topic will provide messages about the current position of the motors in radians.
    2. The /dxl/enable topic listens to Bool messages that allows to activate (True) or deactivate (False) the entire motor chain.
    3. The /dxl/command_position topic listens for messages that specifies angles to be reached by the motors and optionally a set of speeds.
  2. C++ code: Code is for a ROS (http://www.ros.org/) node that controls a pair of servo motors (referred to in the code as grippers) that can be controlled individually or together. https://codereview.stackexchange.com/questions/207113/ros-node-to-control-dynamixel-servo-motors

  3. Robotis-Dynamix SDK Tutorial: https://www.youtube.com/watch?v=XMCPJFqoH10

  4. ROS/Python code to move Dynamixel motors: (Ref)

    #!/usr/bin/env python
    import sys
    import time
    import rospy
    from std_msgs.msg import Float64
    from Tkinter import *
    
    rospy.init_node('adi', anonymous=True)
    pub1 = rospy.Publisher('/joint1/command', Float64, queue_size=10)
    .
    .
    .
    pub10 = rospy.Publisher('/joint10/command', Float64, queue_size=10)
    
    def a():
        pub1.publish(3)   # It sets the motor to center position
    .
    .
    .
    .
        pub10.publish(3)
        print  w1.get(), w2.get() , w3.get(), w4.get() , w5.get() , w6.get() , w7.get() , w8.get() , w9.get() , w10.get() 
        pub1.publish(w1.get()*0.01)
        .
    .
    .
    .
             pub10.publish(w10.get()*0.01)
    
    master = Tk()
    master.title("ADI")
    w1 = Scale(master, from_=-360, to=360, orient=HORIZONTAL,length=300)
    w1.pack()
    .
    .
    .
    w10 = Scale(master, from_=-360, to=360, orient=HORIZONTAL,length=300)
    w10.pack()
    Button(master, text='Move', command=a).pack()
    a()
    master.mainloop()