Robobot B

From Rsewiki
(Difference between revisions)
Jump to: navigation, search
(Display of IP)
(Development notes)
 
(24 intermediate revisions by one user not shown)
Line 1: Line 1:
This page is is for development nodes and user description of the simplified version of Robobot
+
Robobot B is a simplified (2024) version of the old Robobot
  
=Robobot B description=
+
=Robobot=
  
This section is intended for users.
+
[[File:robobot-in-blocks-2024.png | 600px]]
 +
[[File:robobot-design-2024.png | 400px]]
  
 
==Overview==
 
==Overview==
  
[[Robobot architecture]]
+
This section is intended for users.
  
== Hardware==
+
* [[Robobot architecture | Software overview]] and blocks description.
 +
* [[Robobot software description | Software description]] and examples.
 +
* [[Raspberry Pi directory structure for Robobot]]
 +
* [[Robobot and MATLAB]] use of logfiles.
 +
* [[Robobot hardware]] items.
 +
* [[Robobot circuits]]
  
Plastic
+
==Development notes==
 
+
==Electronics==
+
 
+
PCB
+
 
+
==Software on Raspberry==
+
 
+
===Software repository===
+
 
+
===Directory structure===
+
 
+
On the Raspberry the main directory and files are:
+
 
+
/home/local/
+
+-git        - Directory for libratyes available from a GIT repository (mostly Teensy/arduino libraries).
+
|  +-CLI11  - Directory with command line interface library CLI (from github)
+
+-svn        - Directory for software from the subversion repository (Robobot specific software).
+
|  +-regbot  - Directory for the Teesny software (firmware) this part is called Regbot.
+
|  |  +-regbot_gui Debug app for Regbot.
+
|  |  +-regbot    The firmware source code.
+
|  +-robobot - Directory for the Robobot specific code.
+
|  |  +-setup      Directory with some default configuration files.
+
|  |  +-raubase    The basic Raspberry Pi software for Robobot.
+
|  |  |  +-src    Source code
+
|  |  |  +-build  Build directory with Makefile
+
|  |  |  |  +-log  Directory for data-monitoring logfiles
+
|  |  |  CMakeList.txt  Directives to generate a Makefile using cmake
+
|  |  |  robot.ini      Configuration and calibration file
+
|  |  +- ip_disp  Small app to update the IP address of the Raspberry.
+
|  |    log_ip_dist.txt Logfile for IP and temperature monotoring
+
|  +-log    - Directory with logfiles from ip_disp (IP, users and CPU temperature)
+
on_reboot.bash  - Script to start applications that should start after a reboot (ip_disp)
+
 
+
===Robot software===
+
 
+
==Firmware on Teensy==
+
 
+
===Description===
+
 
+
===Compile tools===
+
 
+
===Upload to Teensy===
+
 
+
=Development notes=
+
  
 
This section is for development notes.
 
This section is for development notes.
  
==Software installation Raspberry Pi==
+
* [[Robobot install on Raspberry]]
 
+
* DTU network and time setup: [[Network setup]]
 
+
* [[Enable autostart]] and IP display
===Install on Raspberry===
+
* [[Robobot base software installation]]
 
+
* Setup of [[Robobot webcam server]]
Barebone installation (Raspbian GNU/Linux 11 (bullseye) as of July 2023)
+
* Old [[robobot]], instructions are mostly depricated
 
+
[[Raspberry base install]]
+
 
+
* make a bootable SD card
+
* Make a new user called local and set the group permissions
+
 
+
sudo adduser local gpio
+
 
+
* Install general-purpose development packages
+
 
+
===Additional packages===
+
 
+
Install the following packages:
+
libreadline-dev
+
libopencv-dev
+
libgpiod-dev
+
gpiod
+
cmake
+
subversion
+
aptitude
+
telnet
+
ntp
+
ntpdate
+
nmap
+
lsof
+
sudo apt install libreadline-dev libopencv-dev libgpiod-dev gpiod cmake subversion aptitude telnet nmap lsof
+
 
+
and, if available
+
sudo apt install libcli11-dev
+
 
