Software

License

This software is in the public domain.

Werc App

Werc is a web framework written in the Plan9 shell rc. The main page http://robot.echoline.org/ is a werc app which you may download here:

https://bitbucket.org/echoline/robot/downloads

or view the source here:

https://bitbucket.org/echoline/robot/src

Please also note this is made to work with my templates. controls.htm will need modification. setting up werc is beyond the scope of this document.

The app needs files in specific places to work:

mkfifo /tmp/move
mkfifo /tmp/voice

These files need to be set up as fifos. You read the source, make the fifo, cat it however you want to receive letter commands. That's the API, essentially.

Setting up the video feed is an exercise left to you, look up icecast or crtmpserver.

ROS Programs

ROS is a pretty OK framework, though of course i wish it were all over 9p. the networking aspect makes it interesting, though. I can plug in and use a gamepad to drive the robot anywhere i can run the gamepad program, for instance. setting up ros is beyond the scope of this document.

https://bitbucket.org/echoline/ros/downloads/

https://bitbucket.org/echoline/ros/src/

arduino

an arduino handles the motors' pwm control on the MMP5 and a battery monitor on an analog pin connected to a voltage divider across the battery. the program source ros.ino is available in my ros src link. setting up the arduino ide for use with ros is beyond the scope of this document.

https://bitbucket.org/echoline/ros/raw/52e524d7ea0002527fbf05f9f81e4c4f4d2c3287/ros.ino

move

this is what interfaces with the /tmp/move fifo. basically:

tail -f /tmp/move | move &

of course this is more interesting over ssh.

move requires my arduino program and:

rosrun rosserial_python serial_node.py &
rosrun kinect_aux kinect_aux_node &

video

outputs raw video (bgr24) suitable for use with ffmpeg such as:

video | ffmpeg -f rawvideo -s 640x480 -pix_fmt bgr24 -i - -qscale:a 1 -qscale:v 7 -r 60 -s 200x150 -f ogg -vcodec libtheora - | oggfwd echoline.org 8000 sourcepw /robot.ogv &

i use this program with my kinect and:

roslaunch openni_launch openni.launch &

you can also just use the gspca_kinect kernel module and:

ffmpeg -f video4linux2 -i /dev/video0 -qscale:a 1 -qscale:v 7 -r 60 -s 200x150 -f ogg -vcodec libtheora - | oggfwd echoline.org 8000 sourcepw /robot.ogv &

to avoid using this buggy program of mine altogether, if you do not wish to use openni.launch for depth camera, etc.

gamepad

allows control with a gamepad, and with udev automatically when it's plugged in. I use this rule:

ACTION=="add" ATTRS{idVendor}=="046d", ATTRS{idProduct}=="c218", RUN+="/bin/su - eli -c /home/eli/gamepad.sh"

You can find the vendor and device (product) ids with the program lsusb.

battery

this is a simple battery monitor. feel free to add it to crontab, though i can't get it to work:

*/5 *   * * *   eli /home/eli/battery.sh

voice

subscribe a ros topic for text-to-speech via espeak

rostopic pub -1 /voice std_msgs/String "test"

this program is stupid and useless, I just cat /tmp/voice into an espeak command, which works better I've found.

don't be shy!

it's all public domain :) build them! i want to see one in every nerd's home by 2020.