Ask Your Question
0

Running rosserial_embeddedlinux on MIPS platform (big-endian)

asked 2016-01-22 01:48:49 -0500

zchen99 gravatar image

updated 2016-10-24 09:06:21 -0500

ngrennan gravatar image

Rosserial 0.7.1, Python 2.7.6

MIPS platform: HelloRos example

ROS workstation(indigo):

rosrun rosserial_python serial_node.py tcp

caused:

Creation of publisher failed: unpack requires a string argument of length 4

https://github.com/ros-drivers/rosser...

https://github.com/ros-drivers/rosser...


Edit: Thanks Jackie for your reply.

I'm debugging the msg format and to see the bytes order in each msg.

ff + PROTOCOL_VER(1byte) + msg_len(2bytes) + checksum(1byte) + topic_id(2bytes) + msg_payload + checksum(1byte)

Msgs which were sent out from my MIPs HelloROS publisher:

  • The first msg

    ff fe 8 0 f7 a 0 0 0 0 0 0 0 0 0 f5
    

    Does it seem ok?

  • The second msg

    ff fe 48 0 b7 0 0 7d 0 7 0 0 0 63 68 61 74 74 65 72 0 0 0 f 73 74 64 5f 6d 73 67 73 2f 53 74 72 69 6e 67 0 0 0 20 39 39 32 63 65 38 61 31 36 38 37 63 65 63 38 63 38 62 64 38 38 33 65 63 37 33 63 61 34 31 64 31 0 2 0 0 23
    

    In my msg body, include topic_id(7d 0) and msg_len(7 0 0 0) and following topic_name 'chatter'(63 68 61 74 74 65 72 ) and following std_msg/md5sum.

    Is it the correct msg format for rosserial_python to create publisher?

    $ rosrun rosserial_python serial_node.py tcp
    [INFO] [WallTime: 1453776966.885414] Established a socket connection from 192.168.1.1 on port 53510
    [INFO] [WallTime: 1453776966.886393] calling startSerialClient
    [ERROR] [WallTime: 1453776969.951862] Creation of publisher failed: unpack requires a string argument of length 4
    [ERROR] [WallTime: 1453776970.974415] Tried to publish before configured, topic id 125
    
  • The third msg:

    ff fe e 0 f1 7d 0 0 0 0 a 48 65 6c 6c 6f 20 52 4f 53 21 4f
    

    topic_id(7d 0) + msg_len(0 0 0 a) should be(a 0 0 0), right?

    Hello ROS! (48 65 6c 6c 6f 20 52 4f 53 21)

Please help on me for the detailed msg format, so I can have a debug on this.

Thanks.

edit retag flag offensive close merge delete

Comments

@zchen99: please don't post answers to add more information to your question. Use either comments (under the relevant answer) or edit your original post (preferred), using the edit link/button. I've already merged your update into your question, but please keep it in mind.

gvdhoorn gravatar image gvdhoorn  ( 2016-01-26 03:43:34 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted
0

answered 2016-01-22 16:57:11 -0500

jackie gravatar image

updated 2016-01-26 03:43:51 -0500

gvdhoorn gravatar image

Can you reconfigure your device to be in little-endian mode? MIPS is a bi-endian instruction set, so you should theoretically be able to switch it to little-endian mode...

From http://wiki.ros.org/rosserial_client

Note: The serialization and deserialization code generated by the make_libraries module assumes that the client is a little-endian machine. If you have a bi-endian target such as ARM or MIPS, be sure that it has been placed in little-endian mode in order to use it with rosserial.

I don't have a MIPS device with me to test this, sorry. Good luck!

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

Stats

Asked: 2016-01-22 01:48:49 -0500

Seen: 252 times

Last updated: Jan 26 '16