Skip to content
This repository was archived by the owner on Sep 4, 2025. It is now read-only.

Commit ee4d5de

Browse files
Update README.md
1 parent 55f1011 commit ee4d5de

File tree

1 file changed

+119
-81
lines changed

1 file changed

+119
-81
lines changed

README.md

Lines changed: 119 additions & 81 deletions
Original file line numberDiff line numberDiff line change
@@ -1,86 +1,101 @@
1-
[![Companion Robot](https://circleci.com/gh/danic85/companion-robot.svg?style=shield)](https://app.circleci.com/pipelines/github/danic85/companion-robot)
1+
<h1>SentryBOT Overview and Frames </h1> &nbsp; <h1><a href="https://github.com/SentryCoderDev/SentryBOT/tree/SentryBOT-V4_EN/images"> -> Photos <- </a></h1>
22

3-
# Robotics Development Framework
4-
This platform has been created to allow modular development and experimentation of robotics in python / C++ using the Raspberry Pi and Arduino.
3+
<div style="display: flex;">
4+
<img src="https://github.com/SentryCoderDev/SentryBOT/assets/134494889/a15f4172-9089-47ee-9e30-9309376784a2" width="30%">
5+
<img src="https://github.com/SentryCoderDev/SentryBOT/assets/134494889/58789c03-9025-4d4b-a22c-256050cd794a" width="35%">
6+
<img src="https://github.com/SentryCoderDev/SentryBOT/assets/134494889/110541b8-3211-41fe-977a-7b9c58584bf4" width="30%">
7+
8+
</div>
59

6-
## Coral TPU Accelerator
710

8-
To use the Googla Coral USB Accelerator, first flash the Pi SD card with the image found in the [AIY Maker Kit](https://aiyprojects.withgoogle.com/maker/)
9-
([Download as of 2022-08-05](https://github.com/google-coral/aiy-maker-kit-tools/releases/download/v20220518/aiy-maker-kit-2022-05-18.img.xz))
11+
# Robotics development framework
12+
This platform was built to modularize robotics development and experimentation with Python/C++ using Raspberry Pi/Jetson nano and Arduino.
1013

11-
(I attempted to install the required software from the coral [getting started guide](https://coral.ai/docs/accelerator/get-started#1-install-the-edge-tpu-runtime) but I was unable to get past an error relating to grpico "GLIBC_2.29' not found")
14+
## Coral USB Accelerator
1215

13-
Alternatively, set Config.vision.tech to `opencv` for the original (slower) facial recognition. I am not updating this anymore so you may find some integration issues.
16+
To use the Googla Coral USB Accelerator, first reprint the Pi SD card with the image included in the AIY Maker Kit.
1417

15-
## Installation
18+
(I tried to install the required software included in the Coral getting started guide, but was unsuccessful due to an error that "GLIBC_2.29" was not found.)
19+
20+
Alternatively, you can opt for the original (slower) facial recognition process by setting Config.VISION_TECH to opencv. I'm no longer updating this section, so you may encounter some integration issues.
21+
22+
## Setup
1623
```
1724
chmod 777 install.sh
1825
./install.sh
1926
```
2027

21-
Disable audio (see Neopixels section below)
28+
To use neopixels on Raspberry Pi, you need to disable the sound (see neopixel section).
2229

23-
## Running
30+
## Operation
2431
```
2532
./startup.sh
2633
```
27-
To execute manual control via keyboard:
34+
35+
For manual control via keyboard
2836
```
2937
./manual_startup.sh
3038
```
31-
To execute startup including a preview of the video feed (not available via SSH):
39+
40+
Contains a preview of the video feed to get started (not available via SSH)
3241
```
3342
./preview_startup.sh
3443
```
3544

36-
###Testing
45+
### Testing
3746
```
3847
python3 -m pytest --cov=modules --cov-report term-missing
3948
```
4049

41-
## Run on Startup
50+
## Automatically run at startup
4251

43-
Execute `sudo vim /etc/rc/local` and add the following lines before the `exit 0` statement:
52+
Run `sudo vim /etc/rc/local` and add the following lines before `exit 0`:
4453
```
45-
python3 /home/archie/companion-robot/shutdown_pi.py
46-
/home/archie/companion-robot/startup.sh
54+
python3 /home/Desktop/companion-robot/shutdown_pi.py
55+
/home/Desktop/companion-robot/startup.sh
4756
```
4857

49-
### Auto shutdown
50-
GPIO 26 is wired to allow shutdown when brought to ground via a switch.
58+
### Automatic Shutdown in case of fall
59+
GPIO 26 is wired to enable shutdown when brought to ground via a switch.
5160

52-
The script `shutdown_pi.py` manages this.
61+
The shutdown_pi.py script manages this.
5362

5463
Guide:
5564
https://howchoo.com/g/mwnlytk3zmm/how-to-add-a-power-button-to-your-raspberry-pi
5665

5766
## Features
5867

59-
### Facial detection and tracking
60-
Using the Raspberry Pi camera
68+
### Face detection and tracking
69+
Using Raspberry Pi camera or any webcam
6170

6271
### Servo control
63-
Control of up to 9 servos via an arduino serial connection
72+
8 servo control with Arduino serial connection (6 servo feet, 1 servo pan, 1 servo tilt)
6473

65-
### Battery monitor
66-
Both external and software integrated via the arduino serial connection
74+
### Battery Monitor
75+
It is integrated externally and via Arduino serial connection via software.
6776

6877
### Buzzer
69-
A buzzer is connected to GPIO 27 to allow for tones to be played in absence of audio output (see Neopixel below).
78+
A buzzer is connected to GPIO 27 so that tones can be played when no sound is output (see Neopixel section).
79+
7080
https://github.com/gumslone/raspi_buzzer_player.git
7181

72-
### Motion Sensor
73-
An RCWL-0516 microwave radar sensor is equipped on GPIO 13
82+
### Motion sensor
83+
An RCWL-0516 microwave radar sensor is attached to GPIO 13. This sensor, with its piservo module, will automatically scan 360 degrees like a radar when it enters a night loop
84+
85+
note: it contains two different piservos, one for nltk and one for motion sensor
7486

75-
### Stereo MEMS Mics
76-
GPIO 18, 19 and 20 allow stereo MEMS microphones as audio input
87+
### NLTK
88+
NLTK analyzes a text and evaluates the degree to which the text is positive or negative. The antenna again uses the piservo control to perform an animation of this evaluation.
89+
90+
### Stereo MEMS Microphones
91+
GPIO 18, 19 and 20 are used to use stereo MEMS microphones as audio input.
7792
```
78-
Mic 3V to Pi 3.3V
79-
Mic GND to Pi GND
80-
Mic SEL to Pi GND (this is used for channel selection, connect to either 3.3V or GND)
81-
Mic BCLK to BCM 18 (pin 12)
82-
Mic DOUT to BCM 20 (pin 38)
83-
Mic LRCL to BCM 19 (pin 35)
93+
Mic 3V - Connects to Pi 3.3V.
94+
Mic GND - Connects to Pi GND.
95+
Mic SEL - Pi connects to GND (this is used for channel selection, can be connected to 3.3V or GND).
96+
Mic BCLK - Connects to BCM 18 (pin 12).
97+
Mic DOUT - Connects to BCM 20 (pin 38).
98+
Mic LRCL - connects to BCM 19 (pin 35).
8499
```
85100
https://learn.adafruit.com/adafruit-i2s-mems-microphone-breakout/raspberry-pi-wiring-test
86101

@@ -92,64 +107,73 @@ wget https://raw.githubusercontent.com/adafruit/Raspberry-Pi-Installer-Scripts/m
92107
sudo python3 i2smic.py
93108
```
94109

95-
####Test
110+
#### Testing
96111
`arecord -l`
97112
`arecord -D plughw:0 -c2 -r 48000 -f S32_LE -t wav -V stereo -v file_stereo.wav`
98113

99-
_Note:_ See below for additional configuration to support voice recognition
114+
_Note:_ See additional configuration below to support voice recognition.
115+
116+
### Hotword
117+
The original hot word detection used the now deprecated Snowboy. The files are still available in this repository:
118+
119+
https://github.com/dmt-labs/modular-biped/blob/feature/PR29_review/modules/hotword.py contains the module from this framework.
120+
121+
https://github.com/dmt-labs/modular-biped/tree/feature/PR29_review/modules/snowboy includes original snowboy functionality.
122+
123+
https://github.com/dmt-labs/modular-biped/tree/feature/PR29_review/modules/snowboy/resources/models contains trained models that can be used as keywords. It may be possible to find more on the internet.
124+
125+
A guide to training new models is available here, but there are resources for training new models on a Linux device.
100126

101127
### Speech Recognition
102-
Trigger word for voice recognition (currently not used):
128+
Trigger word for voice recognition (not currently used):
103129
https://snowboy.kitt.ai/
104130

105-
Speech recognition is enabled whenever a face is visible.
106-
Ensure that the `device_index` specified in `modules/speechinput.py` matches your microphone.
131+
Speech recognition is activated when a face is seen.
132+
Make sure that the `device_index` value specified in the `modules/speechinput.py` file matches your microphone.
107133

108-
See `scripts/speech.py` to list input devices and test. See below for MEMS microphone configuration
134+
See `scripts/speech.py` to list and test input devices. See below for MEMS microphone configuration.
135+
### MEMS Microphone configuration for Speech Recognition
109136

110-
### MEMS Microphone configuration for speech recognition
137+
By default, the Adafruit I2S MEMS Microphone Breakout does not work with voice recognition.
111138

112-
By default the Adafruit I2S MEMS Microphone Breakout does not work with speech recognition.
113-
114-
To support voice recognition on the MEMS microphone(s) the following configuration changes are needed.
139+
The following configuration changes must be made to support voice recognition on MEMS microphone(s).
115140

116141
`sudo apt-get install ladspa-sdk`
142+
Create `/etc/asound.conf` file with the following content:
117143

118-
Create `/etc/asound.conf` with the following content:
119-
120-
```
144+
```
121145
pcm.pluglp {
122-
type ladspa
123-
slave.pcm "plughw:0"
124-
path "/usr/lib/ladspa"
125-
capture_plugins [
126-
{
127-
label hpf
128-
id 1042
129-
}
130-
{
131-
label amp_mono
132-
id 1048
133-
input {
134-
controls [ 30 ]
135-
}
136-
}
137-
]
146+
type ladspa
147+
slave.pcm "plughw:0"
148+
path "/usr/lib/ladspa"
149+
capture_plugins [
150+
{
151+
label hpf
152+
id 1042
153+
}
154+
{
155+
label amp_mono
156+
id 1048
157+
input {
158+
controls [ 30 ]
159+
}
160+
}
161+
]
138162
}
139163
140164
pcm.lp {
141-
type plug
142-
slave.pcm pluglp
165+
type plug
166+
slave.pcm pluglp
143167
}
144168
```
145169

146-
This enables the device 'lp' to be referenced in voice recognition. Shown with index `18` in the example below.
170+
This ensures that the 'lp' device can be referenced in voice recognition. In the example below it is shown at index `18`.
147171

148-
Sample rate should also be set to `16000`
172+
For example, the sample rate should be set to `16000`.
149173

150174
`mic = sr.Microphone(device_index=18, sample_rate=16000)`
151175

152-
References:
176+
References:
153177

154178
* [MEMS Microphone Installation Guide](https://learn.adafruit.com/adafruit-i2s-mems-microphone-breakout/raspberry-pi-wiring-test)
155179

@@ -159,32 +183,46 @@ References:
159183

160184
### Serial communication with Arduino
161185

162-
In order to use the Raspberry Pis serial port, we need to disable getty (the program that displays login screen)
186+
To use the Raspberry Pi's serial port, getty (the program that displays the login screen) must be disabled.
163187

164-
`sudo raspi-config -> Interfacing Options -> Serial -> "Would you like a login shell to be accessible over serial" = 'No'. Restart`
188+
`sudo raspi-config -> Interfacing Options -> Serial -> "Would you like a login shell to be accessible over serial" = 'No'. Restart`
165189

166190
#### Connection via serial pins
167-
Connect the Pi GPIO 14 & 15 (tx & rx) to the arduino tx & rx (tx -> rx in both directions!) via a logic level shifter, as the Pi is 3v3 and the arduino is (most likely) 5v.
191+
Connect GPIO pins 14 and 15 (tx and rx) of the Raspberry Pi to the Arduino tx and rx pins (tx -> rx in both direction and direction reversal!) via a logic level shifter, since Raspberry Pi 3v3 and Arduino (probably) It is 5v.
168192

169-
####Upload to Arduino over serial pins
170-
To upload over serial pins, press the reset button on the Arduino at the point that the IDE starts 'uploading' (after compile), otherwise a sync error will display.
193+
#### You can follow the steps below to upload to Arduino via serial pins:
194+
195+
To upload via serial pins, press the reset button on the Arduino at the point where the IDE starts 'uploading' (after compiling); otherwise a synchronization error will be displayed.
171196

172197
### Neopixel
173198

174-
WS1820B support is included via the Pi GPIO pin 12. Unfortunately to support this you must disable audio on the Pi.
199+
WS1820B support is provided via Pi GPIO pin 12. Unfortunately, audio on the Pi must be disabled to support this.
175200

176201
```
177202
sudo vim /boot/config.txt
178203
#dtparam=audio=on
179204
```
180205

181-
This is also why the application must be executed with `sudo`
206+
Therefore, the application must be run with `sudo`.
207+
208+
If you want to use neopixels without using the driver (and no audio output), set pin to 12 in the configuration and set i2c to False. The application must also be run with sudo.
182209

183210
https://learn.adafruit.com/neopixels-on-raspberry-pi/python-usage
184211

212+
### Instant Translation
213+
214+
The live translation module <code>translation.py</code> allows live translation of logs and TTS output via Google Translate.
215+
216+
Call the <code>translate.request(msg)</code> function and optionally specify the source and target languages.
217+
218+
<code>config/translation.yml</code> specifies the default languages.
219+
220+
185221
## PCBs
186-
Prefabricated PCBs are available for this project in the `circuits` folder. This allows the connection between the core components as described above.
222+
The prefabricated PCBs of this project are available in the `circuits` folder. This provides connectivity between core components as described above.
223+
224+
225+
![Top](https://github.com/SentryCoderDev/SentryBOT/assets/134494889/91994cd7-4dd4-43bc-9664-7bb79c908d23)
187226

188-
![Top](circuits/v2/Upper/Top%20Feb%202021_pcb.png)
189227

190-
![Bottom](circuits/v2/Lower/Lower%20Feb%202021_pcb.png)
228+
![body_pcb](https://github.com/SentryCoderDev/SentryBOT/assets/134494889/857f3284-5361-4b6f-b097-b052fe510902)

0 commit comments

Comments
 (0)