wrong checksum for topic id and msg
Hello All, Would you please help me, I am trying to publish many topics using Teensy 3.6. I am running the comment below:
rosrun rosserial_python serial_node.py _port:=/dev/ttyACM0 __name:=node1 _baud:=115200
I get the error below:
[INFO] [WallTime: 1522103896.287668] ROS Serial Python Node
[INFO] [WallTime: 1522103896.295912] Connecting to /dev/ttyACM0 at 115200 baud
[INFO] [WallTime: 1522103898.568405] Note: publish buffer size is 512 bytes
[INFO] [WallTime: 1522103898.607305] Setup publisher on /Force [std_msgs/Float32].........
[INFO] [WallTime: 1522103898.612464] Note: subscribe buffer size is 512 bytes
[INFO] [WallTime: 1522103898.637525] Setup subscriber on /th_pac1 [std_msgs/Float32].........
[INFO] [WallTime: 1522103899.149705] wrong checksum for topic id and msg
[ERROR] [WallTime: 1522103899.722798] Mismatched protocol version in packet: lost sync or rosserial_python is from different ros release than the rosserial client
[INFO] [WallTime: 1522103899.723073] Protocol version of client is unrecognized, expected Rev 1 (rosserial 0.5+)
[INFO] [WallTime: 1522103900.296360] wrong checksum for topic id and msg
[INFO] [WallTime: 1522103901.439353] wrong checksum for topic id and msg
[INFO] [WallTime: 1522103902.013452] wrong checksum for topic id and msg
The Arduino Code is as follow:
#include <MovingAverage.h>
#include <ros.h>
#include <std_msgs/Float32.h>
//Declearing the Variables
int Valve1 = 8; int Valve2 = 9; int Valve3 = 10;
int Pump1 = 3; int Pump2 = 5; int Pump3 = 6; //PWM
int Buzz1 = 11; int Buzz2 = 12; int Buzz3 = 13; //PWM
float ff_Pdc; float ff_Pac1, lf_Pdc; float lf_Pac1, th_Pdc; float th_Pac1;
float v1, v2, v3,y,x1,x2, gram,z1, z2, z3,p1, p2, p3;
float Press_Volt1, Press_Volt2, Press_Volt3;
float e1, e2, e3;
float psi1, psi2, psi3;
float Kpa1, Kpa2, Kpa3;
float Kpa1_Ave, Kpa2_Ave, Kpa3_Ave;
ros::NodeHandle nh;
//Publish Errors
std_msgs::Float32 Error1_msg;
ros::Publisher pub_Error1("/Error1", &Error1_msg);
std_msgs::Float32 Error2_msg;
ros::Publisher pub_Error2("/Error2", &Error2_msg);
std_msgs::Float32 Error3_msg;
ros::Publisher pub_Error3("/Error3", &Error3_msg);
// Pressure Sensor Float32 Msg
std_msgs::Float32 Pressure1_msg;
ros::Publisher pub_Pressure1("/Pressure1", &Pressure1_msg);
std_msgs::Float32 Pressure2_msg;
ros::Publisher pub_Pressure2("/Pressure2", &Pressure2_msg);
std_msgs::Float32 Pressure3_msg;
ros::Publisher pub_Pressure3("/Pressure3", &Pressure3_msg);
// Pdc_Ave Sensor Float32 Msg
std_msgs::Float32 ffPdcArd_msg;
ros::Publisher pub_ffPdcArd("/ffPdcArd", &ffPdcArd_msg);
std_msgs::Float32 lfPdcArd_msg;
ros::Publisher pub_lfPdcArd("/lfPdcArd", &lfPdcArd_msg);
std_msgs::Float32 thPdcArd_msg;
ros::Publisher pub_thPdcArd("/thPdcArd", &thPdcArd_msg);
//Publish Pump Volt
std_msgs::Float32 Force_msg;
ros::Publisher pub_Force("/Force", &Force_msg);
// LoadCell Float32 Msg
std_msgs::Float32 LoadCell_msg;
ros::Publisher pub_LoadCell("/LoadCell", &LoadCell_msg);
//callback function for our subscriber to read Baxter Gripper Position
std_msgs::Float32 ff_pdc_msg;
void callbackff( const std_msgs::Float32& ff_pdc_msg){
ff_Pdc = ff_pdc_msg.data;
}
std_msgs::Float32 ff_pac1_msg;
void callbackff1( const std_msgs::Float32& ff_pac1_msg){
ff_Pac1 = ff_pac1_msg.data;
}
//////////////////////////////////////////////////////
std_msgs::Float32 lf_pdc_msg;
void callbacklf( const std_msgs::Float32& lf_pdc_msg){
lf_Pdc = lf_pdc_msg.data;
}
std_msgs::Float32 lf_pac1_msg;
void callbacklf1( const std_msgs::Float32& lf_pac1_msg){
lf_Pac1 = lf_pac1_msg.data;
}
//////////////////////////////////////////////////////
std_msgs::Float32 th_pdc_msg;
void callbackth( const std_msgs::Float32& th_pdc_msg){
th_Pdc = th_pdc_msg.data;
}
std_msgs::Float32 th_pac1_msg;
void callbackth1( const std_msgs::Float32& th_pac1_msg){
th_Pac1 = th_pac1_msg.data;
}
ros::Subscriber<std_msgs::Float32> subff("/ff_pdc", &callbackff );
ros::Subscriber<std_msgs::Float32> subff1("/ff_pac1", &callbackff1 );
ros::Subscriber<std_msgs::Float32> sublf("/lf_pdc", &callbacklf );
ros::Subscriber<std_msgs::Float32> sublf1("/lf_pac1", &callbacklf1 );
ros::Subscriber<std_msgs::Float32> subth("/th_pdc", &callbackth );
ros ...
Does the message type that you're supplying to your subscriber match that of your publisher? That's usually the message that I'll see if they don't match.
this could be a buffer overrun situation. How many msgs and at what rate are you trying to publish exactly?
jayess: the messages type (Floate32) are the same for both publishers and subscribers.
gvdhoom: I have one message for each publisher of type Floate32 since I have 11 publishers and 4 subscribers. I think it is not possible to specify the publishing rate in Arduino IDE please correct me.
Publication rate is determined by how often you call
publish(..)
, which is typically inside yourloop()
function. Afaik you can influence how often that runs by usingdelay(..)
.do you really need 11 publishers? What sort of data are you publishing?
Perhaps you can show us some pieces of code. How is your
loop()
structured, fi?I don't have any delay in my loop() function in this case what is my publishing rate? Yes I need all the topics and I am publishing pressure reading from pressure sensor all my data are of type Float32.
then I would suggest you add one.
p1 = analogRead(A0); e1 = (ff_Pdc - Kpa1_Ave); pub_Error1.publish( &Error1_msg); pub_Pressure1.publish( &Pressure1_msg); pub_ffPdcArd.publish( &ffPdcArd_msg); pub_LoadCell.publish( &LoadCell_msg);
I am subscribing to a topic from BioTac Sensor and I am controlling the pressure of soft actuator.