rosserial arduino - wrong checksum for topic id and msg

asked 2016-03-30 12:09:56 -0600

Naman gravatar image

updated 2016-04-01 09:59:25 -0600

Hi all,

I am having a problem in writing a basic ROS publisher in arduino. Here is the code:

#include <ros.h>
#include <geometry_msgs/Vector3.h>

ros::NodeHandle nh;
geometry_msgs::Vector3 velocity_wheels;
ros::Publisher encoder_ticks_pub("re_ticks",&velocity_wheels); // Publish the encoder ticks

void setup()
{
  nh.getHardware()->setBaud(115200);
  nh.initNode(); // Initialize Node
  nh.advertise(encoder_ticks_pub); 
}

void loop()
{

   velocity_wheels.x = 0.1;
   velocity_wheels.y = 0.2;
   velocity_wheels.z = 0.3;
   encoder_ticks_pub.publish(&velocity_wheels);

   nh.spinOnce();
   delay(10);
}

When I run it using rosrun rosserial_python serial_node.py _port:=/dev/dr_arduino _baud:=115200 it gives me the following : [INFO] [WallTime: 1459356598.600339] wrong checksum for topic id and msg. The complete output is :

[INFO] [WallTime: 1459356541.444546] ROS Serial Python Node
[INFO] [WallTime: 1459356541.447199] Connecting to /dev/dr_arduino at 115200 baud
[INFO] [WallTime: 1459356543.574293] Note: publish buffer size is 512 bytes
[INFO] [WallTime: 1459356543.574697] Setup publisher on re_ticks [geometry_msgs/Vector3]
[INFO] [WallTime: 1459356598.600339] wrong checksum for topic id and msg

Also, sometime I get this error : tried to publish before configured topic id 125

I am not able to understand what is causing this issue. If I run the following ros_arduino_publisher, it works fine.

Update:
If I increase the delay from delay(10) to delay(100), the problem does not occur. Can it because the data is being published at a very high speed and the buffer size is not enough? Will it make sense to increase the buffer size?

Any help will be appreciated.

Thanks in advance.
Naman

edit retag flag offensive close merge delete

Comments

1

Did you fix the issue i too facing the same problem?

Kishore Kumar gravatar image Kishore Kumar  ( 2016-09-11 14:39:10 -0600 )edit

Hi, I'm facing the same problem. Did you fixed the problem already?

Zero gravatar image Zero  ( 2016-10-26 01:07:00 -0600 )edit

I'm facing the same problem by publishing the transform of imu. Did you fixed the problem??

أسامة الادريسي gravatar image أسامة الادريسي  ( 2017-11-06 01:35:11 -0600 )edit

Having the same problem here, I just increase the delay and the error goes away. Any Idea?

richrdcm gravatar image richrdcm  ( 2018-04-30 16:13:07 -0600 )edit