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

Rosserial Hydro unpack requires string length 4

asked 2013-09-27 11:22:12 -0600

GioRos gravatar image

Hi,I installed rosserial hydro for arduino and ros_lib as written in the wiki. when I try ros hello world example found in ros_lib it compiles and works fine but when i try a ros_lib example with a subscriber, whatever topic name is, i get (from pubsub ros example):

[INFO] [WallTime: 1380287883.995053] ROS Serial Python Node [INFO] [WallTime: 1380287884.001497] Connecting to /dev/ttyACM0 at 57600 baud [INFO] [WallTime: 1380287886.607383] Note: publish buffer size is 512 bytes [INFO] [WallTime: 1380287886.607882] Setup publisher on chatter [std_msgs/String] [ERROR] [WallTime: 1380287886.609524] Creation of subscriber failed: unpack requires a string argument of length 4.

So publisher is created but subscriber fails....! I use hydro on ubuntu 12.04 64bit.Is there a way to solve it?I'm stuck here...!Someone can help me? thank!

edit retag flag offensive close merge delete

2 Answers

Sort by ยป oldest newest most voted

answered 2013-10-01 19:40:16 -0600

fergs gravatar image

I believe it is temporarily broken, but they are at work on fixing it (see -- in the meantime, you could do a git checkout, and roll back to the 0.5.2 tag to get back to the working version until a patch is released. In your catkin workspace you would do:

git clone <a href=""></a>
git checkout 0.5.2
edit flag offensive delete link more


When I roll back to 0.5.2, the rosserial_xbee gives me the following error: Tried to publish before configured, topic id 125 but it works fine using rosserial_python fine. I am using the same microcontroller with the same code on it. However, it works on 0.5.1. Should I open an issue on GitHub?

tonybaltovski gravatar image tonybaltovski  ( 2013-10-02 08:52:11 -0600 )edit

answered 2013-10-01 05:55:31 -0600

updated 2013-10-01 06:35:49 -0600

Try recompiling your ros_lib and make sure you source the ROS workspace.

Edit: After updating to the latest rosserial, I have the same problem on a Mega 2560. I recompiled everything and still get [ERROR] [WallTime: 1380645252.267795] Creation of subscriber failed: unpack requires a string argument of length 4

edit flag offensive delete link more


Arduino Mega 2560 too.Still same problem. I switched to an USB-ISS converter and wrote a node to talk to my sensors by I2C, using write,read unix function. If someone is able to solve it,Please let us know.Thanks.

GioRos gravatar image GioRos  ( 2013-10-01 12:24:41 -0600 )edit

I tried it on an Uno too, no luck.

tonybaltovski gravatar image tonybaltovski  ( 2013-10-01 13:55:03 -0600 )edit

Question Tools

1 follower


Asked: 2013-09-27 11:22:12 -0600

Seen: 358 times

Last updated: Oct 01 '13