Ask Your Question

Revision history [back]

Why can't I send "123" via rostopic pub?

Hey

I'm using an std_msgs/String topic to send some messages between nodes. During testing, I tried to send the string "123" via rostopic pub:

rostopic pub /topic_name std_msgs/String "123"

My rostopic echo received nothing, and I got the msg: [WARN] [WallTime: 1401278233.697819] Inbound TCP/IP connection failed: field data must be of type str

So i tried to do: rostopic pub /topic_name std_msgs/String "123a"

And the msg was sent perfectly.

Is there any reason for this behaviour? "123" is a valid string so there should be no reason to throw this error.