0
$\begingroup$

Rosanswers logo

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?


Originally posted by inkspell4 on ROS Answers with karma: 32 on 2017-01-22

Post score: 0


Original comments

Comment by ahendrix on 2017-01-22:
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.

Comment by ahendrix on 2017-01-22:
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 )

Comment by inkspell4 on 2017-01-22:
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.

Comment by inkspell4 on 2017-01-22:
I Edited the question to make it clear on the outcome

Comment by ahendrix on 2017-01-22:
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/Overview/Protocol

Comment by ahendrix on 2017-01-22:
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.

Comment by ahendrix on 2017-01-22:
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.

Comment by inkspell4 on 2017-01-22:
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.

Comment by inkspell4 on 2017-01-22:
Further, this project is a learning experience for me in deigning my own application with ROS and I didn't necessarily want to start off where I was already heavily relying on another persons work.

$\endgroup$

1 Answer 1

0
$\begingroup$

Rosanswers logo

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/rosserial/blob/jade-devel/rosserial_client/src/ros_lib/ros/msg.h ) 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.


Originally posted by ahendrix with karma: 47576 on 2017-01-22

This answer was ACCEPTED on the original site

Post score: 1


Original comments

Comment by inkspell4 on 2017-01-22:
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.

Comment by ahendrix on 2017-01-22:
the message generation is the make_libraries.py script. Section 2.2 of the arduino setup tutorial describes how to run it.

Comment by inkspell4 on 2017-01-22:
Honestly, rosserial may work but my use case doesnt really fit into how the rosserial_server works, so it would be alot of modification.

Comment by ahendrix on 2017-01-22:
The actual main function for make_libraries is in rosserial_arduino: https://github.com/ros-drivers/rosserial/blob/jade-devel/rosserial_arduino/src/rosserial_arduino/make_libraries.py , but it makes very heavy use of libraries in the rosserial_client package.

Comment by inkspell4 on 2017-01-22:
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?

Comment by inkspell4 on 2017-01-22:
Also, my understanding is the rosserial is only implemented for tcp and serial, is that also correct?

Comment by ahendrix on 2017-01-22:
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)

Comment by ahendrix on 2017-01-22:
You are correct; so far rosserial has only been implemented over serial and TCP.

Comment by inkspell4 on 2017-01-22:
that is great, thank you so much

Comment by gvdhoorn on 2017-01-23:
An addition to @ahendrix's comment: there is also UDP support in rosserial. And there is quite some abstraction there: with some work, the Hardware base class can be used to add support for different 'transports'.

Comment by inkspell4 on 2017-01-23:
Yeah, the problem with that is that although UDP it is a special type of UDP and it is on the server side that it needs to be sent

Comment by gvdhoorn on 2017-01-23:
I'm not sure I understand what you are referring to.

Comment by inkspell4 on 2017-02-20:
I am specifically implementing the serialization of ROS data for the purpose of multicasting the data so that multiple receivers can access it. ROSSerial is built for a 1-1 connection and I do not think that it would be a good platform for multicasting.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.