Full installation instructions
Back to Robobot
Installation instruction on the raspberry
Install raspberry pi version of Linux on a micro-SD, instructions can be found here:
Install on raspberry first section (prerequisites).
Raspicam
A rather short raspberry pi camera API is available from https://www.uco.es/investiga/grupos/ava/node/40. And can be downloaded from https://sourceforge.net/projects/raspicam/files/,
or get the file from sourceforge with no GUI, with:
wget --no-check-certificate -O raspicam-0.1.4.zip https://downloads.sourceforge.net/project/raspicam/raspicam-0.1.4.zip?r=https%3A%2F%2Fsourceforge.net%2Fprojects%2Fraspicam%2F%3Fsource%3Dtyp_redirect&ts=1486483484&use_mirror=netix
Once fetched and available on the raspberry, then
Unpack and install:
unzip raspicam-0.1.3.zip cd raspicam-0.1.3 mkdir build cd build cmake .. make sudo make install sudo ldconfig
The library is installed in /usr/local, and therefore to make cmake find it the path needs to be added to startup configuration, in file ~/bashrc
export CMAKE_PREFIX_PATH=/usr/local/lib
(needs a re-logon to be activated)
Userland-master
To be able to install mobotware (not used pt on robobot)
Follow the guide under REGBOT for userland-master install - Install on raspberry
DNSMASQ
To enable the robobot to be connected directly to a PC, then it is easier if the robobot provides an IP for the PC.
Install DNSMASQ
sudo apt install dnsmasq
allow dnsmasq to provide IP to pear-to-pear networks Edit the /etc/dnsmasq.conf (nano is a small text editor, fine for editing configuration files owned by Linux root)
sudo nano /etc/dnsmasq.conf
find and change/add the following line (for eth0)
dhcp-range=eth0,192.168.0.100,192.168.0.150,12h
To work, the eth0 must have an IP, if noone provides one, change /etc/dhcpcd.conf (dhcp client deamon) to have a default IP, if no DHCP server is available
Add the following lines at the end of /etc/dhcpcd.conf to have a fall back behaviour for eth0 and eth1.
# define static profile profile static_eth0 static ip_address=192.168.0.2/24 static routers=192.168.0.1 static domain_name_servers=192.168.0.1 # fallback to static profile on eth0 interface eth0 fallback static_eth0
This will also give a default IP for an eventual second network (usb-to-cable) if needed
Now, after a reboot, you should be able to connect a PC directly with at network cable to a PC, and the PC should get an IP from the raspberry, so now
ssh local@192.168.0.2
ROBOBOT demo C++
This is an examplesoftware in C++ to access both raspberry camera and REGBOT, and with an example mission controlled from the raspberry.
Get the robobot software from the svn repository:
svn checkout svn://repos.gbar.dtu.dk/jcan/regbot/mission mission
To be able to compile the demo software CMAKE needs also to use the user installed library (raspicam installed above), so add the following line to ~/.bashrc:
export CMAKE_PREFIX_PATH=/usr/local/lib
Then build Makefiles and compile:
cd mission cd build cmake .. make
Then test-run the application:
./mission
It should print that the camera is open and connected to robot (bidge).
USB as SOCKET for REGBOT client
This is not compatible with use of ROBOBOT_BRIDGE, so don't ise it here
To use the REGBOT client through (not on) the raspberry pi, the serial connection /dev/ttyACM0 on the raspberry can be converted to a network port by SOCAT. So install:
sudo apt install socat
Add the following line to /etc/rc.local
socat TCP-LISTEN:24001,fork,reuseaddr FILE:/dev/ttyACM0,raw,echo=0 &
This creates a TCP socket server, listening to port 24001 and piping /dev/ttyACM0 to the socket (with no local echo). This only takes the data from the /dev/ttyACM0 when a client is connected to the socket.
Works after a reboot, or the same line on the command prompt.
This is good for configuring the REGBOT (in REGBOT client connect wifi to IP of robot, e.g. 192.168.0.2).
On the windows computer install "winscp" and use it to copy files to and from the raspberry disk as needed.
On the Linux PC use sshfs for sharing. Make an empty directory for the mapped disk, and then mount
mkdir robobotdisk sshfs local@192.168.0.2: robobotdisk
Unmount with
fusermount -u robobotdisk
Or use "sudo unmount robobotdisk"