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

ROS ShapeShifter Serialization to Arduino

asked 2017-01-22 19:20:50 -0500

inkspell4 gravatar image

updated 2017-01-22 19:35:20 -0500

Editing Question To Make Clear

I have a server that needs to be able to send various messages to clients over Ethernet. This is done by using a ShapeShifter class to serialize the message and then the message is sent. Is there a way for an Arduino client to serialize the message that is sent?

edit retag flag offensive close merge delete

Comments

You may want to dig into rosserial_arduino; I know it uses a serialiazation that is similar to the stock serialization, and I think it has a few modifications to make it more arduino-friendly.

ahendrix gravatar image ahendrix  ( 2017-01-22 19:30:24 -0500 )edit

It would also improve your question to explain WHY you want to do this; there's a decent chance that someone in the community has already done something similar and can save you a great deal of effort (see also: XY problem )

ahendrix gravatar image ahendrix  ( 2017-01-22 19:31:49 -0500 )edit

So, I have a server that is taking ShapeShifter messages and serializing them and then needs to send them to the Arduino, is this feasible, or should I be looking more into a custom serialization? I hvae looked some into rosserial and am lost in it.

inkspell4 gravatar image inkspell4  ( 2017-01-22 19:32:23 -0500 )edit

I Edited the question to make it clear on the outcome

inkspell4 gravatar image inkspell4  ( 2017-01-22 19:35:55 -0500 )edit

That sound almost exactly like what rosserial is doing (the C++ uses ShapeShifter too), and rosserial has some additional protocol over the serial line to delimit messages and identify which topics they belong to. you may want to read http://wiki.ros.org/rosserial/Overvie...

ahendrix gravatar image ahendrix  ( 2017-01-22 19:37:14 -0500 )edit

Overall it sounds like you're reinventing rosserial, and unless you've gotten rosserial to work and found it unsuitable, I'd advise that you give it another go.

ahendrix gravatar image ahendrix  ( 2017-01-22 19:38:01 -0500 )edit

There's been some progress in this question getting rosserial_arduino to work over the arduino wifi shield; you may be able to use that or adapt it for an ethernet shield.

ahendrix gravatar image ahendrix  ( 2017-01-22 19:46:24 -0500 )edit

The particular reason that I do not want to go with ROS serial is that future add-ons that I plan for the project would make it complex to handle within rosserial.

inkspell4 gravatar image inkspell4  ( 2017-01-22 20:06:25 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted
1

answered 2017-01-22 21:17:04 -0500

ahendrix gravatar image

You're probably best off using the serialization and deserialization from rosserial, even if you don't use the rest of it.

You probably just need msg.h ( https://github.com/ros-drivers/rosser... ) and the generated message classes from make_libraries.py . If you have a small set of messages you probably don't need to use the full rosserial build system; you can just generate messages once and then check in the resulting headers and use them.

Pulling in the full serialization libraries from roscpp probably isn't a good idea. I think they depend on boost (which is going to be difficult to get on arduino) and they use 64-bit floating point, which isn't supported on arduino/AVR ( as noted in the rosserial msg.h above). There are probably other dependencies in there as well that will be difficult to make work on an AVR.

edit flag offensive delete link more

Comments

Ok, in that case would you mind me asking where I can find the message generation code for the rosserial library (dont see where it is defined). If you don't know I will dig around more.

inkspell4 gravatar image inkspell4  ( 2017-01-22 21:24:45 -0500 )edit

the message generation is the make_libraries.py script. Section 2.2 of the arduino setup tutorial describes how to run it.

ahendrix gravatar image ahendrix  ( 2017-01-22 21:35:30 -0500 )edit

Honestly, rosserial may work but my use case doesnt really fit into how the rosserial_server works, so it would be alot of modification.

inkspell4 gravatar image inkspell4  ( 2017-01-22 21:36:04 -0500 )edit

The actual main function for make_libraries is in rosserial_arduino: https://github.com/ros-drivers/rosser... , but it makes very heavy use of libraries in the rosserial_client package.

ahendrix gravatar image ahendrix  ( 2017-01-22 21:36:17 -0500 )edit

If I am using the rosserial message structure on the Arduino side, do I need to use the same message (generated by rosserial) on the ROS side? Also, my understanding is that rosserial is just a pass through where an arduino can subscribe to any topic on the PC is that correct?

inkspell4 gravatar image inkspell4  ( 2017-01-22 21:48:18 -0500 )edit

Also, my understanding is the rosserial is only implemented for tcp and serial, is that also correct?

inkspell4 gravatar image inkspell4  ( 2017-01-22 21:50:42 -0500 )edit

Per the rosserial protocol documentation that I linked above, the serialization that rosserial uses is directly compatible with the serialization in ROS, which means that your ShapeShifter should be able to talk to rosserial's deserialization. (you don't need to use identical code on both sides)

ahendrix gravatar image ahendrix  ( 2017-01-22 21:53:00 -0500 )edit

You are correct; so far rosserial has only been implemented over serial and TCP.

ahendrix gravatar image ahendrix  ( 2017-01-22 21:53:37 -0500 )edit

Question Tools

1 follower

Stats

Asked: 2017-01-22 19:20:50 -0500

Seen: 337 times

Last updated: Jan 22 '17