Raspberry Pi 3 Robot Image – Details

Image Use

– first connect a HDMI screen and USB keyboard and mouse. Then configure the wifi. Once Wifi is configured, it will boot automatically and you do not need a screen or keyboard/mouse connected to the Raspberry Pi 3. Note the IP adress, you will need it.

– xrdp is installed, so you can use a remote desktop (ubuntu e.g. the installed remmina remote desktop client, windows just use the installed remote desktop service, just type remote on bottom left of the windows screen). Just enter the IP adress of the Raspberry to connect. Username is “pi” and password is “raspberry”.

– alternatively you can connect via ssh by typing in your PC terminal „ssh -X -l pi ip.ad.dre.ss“ for example „ssh -X -l pi 192.168.0.27“ and type „exit“ to exit

– on the raspberry Pi screen “Applications” “system tools” “mate terminal” to start a terminal.

– then use „top“ to show all running processes. Terminate each program in the terminal by pressing ctrl+c

– each program is executed as root if you add “sudo ” before the program, example: “sudo raspi-config”

– use “raspi-config” to expand filesystem

– to make easy changes on files (like rc.local) that require root access type „sudo caja“. Then press STRG+h (ctrl+h)to show the hidden files.

– mjpg_streamer uses most calculation power (40%). It might be possible to reduce it by using mjpg_streamer in another mode with data compression. See google for details.

– there are interesting and easy possibilities to track a ball by colour with opencv. Got it running on another image but don’t have the details anymore.

– Note that the blinking of the mouth led only starts after about 1-2seconds of text.

Web Interface Use

– access the web interface by entering the robot IP adress in any browser (mobile or pc) in your local wifi network

– The robot video stream is shown if you scroll down

– You can do basic control of the robot with the web interface. To do this, enter text in the field shown below and then press “speak”

– use „7“ to speak text, for example enter „7hello-i-am-geero“ and press „speak“. Note that due to Html interface you have to replace all spaces with a „-“.

(Note: Due to html transmission changes, the following only works with the livecode PC SW:  Add “|x”with x=0..5 to change language. In livecode you do not need the „7“. Example: “Hallo|2” speaks german. 0=en 1=us 2=de 3=fr 4=es 5=it)

– use „4“ to make the robot move. If you for example created a movement file called „stand_up13“ with the PC SW (livecode) you can start it by typing „4stand_up13.111“ and press „speak“. Always add „.111“. It was planned to seperate movement files in 3 parts. Note: The file „4stand_up13.111“ is included in the image, so you can use it for a first test. However note that if your robot is not yet calibrated, it will not move in the intended way.

– You can play around with the user interface, it was planned to be used as a control board where you can create buttons for movements, however the freelancer did not get it running completely. Currently buttons don’t work. In edit mode you can create buttons. In control mode the buttons can be used. If you choose a filename, you can load and save the interface.

– You can play an mp3 file as follows: Place it in the folder /home/pi/catkin_ws/src/gero_sound/data. Just enter the mp3 name in the web interface or livecode sw. Example in web interface enter „7lichtschwert.mp3“ and press „speak“. The file is included in the image so you can use it for a test.

Using the PC software Livecode

 – If the PC sw does not show the lables, it can help to resize the buttons in livecode.

– in livecode you can use following commands for text „Mein name ist johannes. <break time = ‘500ms’> <pitch level=’200′>mein name ist johannes in hoch.</pitch> <speed level=’150′>mein name ist johannes in schnell.</speed><volume level=’200′>teste die lautstärke</volume>“

– You can play an mp3 file as follows: Place it in the folder /home/pi/catkin_ws/src/gero_sound/data. Just enter the mp3 name in the web interface or livecode sw. Example in livecode enter „lichtschwert.mp3“ and press „speak“. The file is included in the image. Do not enter additional text, just enter the mp3 filename.

More technical stuff for background knowledge

– basic file for robot startup is /etc/rc.local

– if you want the robot to run a script at startup, you can change the name of /gero_control/scripts/start_program2.sh to start_program.sh and change the content. You might need to make it executable after name change.

– Note: Playing of mp3 files is done with node tts. Mp3 node is not used for it and only for historical reasons.

– the webinterface is running on php and located at gero_control/data/interface

– the webinterface calls mjpg_streamer on port 8000 to show the video. You can also enter <ip_adress>:8000 in any browser in your wifi network to show the video

– Mjpg_streamer includes a small webserver. This is modified to allow web interface access to ros messages. its located at gero_control/mjpg_streamer/mjpg_streamer/www

– note: the web.cgi file in catkin_ws/devel/lib/gero_control/ needs to be copied to „gero_control/mjpg_streamer/mjpg_streamer/www“ in order to work

– acceleration values are shown with „rosrun gero_sense acceleration“. Currently they have no effect on the robot behaviour

– make scripts at gero_control/scripts executable (with right mouse klick…).

If you want to create an image on your own

– Following commands and sw needs to be installed in order for the robot sw to work

– make the „servod“ file in gero_move executable

– use raspi-config to switch on i2c bus and ssh and camera

cd ~/catkin_ws

wget ftp://ftp.gnu.org/gnu/cgicc/cgicc-3.2.16.tar.gz

tar xvf cgicc-3.2.16.tar.gz

sudo -s

mv cgicc-3.2.16 /usr/include

sudo apt-get install build-essential libcgicc5v5 libcgicc5-dev libcgicc-doc

apt-get update

You have to make the file “mjpg_streamer” executable!! on current image it is located at “/home/pi/catkin_ws/src/gero_control/mjpg_streamer/mjpg_streamer/” and started with file /etc/rc.local

mp3:

sudo apt-get install mpg123 libao-dev libmpg123-dev

svox pico:

sudo apt-get install libttspico-dev libttspico-utils sox libttspico0

 

php

 sudo add-apt-repository ppa:ondrej/php

sudo apt-get update

sudo apt-get install php7.0 php5.6 php5.6-cli

sudo apt-get install subversion libjpeg8-dev imagemagick libv4l-0 libv4l-dev

2 thoughts on “Raspberry Pi 3 Robot Image – Details

  1. 130s

    Thanks for the useful work!

    I couldn’t log in via ssh out of the box and had to log on to desktop, then remove openssh-server pkg and /etc/ssh, then install openssh-server again (re-installing openssh-server nor installing ssh pkg didn’t help).

Leave a Reply