First time here? Check out the FAQ!


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 Oct 9 '17

chanhyeoni gravatar image

updated Oct 9 '17

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?

Preview: (hide)

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  ( Oct 9 '17 )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  ( Oct 9 '17 )edit

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

ChriMo gravatar image ChriMo  ( Oct 9 '17 )edit

2 Answers

Sort by » oldest newest most voted
0

answered Oct 9 '17

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.

Preview: (hide)

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  ( Nov 18 '17 )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  ( Nov 20 '17 )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  ( Nov 20 '17 )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  ( Nov 20 '17 )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  ( Nov 20 '17 )edit
0

answered Dec 22 '17

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

Preview: (hide)

Question Tools

2 followers

Stats

Asked: Oct 9 '17

Seen: 823 times

Last updated: Dec 21 '17