ros-arduino-dynamixel : serial error

asked 2020-08-23 22:46:46 -0600

Ray_Shim gravatar image

updated 2020-08-23 23:11:23 -0600

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+)
edit retag flag offensive close merge delete

Comments

Seems clear that the error is the version installed from rosserial client is different from your backend.

Did you installed it using

sudo apt-get install ros-indigo-rosserial-arduino

of course, changing indigo by your ros distro?

If not, can you try?

you could check the version with:

rosversion rosserial_arduino
Solrac3589 gravatar image Solrac3589  ( 2020-08-24 02:40:52 -0600 )edit

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.

Ray_Shim gravatar image Ray_Shim  ( 2020-08-24 04:53:21 -0600 )edit

I have the same problem. How did you solve that? How to use dynamixel servo with rosserial_arduino?

lsattf gravatar image lsattf  ( 2021-06-26 12:09:57 -0600 )edit