0
$\begingroup$

Rosanswers logo

Hi, I just started working with ROS and just yesterday got my first program up and running in ROS. I am interested in communicating with a 32 bit Micro-controller which is not Arduino via serial communication. The micro-controller in question is http://www.netburner.com/products/core-modules/mod54415 . I was searching on forum and the internet for simple serial communication between ROS and such micro-controller. I found rosserial which is mostly explained for AVR and Arduino. I also found rosserial_client which can be modified for any hardware apparently but is kind of difficult for me to understand at this stage. I found cereal_port package but it is discontinued for hydro. Everything that I found is geared towards serial communication with arduino. Is there a simple way I can set up serial communication between ROS and micro-controllers? May be I am not looking at the right place but I would appreciate if I can get some help in this matter. Thank you in advance


Originally posted by nicobari on ROS Answers with karma: 86 on 2014-03-06

Post score: 0

$\endgroup$

2 Answers 2

0
$\begingroup$

Rosanswers logo

Just to build on William's answer— creating a rosserial port for your device is very straightforward. The entirety of the Arduino port is contained in the following files:

https://github.com/ros-drivers/rosserial/blob/hydro-devel/rosserial_arduino/src/ros_lib/ros.h

https://github.com/ros-drivers/rosserial/blob/hydro-devel/rosserial_arduino/src/ros_lib/ArduinoHardware.h

All you really need to do is wire up a few functions which tell the rosserial client library how to read and write the serial port. Arduino is definitely not the only supported option, it's just a really common platform, and thus well-suited to being the demonstration.


Originally posted by mikepurvis with karma: 1153 on 2014-03-06

This answer was ACCEPTED on the original site

Post score: 3


Original comments

Comment by nicobari on 2014-03-06:
Thanks for the answer, I will look into it once I get done with my current project. Also lets say I modified the rosserial to work with my Microcontroller and named it as rosserial_microxxx does that mean the resultant serial code which I will write to set up my microcontroller as a node will be uploaded on the microcontroller or the code will run on a host with ROS? Thanks again.

Comment by nicobari on 2014-03-06:
Also I was looking at rosserial_clent tutorial and it shows that it has avr libraries in to compile the code, what happens if I don't have the libraries for micro-controller for ubuntu but just for the windows?

Comment by mikepurvis on 2014-03-10:
Hi @nicobari—the tutorial which will be of interest to you is this one: http://wiki.ros.org/rosserial_client/Tutorials/Adding%20Support%20for%20New%20Hardware .

$\endgroup$
0
$\begingroup$

Rosanswers logo

If you just want to send and receive data with your microcontroller, then you can use PySerial for Python or Serial for C++:

If you want to "directly" publish and subscribe to ROS topics from your microcontroller then modifying rosserial for your system is likely the best option.


Originally posted by William with karma: 17335 on 2014-03-06

This answer was NOT ACCEPTED on the original site

Post score: 1


Original comments

Comment by nicobari on 2014-03-06:
Thanks for replying. Yeah, that is exactly what I want to do. I know about PySerial and like it but my current framework requires that I use C++ hence I installed Serial according to the instructions https://github.com/wjwwood/serial but after I followed the instructions to install it and tried to build my code I am getting error that serial.h file is missing. I know it is a case of missing the right line pointing to the location in CMakeList.txt file but since I am new to Ubuntu and ROS I am really not sure how to do that. I would appreciate if you can point me to a place where I can find how to do that.

Thanks, TM

$\endgroup$

Your Answer

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