Robobot

From Rsewiki
(Difference between revisions)
Jump to: navigation, search
(Software description)
(Overview)
 
(131 intermediate revisions by one user not shown)
Line 1: Line 1:
 
This page is for ROBOBOT, an extension of REGBOT with a raspberry pi and three wheels.
 
This page is for ROBOBOT, an extension of REGBOT with a raspberry pi and three wheels.
  
[[File:onshape-view.png|400px]]  
+
<!--[[File:onshape-view.png|400px]] -->
 
[[File:robobot_v5.png|400px]]  
 
[[File:robobot_v5.png|400px]]  
 +
[[File:melina_b.jpg|250px]]
 +
[[File:model-black.jpg | 450px]]
  
 
+
Figure 1. Robobot, The robot is a 3D-printed box with wheels and some electronics.
Figure 1. Robobot (V4 - left and V5 right), - see drawing https://cad.onshape.com/documents/97c36fb21a7a858c57c0af9f/w/0d867586bc28d7a9194d7ff3/e/ca0f539fa3eee3cfe0ed4130 and https://cad.onshape.com/documents/97c36fb21a7a858c57c0af9f/w/0d867586bc28d7a9194d7ff3/e/432d56e456affc4edca37317. The camera should be able to see the floor about 105mm in front of the robot (V4 robot).
+
The third, fourth and fifth generations are shown here.
 +
The 3D printed parts can be found here https://cad.onshape.com/documents/fef8699fcafb8aea780c8981/w/ce38e7fdd6cf8533b65e2c3c/e/4792e876b254f8e35059f863
  
 
== Overview ==
 
== Overview ==
  
 +
Note: Not valid (mostly) for the 2024 version of the robot
  
[[File:robobot-overview.png | 500px]]
+
===hardware ===
  
Figure 2. ROBOBOT is an extension of the simpler robot REGBOT. The REGBOT part controls the wheels, interfaces to sensors like an IMU (6 axis accelerometer and gyro), IR distance sensors (2), and a line edge detector. REGBOT further controls up to 3 servos and controls the battery supply. ROBOBOT is further equipped with a Raspberry Pi to allow more complicated missions. On the Raspberry Pi runs an interface process called robobot_bridge, this interfaces to a small 5-line display, to a game-pad and is the main interface to the REGBOT. The mission process collects data from the bridge and from ROBOBOT, and supplies the REGBOT with small mission snippets. The mission further holds the interface to the Raspberry Pi camera and may use the Open-CV library functions. The speaker allows debugging messages or other sound effects. By default battery voltage is announced at intervals.
 
  
 +
ROBOBOT is based on a navigation box with a line sensor (Edge sensor), an IR distance sensor and possibly some servos, all controlled by a microprocessor.
 +
For more intelligent behaviour and more sensors, there is a Raspberry Pi in the box too,
  
