Experiences with RO...
 

Experiences with ROS on multiple platforms  

Page 1 / 2
  RSS

starnovice
(@starnovice)
Eminent Member
Joined: 10 months ago
Posts: 31
2019-08-18 1:31 am  

In this thread I hope to share my experiences over the last couple of months of getting ROS up and running on 5 different platforms.  Some good and some bad.  The platforms are:

  1.  straight up linux in a dual boot
  2. ROS on a Raspberry Pi
  3. ROS on the Windows System Linux (WSL)
  4. ROS on Windows 10
  5. ROS on an Arduino

I will share my experiences and others hopefully will jump in on suggestions to do things better.

Today I'll talk briefly about item 1., Ubuntu Linux in a dual boot.  I had some complication with this, but looking back I realize it was because I was climbing the Linux learning curve at the same time as the ROS learning curve.  I have a lot of experience with Unix but it is long enough ago the Linux didn't even exist yet.

So it meant researching how to set up a dual boot system on my wife's old laptop because she still thinks after 7 years she may need some of the files on that machine.  This is not a difficult thing but is a step you might have to be prepared to go through.  I went with Ubuntu, not for any particular reason other then that name kept popping up.

Installing Ubuntu was a time consuming but straight forward process.

Next was installing the Melodic version of ROS.  This is also a very easy thing to do on Ubuntu.  Then I completed all of the tutorials through creating the Talker and Listener.  For those who aren't familiar with the tutorials, the Talker and Listener are two ROS nodes that send msgs and receive them.  Other relearning Linux along the way this was also straight forward.  Tedious but straight forward. The main difficultly I has was trying to access the Linux box remotely and getting X-Windows to work.  Still not happy with that yet.

Bottom line, ROS on Linux is good, straight forward and the tutorials are very complete and comprehensive.  This is the place to start for someone just getting started.  Even if you don't know Linux you can just google your question and you will probably find the answer.

OK more later if anyone is interested.

Pat Wicker


codecage liked
Quote
Topic Tags
Robo Pi
(@robo-pi)
Robotics Engineer Moderator
Joined: 10 months ago
Posts: 1590
2019-08-18 3:39 am  
Posted by: @starnovice

ROS on an Arduino

I'll be looking forward to this one. ? 

DroneBot Workshop Robotics Engineer
James


ReplyQuote
byron
(@byron)
Estimable Member
Joined: 10 months ago
Posts: 197
2019-08-18 2:18 pm  

@starnovice

Very interested in your write up of ROS on the various platforms.   I'm still trying to work out if installing ROS and leaning to use it is a worthwhile exercise to undertake as opposed to writing (or copying) code in Python and C to make my robot obey.  I will be following your exploits ? 


ReplyQuote
Spyder
(@spyder)
Honorable Member
Joined: 10 months ago
Posts: 659
2019-08-18 2:39 pm  

@robo-pi

Me too


ReplyQuote
starnovice
(@starnovice)
Eminent Member
Joined: 10 months ago
Posts: 31
2019-08-18 4:29 pm  
Posted by: @byron

@starnovice

... I'm still trying to work out if installing ROS and leaning to use it is a worthwhile exercise to undertake as opposed to writing (or copying) code in Python and C to make my robot obey.  I will be following your exploits ? 

Unfortunately, I haven't created any original applications yet, but I hope to get there soon.


ReplyQuote
Spyder
(@spyder)
Honorable Member
Joined: 10 months ago
Posts: 659
2019-08-18 6:26 pm  

@starnovice

I like to work on the theory of least complication first, then adding layers of complication a step at a time as I get things working


ReplyQuote
starnovice
(@starnovice)
Eminent Member
Joined: 10 months ago
Posts: 31
2019-08-18 8:03 pm  

@spyder

I agree, big time. Besides I'm hoping I can save others some of my grief and they can move faster to the more complicated stuff.

This post was modified 7 months ago by starnovice

ReplyQuote
starnovice
(@starnovice)
Eminent Member
Joined: 10 months ago
Posts: 31
2019-08-18 8:10 pm  

Since Robo-pi expressed an interest in Arduino, I think that gives me a game plan.  I already talked about the Linux installation.  Next I will talk about connecting Arduino to Linux and having the Linux control the Arduino.  This would be like the Arduino controlling some stepper motors and the Linux box being the brain telling the Arduino what to do.  After that I will move to the Raspberry Pi and cover how to get ROS on it and then have it control the Arduino.  Finally, I will cover the Windows installations.  I am leaving them last because while I had great hopes for them Windows just doesn't seem to work as well.


ReplyQuote
Spyder
(@spyder)
Honorable Member
Joined: 10 months ago
Posts: 659
2019-08-18 8:33 pm  

@starnovice

PERFECT !

That's exactly what I've been trying (and failing miserably) to do, in exactly the same order

Please, lay on MacDuff 


