Robobot on Raspberry PI
(→Software packages) |
(→Get ROBOBOT and REGBOT source) |
||
Line 30: | Line 30: | ||
ln -s regbot/robobot_bridge | ln -s regbot/robobot_bridge | ||
ln -s regbot/regbotgui | ln -s regbot/regbotgui | ||
− | ln -s regbot/mission && ln -s regbot/robobot_bridge && ln -s regbot/regbotgui | + | svn co svn://repos.gbar.dtu.dk/jcan/regbot && ln -s regbot/mission && ln -s regbot/robobot_bridge && ln -s regbot/regbotgui |
==Update and compile== | ==Update and compile== |
Revision as of 18:07, 28 January 2021
Back to Robobot
Contents |
Software packages
Install the following paxkages on the Raspberry to get, run and maintain the Robobot software
sudo apt install subversion # to get the source code sudo apt install cmake # to be able co create Makefiles from a specification sudo apt install libopencv-dev # vision library sudo apt install htpdate # set data on DTU net sudo apt install subversion cmake libopencv-dev htpdate
Additional python packages used
- python3-pyqtgraph
- python3-numpy
- python3-serial
- python3-scipy
- pyqt5-dev-tools
sudo apt install python3-pyqtgraph python3-numpy python3-serial python3-scipy pyqt5-dev-tools
Get ROBOBOT and REGBOT source
This is probably installed already, otherwise use
cd svn co svn://repos.gbar.dtu.dk/jcan/regbot ln -s regbot/mission ln -s regbot/robobot_bridge ln -s regbot/regbotgui svn co svn://repos.gbar.dtu.dk/jcan/regbot && ln -s regbot/mission && ln -s regbot/robobot_bridge && ln -s regbot/regbotgui
Update and compile
On the raspberry there is the following directories:
$ cd $ ls mission Mission software skeleton that can also access the raspberry camera regbotgui Configuration GUI for REGBOT (python), a Windows executable can be found in course material. regbot/regbot Firmware for the REGBOT part robobot_bridge The connection software between the REGBOT, the small display, the remote control and the mission software
Update
All these source directories are already connected to a SVN repository, but probably need update, by
cd cd mission svn up cd ../regbotgui svn up cd ../regbot svn up cd ../robobot_bridge svn up
Compile
If there are updates, then they need a recompile (except qtgui).
Mission and Robobot_bridge has a 'build' subdirectory with a Makefile, REGBOT has the Makefile in the base directory.
Type
cd ~/robobot_bridge mkdir -p build # make a build directort -p accepts it may be there already cd build cmake .. # builds Makefile from CMakeLists.txt in parent directory ".." make -j4 # compile - using 4 CPUs cd ~/mission # to C++ version of mission control mkdir -p build # make a build directort -p accepts it may be there already cd build cmake .. # builds Makefile from CMakeLists.txt in parent directory ".." make -j4 # compile - using 4 CPUs
Start robobot_bridge
The ROBOBOT bridge should start automatically to open the display (showing IP and battery voltage) and optionally also camera streaming (must be installed first)
nano /etc/rc.local
add the following lines before 'exit 0' (close to the end)
# DTU fix for time over blocked network htpdate -q www.linux.org www.freebsd.org # start ROBOBOT bridge cd /home/local/robobot_bridge/build && ./robobot_bridge -a & # start camera streaming su - local /home/local/start-stream.sh &
Copy and 'shift-ctrl-v' will do
Comment out the last line (su - local /home/local/start-stream.sh &) if camera streaming should not start.
to stop streaming use (if started)
pkill mjpg_streamer
REGBOT software
The REGBOT is programmed with Arduino (and Teensyduino) and require these tools to be installed to compile and install the firmware See the installation procedure description in Software_installation.
The REGBOT software is in the ~/regbot/regbot directory
To compile it for the REGBOT version 4 hardware (red board) with a Teensy 3.5 processor board, go to the '3.5' subdirectory
cd ~/regbot/regbot/3.5 make -j4
If successful a regbot.hex file is generated and should be uploaded to the REGBOT Teensy 3.5 processor.
This can be done from a console with X-messages enabled.
ssh -X local@solvej.local
if the robot is 'solvej'.
NB! While programming all the pins on the processor are released, including the one maintaining power to the robot. This means that the red button on the board MUST be pressed during the MAKE UPLOAD command
cd ~/regbot/regbot/3.5 make upload
See the regbot directory for more details.