ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

What kind of Arduino board are you using? I stopping using rosserial because its relatively high RAM usage caused instability on a Leonardo-compatible board. For various reasons, it's difficult to reduce the memory usage significantly, so a Mega (or Teensy 3.x, especially) might be a more realistic platform. I didn't have any connectivity issues at 57600 baud, but had some stack/heap/static collision problems, depending on how the Arduino code was written. How many bytes of RAM are shown as free when you compile the code?

Also, check that your message types exactly match between the ros::Publisher definition and the call to publish(). The way the template methods are defined in rosserial does not cause the compiler to make sure they match. This code compiles, for example, but generates an error like the one you are seeing:

ros::Int16 int16msg;
ros::Int32 int32msg;
ros::Publisher myPub("~topic", &int16Msg);
...
myPub.publish(&int32Msg);

I've switched to using ros_arduino_bridge because of the memory issues (since I don't have the option of moving to an Arduino board with more RAM).