ReplyQuote
starnovice
(@starnovice)
Eminent Member
Joined: 10 months ago
Posts: 31
2019-08-22 1:52 am  

    Getting ROS on Linux to talk to an Arduino Uno turns out to be incredibly easy.  That is once to figure out why the Arduino IDE won't work on Linux.   Now this is a problem  not everybody will necessarily have.  The symptom is you install Arduino IDE from the Arduino website, be sure to get the Linux version.  You run the program and the menu choice for selecting your serial port is grayed out and you cannot select what port the Arduino is on. Note the Linux uses ports name dev/ttyAMC0 (that's a zero). If you are really paying attention you will notice in the terminal window where you started the IDE that there is an error message: "java.lang.nullpointerexception thrown while loading gnu.io.rxtxcommdriver".  What does that mean??

    So you do what you would normally do and google the error message, and maybe you even google "serial port grayed out".  You will find lots of answers to both of these responses, most of them telling you to set your permissions, run IDE as root, edit the preferences.txt file, and that the problem has been fixed in some earlier release of Linux.  Trust me none of this solves your problem.

    So you try to reinstall Java, after all this is a Jave error message, and still no joy in Mudville. So what is the secret?  I'll tell you in case you need to fix your version or you want to break your version.

    The problem is the Arduino IDE is expecting Java 8 and does not work with at least Java 10.  So to see what version of java you have installed run: "sudo update-alternatives --get-selections | grep java".  Then to set the correct version of java run "sudo update-alternatives --config java".  This will let you select between the various versions of java. I mean come on guys, it is supposed to be backward compatible.

    I would also like to know how I got more than one version of java on the machine to begin with.  I'm sure this is user error but I don't know what I did.

Well good luck, more on actually getting the Arduino to communicate in the next article.

Pat Wicker

 


ReplyQuote
starnovice
(@starnovice)
Eminent Member
Joined: 10 months ago
Posts: 31
2019-08-22 2:10 am  

Arduino on Linux

The ROS tutorial on this is really quite straight forward and should not be feared.  It is even a good project if you only have a short amount of time.  The main issue is that ROS uses what is called rosserial to be able to talk to the Arduino that does not have an Ethernet hat.  (For an Ethernet hat here is a link to a code sample: Ethernet Arduino . I don't have a hat so can't try it.)

The commands to get you up and running are first installing the rosserial and the rosseerial-arduino (I have melodic Ros so if you have different version change the version name to match):

sudo apt-get install ros-melodic-rosserial-arduino
sudo apt-get install ros-melodic-rosserial

The you change directory to the Arduino IDE sketchbook/libraries, make sure you don't have an old version of the library, then build the arduino library (don't miss the period at the end of the command the means you want to build it in this directory.  That kept me scratching my head, no wonder I don't have any hair.)

cd <sketchbook>/libraries
rm -rf ros_lib
rosrun rosserial_arduino make_libraries.py .

The useful thing is once you have this library build you can copy it to your Windows version of IDE and use it there.  So you can program the Arduino now from either the Linux system or the Windows system.

Once you have it installed go to the IDE's example menu (be sure you restart the IDE after building the library)  and you will see several examples to use.  They are documented here: http://wiki.ros.org/rosserial_arduino/Tutorials

Have fun.


ReplyQuote
Spyder
(@spyder)
Honorable Member
Joined: 10 months ago
Posts: 659
2019-08-22 7:49 am  

@starnovice

The only caveat I'd like to add so far is that you can't install arduino from apt-get. I mean, you can, but, it's gonna be an old version that doesn't work well. Lots of buttons left out. You need to install the latest (that I found) version, which is "arduino-1.8.9-linuxarm.tar.xz", and then, don't follow the instructions for installing

"arduino-linux-setup.sh" didn't work on the Pi, it might be for regular linux, I just used "install.sh" and that worked fine

Oh, and get the 32 bit. 

I got the Pi3 and the Pi4 working with the arduino. I haven't tried the Jetson yet

On the Pi4, when I plugged it in, the USB picked it up nicely

lsusb

And it labeled the port for the arduino without a problem

arduinoport

arduinoloaded

And the IDE picked it up and labeled it with all the info which my windows machine seems rather disinclined to do

arduinoloaded

Haven't tried the ROS yet on the Pi4 tho. All the images I have for ROS are for the Pi3


ReplyQuote
starnovice
(@starnovice)
Eminent Member
Joined: 10 months ago
Posts: 31
2019-08-22 3:13 pm  

@spyder

I'm wondering if you can't compile a ros image for the Pi4.  I could get it to work on a Pi3+ but I think I ran out of memory and it hung up.


ReplyQuote
Spyder
(@spyder)
Honorable Member
Joined: 10 months ago
Posts: 659
2019-08-22 4:18 pm  

@starnovice

I ran into the same problem with both ros and tensorfow (before they made it simple) my solution to that was to install an 8g usb thumb drive and assign the whole thing as swap. It worked after that

The os for the pi4 is newly refabbed, and i dont know if it's campatible yet. I haven't tried it yet, too many detours


ReplyQuote
starnovice
(@starnovice)
Eminent Member
Joined: 10 months ago
Posts: 31
2019-08-22 5:15 pm  

@spyder

That is a good idea about the swap space, I will have to do that and try again.


ReplyQuote
Page 1 / 2

Please Login or Register