+
Install command line interface library (if not found by 'apt install libcli11-dev')
+
cd
+
cd git
+
git clone https://github.com/CLIUtils/CLI11.git
+
 
+
===User and network (WiFi)===
+
 
+
Connect to DTU Wifi
+
 
+
* use NTP (network time protocol) with DTU network (require ntp and ntpdate packages)
+
* connect to DTU network without showing secret password
+
 
+
Instructions here [[Network setup]]
+
 
+
===Enable autostart===
+
 
+
====Display of IP====
+
 
+
Start app to display IP on Regbot display, log CPU temperature and synchronize hostname
+
 
+
Make an on-rebbot script in the home directory
+
 
+
cp ~/svn/robobot/setup/on_reboot.bash ~/
+
 
+
This file is something like:
+
 
+
#!/bin/bash
+
# script to start applications after a reboot
+
#
+
# run the app to show IP of raspberry on the Teensy display.
+
mkdir -p /home/local/svn/log
+
cd /home/local/svn/log
+
# save the last reboot date
+
echo "Rebooted" >> rebootinfo.txt
+
date >> rebootinfo.txt
+
../robobot/ip_disp/build/ip_disp &
+
# save PID for debugging
+
echo "ip_disp started with PID:" >> rebootinfo.txt
+
pgrep -l ip_disp >> rebootinfo.txt
+
exit 0
+
 
+
Use crontab to run this script at reboot
+
 
+
crontab -e
+
 
+
Add this line at the end:
+
@reboot /home/local/on_reboot.bash
+
 
+
====Hostname update====
+
 
+
A script updates the Raspberry Pi hostname, with the name in ''~/svn/log/robotname''.
+
The script ''rename_host.bash'' is:
+
#!/bin/bash
+
hn=`hostname`
+
f="/home/local/svn/log/robotname"
+
if [ -f $f ];
+
then
+
  nn=`cat $f`
+
  yy= $(expr length $nn)
+
  if [ $yy -gt 2 ];
+
  then
+
    if [ $hn != $nn ];
+
    then
+
      hostnamectl set-hostname $nn
+
      # seems like /etc/hosts is not updated, but /etc/hostname is
+
      sed -i "s/$hn/$nn/g" /etc/hosts
+
    else
+
      echo Same hostname, all is fine.
+
    fi
+
  fi
+
else
+
  echo "File >" $f "< not found."
+
fi
+
 
+
The script needs to be run as root, it is therefore set to run as part of the boot process.
+
 
+
Create the script in /etc/init.d
+
 
+
sudo nano /etc/init.d/host_rename.sh
+
 
+
Enter the following lines into the new file
+
 
+
#!/bin/bash
+
bash /home/local/svn/robobot/setup/rename_host.bash
+
 
+
Make the file executable and add it to run-level 2 (before networking is started)
+
 
+
sudo chmod +x /etc/init.d/host_rename.sh
+
sudo ln -s /etc/init.d/host_rename.sh /etc/rc2.d/S99host_rename
+
 
+
The script is then executed when the Raspberry boots, and if the hostname does not match that of the Teensy, then the hostname is modified.
+
 
+
 
+
===Robobot base software===
+
 
+
To make the initial copy from the repository
+
 
+
cd
+
cd svn
+
svn checkout svn://repos.gbar.dtu.dk/jcan/robobot
+
 
+
To update with a new version
+
 
+
cd
+
cd svn/robobot
+
svn update
+
 
+
==Teensy==
+
 
+
Software tool chain installation
+
 
+
==Old Robobot pages==
+
 
+
[[robobot]] an extension to Regbot with a raspberry pi for more extended missions, but uses mission code in Teensy, like Regbot.
+

Latest revision as of 16:39, 9 January 2024

Robobot B is a simplified (2024) version of the old Robobot

[edit] Robobot

Robobot-in-blocks-2024.png Robobot-design-2024.png

[edit] Overview

This section is intended for users.

[edit] Development notes

This section is for development notes.

Personal tools
Namespaces

Variants
Actions
Navigation
Toolbox