As part of my project, there are two, open-source simulators and control systems that one can use. The first is a Linux-only system called Player, (the control system) and stage, (the simulator.) The other can be used in either Linux or Windows, and is called Aria, (an API for writing control software) and MobileSim, (the simulator.)
I once wasted an entire day with a colleague trying to get player and stage to install and run properly. That day included reinstalling the operating system (twice) and then downloading the EXACT configuration of libraries that the highly brittle system needed to be perfect before it would run.
In a day I had downloaded Aria for Windows, written a simple app, and was able to control the robot in the simulation. "Brilliant" I thought, "I just need to recompile it and everything will work."
Oh, how foolish these words seem now. First of all, there was the business of installing all of the right software on to the Debian machine. Most of the things we wanted went on fine, but Aria, only comes as an rpm - and Debian doesn't usually do rpms. Eventually we persuaded the rpm tool that it would be a good idea to help, (after it had complained about not being able to find a dependency that was exactly where it complained it wasn't.) We ran the simulator and all was well.
Then to recompile the program. Now it could be said that the command line shouldn't scare a PhD Computer Scientist, and it doesn't - I just don't understand why anyone would put themselves through it voluntarily!
First things first - specify an output, "-o outputProg". Easy. Now link to the Aria library... "-lAria" - great.
Compile....
"Can't find "Aria.h"" Dammit.... Ok, tell the compiler where all the Aria files are installed, (fair enough - had to do the same for Win)... "I\rar\rar\rar".
Compile...
"Can't find "aria.h". Aghhh - they should of just made it say "Linux doesn't do case-insensitive searching - good luck with that, bitch!" So I go through my source code and make sure everything says "Aria.h" not "aria.h".
Compile...
"Can't find library Aria". Hmm - now this one has me stumped... I must need to specify where it is change "-lAria" to "-l/rar/rar/rar/Aria"
Compile....
"Can't find library /rar/rar/rar/Aria" Dammit! A quick chat to our Linux guru, (don't even THINK about trying to use Linux without having a Linux guru to hand, try reading the dodgy documentation in the Vim editor and see why!) and he points out that you can't specify where libraries are with that - you need to tell it where to search. Change "-l/rar/rar/rar/Aria" back to "-lAria" and add "-L/rar/rar/rar"
Compile...
Compiled!
OMG! It compiled - praised be. Now to run it... No not just the output file name - you need a "./" in front of it... "./outputProg"
"outputProg Running...
Doing init...
Doing comms to robot...
Segmentation Fault"
Aghhhhhhhhhhhhhhhhhhhhhhh!!!!! There are few things that fill my heart with more dread than a Linux command prompt bearing the words "Segmentation Fault".
So I try to debug. First of all I need to recompile again, adding the intuitive, "-g" option to tell it to include debug info. Then I try to use gdb... Not on your life - If God had wanted us to debug at the command prompt, he'd of given us massive wings, so we couldn't hurt ourselves when we finally gave up and threw ourselves out of the window. No - its time to install another program. Firstly I try xxgdb - the visual front end for gdb - sounds great! Install..... run.... open program.... run program.... Segmentation fault occurs in the same place - good. Put in a break point..... run. Yup, we're stopped. "Step" to the next line.... Its stepped INTO the function, and because its open source code, it keeps on stepping, and stepping and stepping AGGHHHHHHHH why would you not have a "step over" button, or a "step out of" button????!!! What was that nice looking one that I've seen the guru use? ddd, that's the one! Install..... Add program..... run... Step... IT'S ONLY BLOODY STEPPING INTO! I look frantically for another button - but no. So I go through my code and add breakpoints to EVERY LINE and then use continue... Except that the fault isn't happening in that file, its happening in another. Time to open a different file... file, open source.... aha - a list of available files... Where's mine? hmmm - I know that its called X , but the list goes straight from W to Y....
Oh, God No....
Oh my....
But the list is huge, surely it is...
No, it isn't sorted in any way shape or form. I actually have to click through it!! Ah ha - a filter box thank goodness.... Except the filter box is read-only, its just there to get your hopes up! But no, you have to scroll through the list manually - I can hear the voices of greasy-haired Linux programmers, that will never reproduce, saying "that'll teach you for trying to use a GUI you Windowsy Bastard".
I'm still yet to track down the problem. But I wrote a different program from scratch that doesn't do anything clever with the robots, except make them spin round on the spot for 10 seconds and then stop. Except of course the documentation was wrong, and despite the assurances of the websites, in the version of Linux I have, "sleep(X)" X is specified in SECONDS not milliseconds as it is in the rest of the world.... Excuse me, I have to attend to a robot with sea-sickness after 1000 seconds of revolutions......
But that's why Linux is rubbish. The GUIs are designed by Windows-hating zealots that seem to be out to get you for not using the almighty Bash; the libraries change more often than a Linux programmer's pants, (almost 6 monthly cycles) ; and the delicate stack of dependencies collapses around your ears as your mp3 player needs version X and Y, but the compiler needs version T and V but.......
Of course it has improved security! For a start, you couldn't guarantee a Linux virus would be able to find the libraries it needed on EVERY machine, and once you had access to your Linux Zombie PC, you'd have to overcome the ultimate security challenge... Getting Linux to actually do what you want.
I shall persevere, and one day I shall have a working robot in Linux and Windows. But for now, I'll be sticking with Bill, because the words/phrases that he doesn't understand like "security" and "unfair monopoly" have been lost to make room for his extensive definitions of "user-friendly" and "uniform".
Get stuffed Tux, come back Clippy, all is forgiven, yes it does look a bit like I'm writing a letter doesn't it....