ros-arduino-dynamixel : serial error
Hello, guys.
I'm trying to control dynamixel motors by using arduino and dynamixel shield with ros. I face an error. I think there are some communication problem. I remove and install rosserial-python. And check each code that i made. The problem is dynamixel motor control code.(If i delete 'problem code', it works well.) I don't know how to fix this communication problem.
Could i get some advice?
Thanks for your interest, Ray.
teminal code :
$ rosrun rosserial_python serial_node.py /dev/ttyACM0
Arduino loop Code:
void loop() {
// Motor control part
motor(w_l, w_r);
// Calc Position Part
ros::Time stamp_now = nh.now();
calcTime();
// calculate odometry
calcTick(); // after this CalcTick => we have wheels` delta angle
calcOdom(step_time * 0.001);
// publish odometry
updateOdometry();
odom.header.stamp = stamp_now;
odom_pub.publish(&odom);
// publish odometry tf
updateTF(tf_);
tf_.header.stamp = stamp_now;
tf_broadcaster.sendTransform(tf_);
nh.spinOnce();
}
Problem code :
void motor(int Pulse_Width1, int Pulse_Width2){
dxl.setGoalVelocity(LEFT_ID, Pulse_Width1); //0~1023
dxl.setGoalVelocity(RIGHT_ID, Pulse_Width2);
}
Error :
[ERROR] [1598239905.380172]: Mismatched protocol version in packet: lost sync or rosserial_python is from different ros release than the rosserial client
[INFO] [1598239905.380694]: Protocol version of client is Rev 0 (rosserial 0.4 and earlier), expected Rev 1 (rosserial 0.5+)
Seems clear that the error is the version installed from rosserial client is different from your backend.
Did you installed it using
of course, changing indigo by your ros distro?
If not, can you try?
you could check the version with:
Thanks for your interest. I already tried it. I found that this problem is caused, because dynamixel and ros act in same serial port. It's similar with using arduino(serial) and ros(rosserial) at the same time.
I have the same problem. How did you solve that? How to use dynamixel servo with rosserial_arduino?