Rosserial with Arduino alaMode cannot create service client [closed]

asked 2013-04-03 09:57:32 -0500

TrevHoot gravatar image

updated 2014-01-28 17:16:01 -0500

ngrennan gravatar image

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

edit retag flag offensive reopen merge delete

Closed for the following reason question is not relevant or outdated by tfoote
close date 2016-04-27 01:38:24.158210

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

stebl gravatar image stebl  ( 2013-10-03 17:30:08 -0500 )edit