Robotics StackExchange | Archived questions

Rosserial with Arduino alaMode cannot create service client

Short: How should I use rosserial differently with different arduino boards?

Longer: I have a suite of sensors and servomotors plugged into my arduino alamode sitting atop a raspberry pi. I have a sketch on the alamode that publishes and subscribes to a number of ros topics from the pi, so I need to use rosserial to communicate between them.

The sketch uploads fine (and I can run non-ros-related code on the alamode) but when I init my serial node to access the publishers and subscribers, I get the following error:

pi@rosbian1 ~ $ rosrun rosserial_python serial_node.py /dev/ttyS0
[INFO] [WallTime: 1365008396.083486] ROS Serial Python Node
[INFO] [WallTime: 1365008396.090398] Connecting to /dev/ttyS0 at 57600 baud
[ERROR] [WallTime: 1365008398.866009] Creation of publisher failed: unpack requires a string argument of length 4
[ERROR] [WallTime: 1365008398.881530] Creation of publisher failed: unpack requires a string argument of length 4
[ERROR] [WallTime: 1365008398.896279] Creation of publisher failed: unpack requires a string argument of length 4
[ERROR] [WallTime: 1365008398.910934] Creation of publisher failed: unpack requires a string argument of length 4
[ERROR] [WallTime: 1365008398.924429] Creation of publisher failed: unpack requires a string argument of length 4
[ERROR] [WallTime: 1365008398.939304] Creation of subscriber failed: unpack requires a string argument of length 4
[ERROR] [WallTime: 1365008398.952755] Creation of subscriber failed: unpack requires a string argument of length 4
[ERROR] [WallTime: 1365008398.967156] Creation of service client failed: unpack requires a string argument of length 4
[ERROR] [WallTime: 1365008399.897188] Tried to publish before configured, topic id 125
[ERROR] [WallTime: 1365008399.911211] Tried to publish before configured, topic id 127
[ERROR] [WallTime: 1365008399.924296] Tried to publish before configured, topic id 126
[ERROR] [WallTime: 1365008399.938427] Creation of service client failed: unpack requires a string argument of length 4
[ERROR] [WallTime: 1365008399.952503] Creation of service client failed: unpack requires a string argument of length 4

...etcetera.

When I run the code on an Arduino Uno, the serial node initializes without a hitch, along with the publishers and subscribers. Since ross-less code runs fine on the alamode, I think that rosserial must be the culprit. How do I modify it to suit my hardware needs?

Thank you,

Trevor

Asked by TrevHoot on 2013-04-03 09:57:32 UTC

Comments

I'm having a similar problem. A single publisher on an Uno works fine, but a second publisher fails to initialize with the same error message. Fresh install of ros-hydro, ubuntu 13.04, and the latest rosserial

Asked by stebl on 2013-10-03 17:30:08 UTC

Answers