Some info here to control the DXL motors with dynamixel SDK.
First, you need these two components for comms and power:
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
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
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
Robotis-Dynamix SDK Tutorial: https://www.youtube.com/watch?v=XMCPJFqoH10
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()