The ROBOBOT functions are available on the net at port number 24001. The existing user interface for REGBOT can access REGBOT functions from this port.
+
The motors are JGB37-555-EN with an encoder and a 1:10 gearing (up to about 400RPM (or ~6 RPS (rotations per second) on the output axle).
  
The gamepad can take over control of the mission fails, and can be used to initiate missions or other functions using the buttons and axis on the gamepad.
+
There is a video introduction and demo here https://www.youtube.com/watch?v=6dNr_F0dsHw (from 2022 - slight changes since)
  
More on the mission software here [[Full_installation_instructions#ROBOBOT_mission_demo_C.2B.2B]].
+
=== Navigation box overview===
  
==Getting started==
 
  
This section contains a quick-start guide for the user.
+
[[File:robobot-overview.png | 500px]]
It includes how to get the robot connected to Eduroam WiFi for easy access, an explanation of software and software structure and present a few examples to get the robots driving.
+
Press the link below to go to the instructions page.
+
  
[[Instructions for getting started]]
+
Figure 2. ROBOBOT is an extension of the robot REGBOT. The REGBOT part controls the wheels and interfaces to the sensors, like an IMU (6-axis accelerometer and gyro), IR distance sensors (2), and a line edge detector. The REGBOT further controls up to 5 servos and controls the battery supply. ROBOBOT is further equipped with a Raspberry Pi to allow more complicated missions. The Raspberry Pi runs an interface process called "Bridge" and is the main interface to the REGBOT. The mission process collects data from the bridge and the REGBOT and supplies small mission code snippets to be executed by the REGBOT part. The mission process may use the camera and the Open-CV library functions. The speaker allows debugging messages or other sound effects.
  
==Software description==
+
The ROBOBOT functions are available on the net at port number 24001. The existing user interface for REGBOT can access REGBOT functions from this port.
  
=== Mission software ===
+
The gamepad can take control of the robot if the mission fails and can be used to initiate missions or other functions.
  
For the mission block, there is a template that illustrates how to make s mission and send it to the robot in snippets.
+
==Software description==
  
[[Mission template software]]
 
  
 
=== Bridge software ===
 
=== Bridge software ===
  
The bridge - called robobot_bridge - runs on the Raspberry Pi and is started when the Raspberry Pi starts.
+
The Robobot bridge runs on the Raspberry Pi and is started when the Raspberry Pi starts, with initial commands from an initialization file (bridge.ini).
  
 
[[Robobot_bridge]] overview
 
[[Robobot_bridge]] overview
  
The autostart feature is implemented in '/etc/rc.local' with the following line
+
A bridge autostart feature is implemented in the script 'start_bridge.sh' in the home directory of the user 'local'.
 +
The is executed after a reboot.
  
cd /home/local/robobot_bridge/build && ./robobot_bridge -a &
+
The script can be amended with other commands that should be started after a reboot.
  
 
=== Mission software ===
 
=== Mission software ===
Line 51: Line 53:
 
The mission application is the primary user control for the robot.
 
The mission application is the primary user control for the robot.
  
[[Mission]] application overview.
+
[[Robobot mission]] application overview.
  
Mission is started manually from an ssh console.
+
The Mission application is started manually from an ssh console or added to the reboot script 'start_bridge.sh'.
 +
<!--
 +
===Python interface===
  
==Installation instructions==
+
A python-based control example - including especially camera streaming and interface.
  
This section contains the complete instructions for setting up a clean Raspberry Pi.
+
[[Python interface]]
 +
-->
  
Click on the link below to go the instructions.
+
==Setup issues==
  
Raspberry [[Full installation instructions]] including opencv-3, but stop before "Mobotware".
+
===Installation instructions===
  
Windows tools
+
This installation should be done already, to update see next section.
  
Use '''winscp''' (from https://winscp.net/eng/download.php?TB_iframe) to move files to and from the raspberry pi.
+
[[Raspberry and ROS]] (not finished)
  
Use '''putty''' (from https://www.chiark.greenend.org.uk/~sgtatham/putty/latest.html) to get terminal access to the raspberry.
+
[[Network setup]] (Wifi)
  
To connect to raspberry using a cable (from raspberry direct to a PC) requires that both has a manually set IP adress.
+
[[Robobot camera]] camera setup
The Raspberry side is 192.168.0.2, and you should probably manually set the IP of your PC to the same local net, e.g. 192.168.0.100.
+
  
There is a windows executable client for configuration and setting up the REGBOT part of the ROBOBOT. This is found in 'regbot/qtgui/dist/regbot.exe' in the raspberry, and can be fetched using winscp.
+
[[Access from Windows]] and Linux to Raspberry files (and graphics)
  
==Update ROBOBOT source==
+
[[Other windows tools]] - show Raspberry Pi graphics in Windows (usually very very slow)
  
On the raspberry there is the following directories:
+
[[Regbot GUI]] python setup and GUI install
  
$ ls
+
See [[Regbot calibration]] for sensor calibration.
  mission          Mission software skeleton that can also access the raspberry camera
+
  qtgui            Copy of the configuration gui (python files), and a windows executable in the 'dist' subdirectory
+
  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===
+
===Software update===
  
All these source directories are already connected to a SVN repository, but probably need update, by
+
Update of the maintained software is on the SVN (subversion) repository.
  
cd
+
SSH to the robot and go to these directories and do an update
cd mission
+
svn up
+
cd ../qtgui
+
svn up
+
cd ../regbot
+
svn up
+
cd ../robobot_bridge
+
svn up
+
  
===Compile===
+
cd
 +
svn up svn/fejemis/ROS/catkin_ws/src/bridge
 +
svn up svn/robobot
 +
svn up svn/regbot
  
If there is updates, then they need a recompile (except qtgui).
+
An update could look like this
 +
$ svn up svn/fejemis/ROS/catkin_ws/src/bridge
 +
Updating 'svn/fejemis/ROS/catkin_ws/src/bridge':
 +
U    fejemis/ROS/catkin_ws/src/bridge/udataitem.h
 +
U    fejemis/ROS/catkin_ws/src/bridge/ujoy.cpp
 +
Updated to revision 228.
  
Mission and Robobot_bridge has a 'build' subdirectory with a Makefile, REGBOT has the Makefile in the base directort.
+
NB! this may cause a conflict if some of the files are changed locally.
 +
Look at the filename and if it is not one of yours, then reply 'tc' (short for their conflict solution)
  
Type
+
=====Compile on bridge changes=====
 +
 
 +
If there are updated files for the bridge, then
 +
 
 +
cd
 +
cd catkin_ws
 +
catkin_make
 +
 
 +
=====Compile and upload on Teensy changes=====
 +
 
 +
cd
 +
cd svn/regbot/regbot/4.1
 +
make -j3
 +
 
 +
This makes a file "regbot.hex" that is then to be loaded as the new firmware on the Teensy processor.
 +
 
 +
There is a script that can do that from the command line:
 +
 
 +
./upload.sh
 +
 
 +
It will say something like
 +
 
 +
$ ./upload.sh
 +
Teensy Loader, Command Line, Version 2.2
 +
Read "regbot.hex": 314368 bytes, 3.9% usage
 +
Waiting for Teensy device...
 +
  (hint: press the reset button)
 +
 
 +
Press and hold the "POWER ON" and then press the button on the Teensy board.
 +
 
 +
The "POWER ON" button maintains power to the Raspberry Pi and the Teensy while uploading.
 +
 
 +
It will likely fail the first time but keep pressing "POWER ON" and repeat the command, and it should now say
 +
 
 +
$ ./upload.sh
 +
Teensy Loader, Command Line, Version 2.2
 +
Read "regbot.hex": 314368 bytes, 3.9% usage
 +
Found HalfKay Bootloader
 +
Programming.............................
 +
Booting
 +
 
 +
If you released the "POWER ON" in the process, the Raspberry Pi would power down. You then need to hold the "POWER ON" until the Raspberry has booted; you then re-login and rerun the script.
 +
 
 +
=====Make the upload.sh=====
 +
 
 +
If you have the "upload.sh", this step is not needed.
 +
 
 +
The command line upload is described here https://www.pjrc.com/teensy/loader_cli.html .
 +
 
 +
On a Raspberry you first need to install a USB library:
 +
 +
sudo apt install libusb-dev
 +
 
 +
Then get the code:
 +
 +
cd ~/git
 +
git clone https://github.com/PaulStoffregen/teensy_loader_cli.git
 +
cd teensy_loader_cli
 
  make
 
  make
to compile
 
  
If there is no makefile in the build directory, then make one first by
+
You should now have a "teensy_loader_cli" file; copy this to the svn/regbot/regbot/4.1 directory
  
  cd build
+
  cp teensy_loader_cli ~/svn/regbot/regbot/4.1/
cmake ..
+
  
===Robobot_bridge===
+
Make the "upload.sh" script
  
Robobot_bridge is started from the startup script /etc/rc.local, and thus need a reboot to start the new version,
+
cd ~/svn/regbot/regbot/4.1
 +
nano upload.sh
  
or start it manually (is also better for debugging, as it has some on-line help (type help after start):
+
Insert the following into the script:
sudo pkill robobot_bridge
+
cd ~/robobot_bridge/build
+
sudo ./robobot_bridge
+
  
After a REGBOT compile, the generated regbot.hex need to be loaded into the teensy, this can be done from the raspberry, if you have a screen and a keyboard (or a computer with an X-server), or from another computer, but requires that a USB cable to that computer and install the loader application (from https://www.pjrc.com/teensy/loader.html )
+
#!/bin/bash
 +
./teensy_loader_cli -v -w --mcu=TEENSY41 regbot.hex
  
==Setup issues==
+
Save with ctrl-s and exit with ctrl-x
  
A number of parameters in the REGBOT part of the robot needs setting.
+
Make the script executable
  
Some suggestions are provided here using the REGBOT GUI (available on the raspberry in the qtgui directory, see above):
+
chmod +x upload.sh
  
[[Regbot settings]]
+
== old instructions ==
  
== Hardware ==
+
Partially valid only.
  
The Robobot frame is 3D printed, the design is in onshape - see this link https://cad.onshape.com/documents/97c36fb21a7a858c57c0af9f/w/0d867586bc28d7a9194d7ff3/e/ca0f539fa3eee3cfe0ed4130, in the list of parts to the left it is possible to export (right-click) as STL files, that you can slice for your 3D printer.
+
[[Install on raspberry]] on a clean SD-card - raspi-config.
 +
 
 +
[[Setup user local]] adding a new user.
 +
 
 +
[[Linux tools]] - packages to install.
 +
 
 +
[[Access from PC]] (Linux or Windows).
 +
 
 +
[[Other windows tools]] - run graphics from Windows
 +
 
 +
[[Instructions for getting started]] - primarily network, Linux intro and wifi setup.
 +
 
 +
<!-- [[Full installation instructions]] - like Linux itself, sound and camera and how to connect the Raspberry disk to Windows and Linux computers. -->
 +
 
 +
==REGBOT setup ==
 +
 
 +
Several parameters in the REGBOT part of the robot need setting.
 +
 
 +
Some suggestions are provided here using the REGBOT GUI (available on the raspberry in the 'regbotgui' directory, and in a Windows version):
 +
 
 +
[[Regbot settings]]
  
The REGBOT part of the hardware is described on the [[Regbot_version_4]] page.
+
=== Hardware ===
  
Connection of the line display to the Raspberry pi is here [[Robobot Hardware]].
+
The Robobot frame is 3D printed, the design is in onshape - see this link https://cad.onshape.com/documents/fef8699fcafb8aea780c8981/w/ce38e7fdd6cf8533b65e2c3c/e/4792e876b254f8e35059f863 , in the list of parts to the left it is possible to export (right-click) as STL files, that you can slice for your 3D printer.
  
==Status==
+
=== Navigation box assembly ===
  
Se status for robotter sammen med REGBOT status: [[REGBOT_robot_status#Robobot]].
+
There are video-instructions on the course page.

Latest revision as of 14:45, 31 May 2024

This page is for ROBOBOT, an extension of REGBOT with a raspberry pi and three wheels.

Robobot v5.png Melina b.jpg Model-black.jpg

Figure 1. Robobot, The robot is a 3D-printed box with wheels and some electronics. The third, fourth and fifth generations are shown here. The 3D printed parts can be found here https://cad.onshape.com/documents/fef8699fcafb8aea780c8981/w/ce38e7fdd6cf8533b65e2c3c/e/4792e876b254f8e35059f863

Contents

[edit] Overview

Note: Not valid (mostly) for the 2024 version of the robot

[edit] hardware

ROBOBOT is based on a navigation box with a line sensor (Edge sensor), an IR distance sensor and possibly some servos, all controlled by a microprocessor. For more intelligent behaviour and more sensors, there is a Raspberry Pi in the box too,

The motors are JGB37-555-EN with an encoder and a 1:10 gearing (up to about 400RPM (or ~6 RPS (rotations per second) on the output axle).

There is a video introduction and demo here https://www.youtube.com/watch?v=6dNr_F0dsHw (from 2022 - slight changes since)

[edit] Navigation box overview

Robobot-overview.png

Figure 2. ROBOBOT is an extension of the robot REGBOT. The REGBOT part controls the wheels and interfaces to the sensors, like an IMU (6-axis accelerometer and gyro), IR distance sensors (2), and a line edge detector. The REGBOT further controls up to 5 servos and controls the battery supply. ROBOBOT is further equipped with a Raspberry Pi to allow more complicated missions. The Raspberry Pi runs an interface process called "Bridge" and is the main interface to the REGBOT. The mission process collects data from the bridge and the REGBOT and supplies small mission code snippets to be executed by the REGBOT part. The mission process may use the camera and the Open-CV library functions. The speaker allows debugging messages or other sound effects.

The ROBOBOT functions are available on the net at port number 24001. The existing user interface for REGBOT can access REGBOT functions from this port.

The gamepad can take control of the robot if the mission fails and can be used to initiate missions or other functions.

[edit] Software description

[edit] Bridge software

The Robobot bridge runs on the Raspberry Pi and is started when the Raspberry Pi starts, with initial commands from an initialization file (bridge.ini).

Robobot_bridge overview

A bridge autostart feature is implemented in the script 'start_bridge.sh' in the home directory of the user 'local'. The is executed after a reboot.

The script can be amended with other commands that should be started after a reboot.

[edit] Mission software

The mission application is the primary user control for the robot.

Robobot mission application overview.

The Mission application is started manually from an ssh console or added to the reboot script 'start_bridge.sh'.

[edit] Setup issues

[edit] Installation instructions

This installation should be done already, to update see next section.

Raspberry and ROS (not finished)

Network setup (Wifi)

Robobot camera camera setup

Access from Windows and Linux to Raspberry files (and graphics)

Other windows tools - show Raspberry Pi graphics in Windows (usually very very slow)

Regbot GUI python setup and GUI install

See Regbot calibration for sensor calibration.

[edit] Software update

Update of the maintained software is on the SVN (subversion) repository.

SSH to the robot and go to these directories and do an update

cd
svn up svn/fejemis/ROS/catkin_ws/src/bridge
svn up svn/robobot
svn up svn/regbot

An update could look like this

$ svn up svn/fejemis/ROS/catkin_ws/src/bridge
Updating 'svn/fejemis/ROS/catkin_ws/src/bridge':
U    fejemis/ROS/catkin_ws/src/bridge/udataitem.h
U    fejemis/ROS/catkin_ws/src/bridge/ujoy.cpp
Updated to revision 228.

NB! this may cause a conflict if some of the files are changed locally. Look at the filename and if it is not one of yours, then reply 'tc' (short for their conflict solution)

[edit] Compile on bridge changes

If there are updated files for the bridge, then

cd
cd catkin_ws
catkin_make
[edit] Compile and upload on Teensy changes
cd
cd svn/regbot/regbot/4.1
make -j3

This makes a file "regbot.hex" that is then to be loaded as the new firmware on the Teensy processor.

There is a script that can do that from the command line:

./upload.sh

It will say something like

$ ./upload.sh
Teensy Loader, Command Line, Version 2.2
Read "regbot.hex": 314368 bytes, 3.9% usage
Waiting for Teensy device...
 (hint: press the reset button)

Press and hold the "POWER ON" and then press the button on the Teensy board.

The "POWER ON" button maintains power to the Raspberry Pi and the Teensy while uploading.

It will likely fail the first time but keep pressing "POWER ON" and repeat the command, and it should now say

$ ./upload.sh
Teensy Loader, Command Line, Version 2.2
Read "regbot.hex": 314368 bytes, 3.9% usage
Found HalfKay Bootloader
Programming.............................
Booting

If you released the "POWER ON" in the process, the Raspberry Pi would power down. You then need to hold the "POWER ON" until the Raspberry has booted; you then re-login and rerun the script.

[edit] Make the upload.sh

If you have the "upload.sh", this step is not needed.

The command line upload is described here https://www.pjrc.com/teensy/loader_cli.html .

On a Raspberry you first need to install a USB library:

sudo apt install libusb-dev

Then get the code:

cd ~/git
git clone https://github.com/PaulStoffregen/teensy_loader_cli.git
cd teensy_loader_cli
make

You should now have a "teensy_loader_cli" file; copy this to the svn/regbot/regbot/4.1 directory

cp teensy_loader_cli ~/svn/regbot/regbot/4.1/

Make the "upload.sh" script

cd ~/svn/regbot/regbot/4.1
nano upload.sh

Insert the following into the script:

#!/bin/bash
./teensy_loader_cli -v -w --mcu=TEENSY41 regbot.hex

Save with ctrl-s and exit with ctrl-x

Make the script executable

chmod +x upload.sh

[edit] old instructions

Partially valid only.

Install on raspberry on a clean SD-card - raspi-config.

Setup user local adding a new user.

Linux tools - packages to install.

Access from PC (Linux or Windows).

Other windows tools - run graphics from Windows

Instructions for getting started - primarily network, Linux intro and wifi setup.


[edit] REGBOT setup

Several parameters in the REGBOT part of the robot need setting.

Some suggestions are provided here using the REGBOT GUI (available on the raspberry in the 'regbotgui' directory, and in a Windows version):

Regbot settings

[edit] Hardware

The Robobot frame is 3D printed, the design is in onshape - see this link https://cad.onshape.com/documents/fef8699fcafb8aea780c8981/w/ce38e7fdd6cf8533b65e2c3c/e/4792e876b254f8e35059f863 , in the list of parts to the left it is possible to export (right-click) as STL files, that you can slice for your 3D printer.

[edit] Navigation box assembly

There are video-instructions on the course page.

Personal tools
Namespaces

Variants
Actions
Navigation
Toolbox