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

Has anybody implemented rosserial_client-based node in Raspberry Pi?

asked 2017-10-09 11:54:25 -0500

chanhyeoni gravatar image

updated 2017-10-09 12:18:08 -0500

I'm using the pi board as a client board as if it were an Arduino board connected to PC/laptop, and I'm wondering if anybody has ever done that. If so, could you tell me what libraries you used it?

With regards to rosserial_embeddedlinux, I need to download the development environment in my server-side host, which is Jetson, and in most of the cases IDEs are not able to be installed in Jetson platform. So I would rather write the implementation code for Hardware class (wiki.ros.org/rosserial_client/Tutorials/Adding Support for New Hardware) so that the rosserial-based connection for Raspberry Pi is established. Could anybody please help me with this?

edit retag flag offensive close merge delete

Comments

Hi, sorry, where is the use case for this ? All your boards have ip available over serial, ethernet or wifi. I think you have all you need available. I see one case only to use ros_serial: small limitted system without ip. Thanks for more Cheers Chrimo

ChriMo gravatar image ChriMo  ( 2017-10-09 12:51:19 -0500 )edit

@ChriMo Actually, rosserial is able to use TCP/IP, so one can use it on a system that has an IP link but you cannot install ROS (ex. Windows, small embedded Linux (too small for Boost...)). In that case, for the Raspberry Pi, rosserial_embeddedlinux seems OK.

rreignier gravatar image rreignier  ( 2017-10-09 14:14:15 -0500 )edit

OK, I understand now. Like my OSX. Thanks for more :-)

ChriMo gravatar image ChriMo  ( 2017-10-09 14:19:03 -0500 )edit

2 Answers

Sort by ยป oldest newest most voted
0

answered 2017-10-09 14:17:33 -0500

rreignier gravatar image

You should be able to use rosserial_embeddedlinux directly on the Raspberry Pi.

I did not use it myself yet but you can either use a serial link or an IP link through TCP/IP.

See the tutorials: http://wiki.ros.org/rosserial_embeddedlinux/Tutorials

First, generate the header files for the messages with the make_libraries.py script on your Ubuntu computer, then copy them on the Raspberry Pi and build your rosserial node with CMake.

edit flag offensive delete link more

Comments

As I am also developing a Raspbian/Linux c++ client application (i.e. not arduino) running an a RaspI3, and maybe as it is with this author, the rosserial_embeddedlinux/make_libraries.py contains references to arduino, which doesn't seem correct. I note the mbed example does't contain arduino text.

RobotRoss gravatar image RobotRoss  ( 2017-11-17 20:05:04 -0500 )edit

With further investigation, there is a make_library.py file under rosserial/rosserial_client with no arduino refererences, i.e. presumably to generate generic c++ libraries for use on a non-ROS Linux controller such as Raspberry Pi. Is that correct? It won't run however on my Kinetic workstation.

RobotRoss gravatar image RobotRoss  ( 2017-11-19 19:04:42 -0500 )edit

Exactly, rosserial_embeddedlinux uses rosserial_client + adds the communication part and some examples. The references to Arduino in the python script are only a badly named variable. I have tried to run the example HelloROS on a RaspberryPi and it works like a charm.

rreignier gravatar image rreignier  ( 2017-11-20 06:28:38 -0500 )edit

Sry, a necessary correction to prev. comment. A "no arduino" make_libraries.py under /rosserial/rosserial_client/scripts runs & generates a set of ROS files in a designated directory. I presume I would add ros.h, embedded_linux_comms.c, embedded_linux hardware.h files to use on a Linux Raspberry Pi?

RobotRoss gravatar image RobotRoss  ( 2017-11-20 16:13:45 -0500 )edit

Yes, you can, but the easier it to run: rosrun rosserial_embeddedlinux make_libraries.py . It will generate a ros_lib directory with the embeddedlinux specific files already inside and a examples one. You can then move the files to RPi and g++ -o HelloROS HelloROS.cpp -I../../ros_lib

rreignier gravatar image rreignier  ( 2017-11-20 16:18:34 -0500 )edit
0

answered 2017-12-21 20:28:44 -0500

RobotRoss gravatar image

I was successfully able to run "make_libraries.py, copied the files from my ROS workstation to the RaspPi with "scp", and complied with default gcc 4.9.2-10 on Jessie (8.0), as you described. I had to add an option -Wno-write-strings to silence an error message concerning "depreciated conversion from string to 'char' " in statement char *rosSrvrIp ="192.168.2.132"; Executable HelloROS runs ok on the RaspiPi. Now I can move on to testing communication with the running ROS node, serial_node.py

edit flag offensive delete link more

Question Tools

2 followers

Stats

Asked: 2017-10-09 11:54:25 -0500

Seen: 782 times

Last updated: Dec 21 '17