I want to post some minor advances I've made on my robot without getting
into the seemingly never ending debate about micro-controllers vs PC type
systems. So, can we lay off the micro-controller vc PC debate for this
post?
Anyway, if you are using Linux on your robot, or may be tempted to try it,
here are some quick time-savers and potentially cool things:
First of all, my robot uses 802.11G wireless networking. Radio controlled
operation is just an extension of normal wireless networking.
The programs on my website: http://64.46.156.80/robot/ are command line
based utilities. Using ssh, a remote console, I can use the command line
utilities as if I was sitting using a keyboard and display on the robot
while my desktop machine or laptop.
Using the "ffmpeg" package included on most Linux distributions, I can
stream my QuickCam over the internet. Using any network aware viewer on
almost any machine, I can see the video output of the camera. It is
amazingly easy:
# This runs the video server
ffserver -f /usr/share/doc/ffmpeg-0.4.8/doc/ffserver.conf &
# This runs a program to read the quickcam and produce mpeg
# The "-an" parameter disables audio
ffmpeg -r 8 -an -vd /dev/video0 http://localhost:8090/feed1.ffm &
(Streaming seems unusable for navigation in that it is pretty slow, but I'm
looking for a better solution.)
Most Linux distributions, if you are unfamiliar with Linux, have a fairly
sophisticated startup which can be a bit daunting, but don't be too
freaked, look for the file: "rc.local", typically located in "/etc/rc.d."
Just add the commands you want to run at the bottom of this file. (The UNIX
purists will choke on this one, but it isn't all that "bad")
Since the robot does not have a keyboard or display, but it does have
speakers, I use the librsynth's "say" program, like this:
/usr/local/bin/say $(/usr/local/robot/robot diag)
The above line will execute "robot diag" and take its output and pass it to
"say" as a program command line argument, causing the robot to speak the
results.
One problem I ran into is that the synth is usually customized by the user,
so Mandrake (the version of Linux I am using) didn't set the output volume
at startup and for some reason it couldn't find the presets. (probably
because there was no "user."). So I added the program to set the sound up,
aumix, in rc.local BEFORE the commands that will be sent to "say."
/usr/bin/aumix aumix -v90 -w90 -c80
(You may need to install "aumix" on some distributions as it is not always
installed if you have a desktop like GNOME or KDE)
So, right now, I can drive the robot from a remote computer, view the camera
images, it reports its status at startup, and works pretty darn well.
One last thing, "nice." Since my motor control system runs as a process
under Linux, it sort of has to run at a fairly high priority, so use the
program "nice" to start it with a negative "nice" values, making the
program "less nice."
into the seemingly never ending debate about micro-controllers vs PC type
systems. So, can we lay off the micro-controller vc PC debate for this
post?
Anyway, if you are using Linux on your robot, or may be tempted to try it,
here are some quick time-savers and potentially cool things:
First of all, my robot uses 802.11G wireless networking. Radio controlled
operation is just an extension of normal wireless networking.
The programs on my website: http://64.46.156.80/robot/ are command line
based utilities. Using ssh, a remote console, I can use the command line
utilities as if I was sitting using a keyboard and display on the robot
while my desktop machine or laptop.
Using the "ffmpeg" package included on most Linux distributions, I can
stream my QuickCam over the internet. Using any network aware viewer on
almost any machine, I can see the video output of the camera. It is
amazingly easy:
# This runs the video server
ffserver -f /usr/share/doc/ffmpeg-0.4.8/doc/ffserver.conf &
# This runs a program to read the quickcam and produce mpeg
# The "-an" parameter disables audio
ffmpeg -r 8 -an -vd /dev/video0 http://localhost:8090/feed1.ffm &
(Streaming seems unusable for navigation in that it is pretty slow, but I'm
looking for a better solution.)
Most Linux distributions, if you are unfamiliar with Linux, have a fairly
sophisticated startup which can be a bit daunting, but don't be too
freaked, look for the file: "rc.local", typically located in "/etc/rc.d."
Just add the commands you want to run at the bottom of this file. (The UNIX
purists will choke on this one, but it isn't all that "bad")
Since the robot does not have a keyboard or display, but it does have
speakers, I use the librsynth's "say" program, like this:
/usr/local/bin/say $(/usr/local/robot/robot diag)
The above line will execute "robot diag" and take its output and pass it to
"say" as a program command line argument, causing the robot to speak the
results.
One problem I ran into is that the synth is usually customized by the user,
so Mandrake (the version of Linux I am using) didn't set the output volume
at startup and for some reason it couldn't find the presets. (probably
because there was no "user."). So I added the program to set the sound up,
aumix, in rc.local BEFORE the commands that will be sent to "say."
/usr/bin/aumix aumix -v90 -w90 -c80
(You may need to install "aumix" on some distributions as it is not always
installed if you have a desktop like GNOME or KDE)
So, right now, I can drive the robot from a remote computer, view the camera
images, it reports its status at startup, and works pretty darn well.
One last thing, "nice." Since my motor control system runs as a process
under Linux, it sort of has to run at a fairly high priority, so use the
program "nice" to start it with a negative "nice" values, making the
program "less nice."
Re: Robots and Linux, cool stuff.
Yes, and you can do pretty much everything on the command line.
I'm working on a simple java server that will handle most of
the teleoperation. It is neat to have a large R/C vehicle. :)
I'm trying to get a good graphical representation of the differential
drive so that I can control it easily via a mouse.
I've thought of a virtual joystick, but that isn't intuitive for
me.
I guess it's still command line for me also.
Perhaps you could set the resolution of your webcam lower so that
you can send more frames per second?
Why should they choke? This is what rc.local (or its equilivent on
various systems) was made for.
That is good, but I'm waiting on a display. The PSONE LCD runs off of
both video out and VGA (if the VGA has CSYNC). I'm going to try it as
a video device because that's easier to setup.
Or you can run the command as
su robot -c 'this is the command'
where robot is your "user".
At the moment I'm bad and do everything as root. Yes, my robot is a
rolling security hole. Before I take it much further I have to
make my utilities work for a non-root user.
I'm trying to look for a way to use the monitor for graphics without
going as heavy-duty as X.
Congrats!
And don't forget "renice", just in case you forgot to be less nice
at startup.
--
D. Jay Newman
http://enerd.ws/robots/
Re: Robots and Linux, cool stuff.
Naw, I've done a lot of different settings. It has to do with mpeg encoding,
I think. Still looking.
Because they all want it to be run by the various run levels.
Depends, I'm sure.
This is in the "rc.local" file, you are running as root already.
I'm more or less in the same place.
X can be pretty light weight and give you the added bonus of transparent
network GUI.
Only nice the program that is run.
Re: Robots and Linux, cool stuff.
Well, please let us know when you've found something that works. I've
haven't tried streaming yet.
Well, otherwise I have to setup some sort of H/VSync to CSync
converter. And also it eats a decent amount of power.
Yes, but you don't always want the command to run as root.
The su command will let you set your user to anybody (well,
as long as you're already root).
It's not difficult, it's just nitpicking. And I'm on a deadline. :(
Adding in the network is fairly heavy weight for me. All I want is to
use the LCD as a monitor for startup and to add some character to
Groucho as graphics.
--
D. Jay Newman
http://enerd.ws/robots/
Re: Robots and Linux, cool stuff.
Probably a little more difficult on linux than windows, but if
you have a computer on the robot, you might want to try a web
based control setup. Running an apache webserver on the robot
computer would allow you to remotely run the command line
applications on the computer via apache's CGI functions. You
could make a web page based gui on the remote computer for
controlling the robot. The below is not a robot, but shows how
easily servos (and other control setups) can be positioned via
simple mouse clicks. You can also get varios status info from the
robot if desired. Not much real programming beyond using notepad
to copy/paste.
http://www.geocities.com/zoomkat/ezservo1.htm
Re: Robots and Linux, cool stuff.
I'll take the "debate" one step further: When I first started with my
wireless PC based bot, G was fairly new and I could not find a Linux driver,
so I made it dual boot Red Hat/Win 2K. As if using an actual motherboard
isn't enough to rattle some cages, I got ol' Bill on mine also.
On the Win side I was able to write a quick application that would show both
cams on the screen at once and have a few buttons for driving around. I
then installed VNC so I could control the desktop over the network. It
actually works well. I can easily drive it using the visual feedback from
the cams. The main loop around my downstairs has a Wireless Dead spot and
that stinks, but now that I know where it is I can command the bot to drive
past it. I still need to make my pan/tilt work so I can look around. Also,
I have the problem that my bot is tall and the top can hit the edge of a
table where the sensors below just see open space ahead so it can topple.
I'm planning to add a gyro/accelerometer setup in order to act as an "all
other sensors failed to let me know about some obstacle and I'm about to
topple" sensor.
Anyway, since things seem to be coming along nicely on the Linux side, I
think I'll get me some G drivers and see what I can do. Can you use the
technique you describe to stream two cams? I have dual firewire cams
because they deliver uncompressed video which I was told is better (or even
required) of doing clever image analysis tricks. What I was not told but
later found out is that they also need to be synchronized. But I'll tackle
that problem later. For now, I'm just interested in getting the video to
stream back to my win desktop PC over the wireless.
--TE
Site Timeline
- » Graduating..what should I do next?
- — Next thread in » General Robotics Forum
-

- » Looking for a certain transducer
- — Previous thread in » General Robotics Forum
-

- » evoMUSART 2013: First CFP (with correct dates)
- — Newest thread in » General Robotics Forum
-

- » Heat pump refrigerant change to R-22 substitute
- — The site's Newest Thread. Posted in » General Metalworking
-

- » DCC sound question
- — The site's Last Updated Thread. Posted in » Model Railroad Forum
-


Subject





