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

Serial Communication with 32 bit Micro-controller (Not Arduino!!!)

asked 2014-03-06 08:29:08 -0500

nicobari gravatar image

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

edit retag flag offensive close merge delete

3 Answers

Sort by » oldest newest most voted
3

answered 2014-03-06 14:28:57 -0500

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/rosser...

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

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.

edit flag offensive delete link more

Comments

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.

nicobari gravatar image nicobari  ( 2014-03-06 15:43:47 -0500 )edit

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?

nicobari gravatar image nicobari  ( 2014-03-06 16:57:45 -0500 )edit

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 .

mikepurvis gravatar image mikepurvis  ( 2014-03-10 04:42:21 -0500 )edit
1

answered 2014-03-06 09:03:48 -0500

William gravatar image

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.

edit flag offensive delete link more

Comments

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

nicobari gravatar image nicobari  ( 2014-03-06 10:19:04 -0500 )edit
0

answered 2014-03-06 11:31:09 -0500

nicobari gravatar image

Hi, So this is how I am doing it now, since I was able to install Pyserial and I have worked with serial port before in python, I wrote my serial receiving code in python and then publishing it. Since ROS doesn't differentiate between C++ node or Python node I can basically run the serial node with any other node written in c++. This doesn't look that efficient but works for now.

Regards, TM

edit flag offensive delete link more

Comments

I think all these require the code to be written in C++ on the microcontroller, i.e to communicate with the microcontroller over rosserial running on the linux PC, we need to to write the code (As written for ardunio in tutorials) in C++ (as we have libraries) any chance to do this by C code on Uc.?

sumanth gravatar image sumanth  ( 2014-07-01 00:42:16 -0500 )edit

Question Tools

2 followers

Stats

Asked: 2014-03-06 08:29:08 -0500

Seen: 1,756 times

Last updated: Mar 06 '14