Lecture 7 - Understand Board support package (BSP) and Gemini
September 24, 2024

Rapsberry Pi Pico ($4)
No OS

raspberry pi 4 computing module
$25 -$200


raspberry pi 4
motors are older, ROS1 and ROS2

Google Gemini Uses BSP directly
# Audio record parameters
fs = 48000 # 48KHz,Audio sampling rate
duration = 5 # Recording duration in seconds
# Set the default speaker volume to maximum
# Headphone number is 0 without HDMI output
# Headphone number is 1 when HDMI connect the display
os.system("amixer -c 0 sset 'Headphone' 100%")change duration
make the program reading from command arguments
check how to use args
#!/usr/bin/python
from MangDang.mini_pupper.ESP32Interface import ESP32Interface
import time
esp32 = ESP32Interface()
while True:
print(esp32.imu_get_data())
time.sleep(1 / 20) # 20 Hzimport time
import RPi.GPIO as GPIO
# There are 4 areas for touch actions
# Each GPIO to each touch area
touchPin_Front = 6
touchPin_Left = 3
touchPin_Right = 16
touchPin_Back = 2
...
# Detection Loop
while True:
touchValue_Front = GPIO.input(touchPin_Front)
touchValue_Back = GPIO.input(touchPin_Back)
touchValue_Left = GPIO.input(touchPin_Left)
touchValue_Right = GPIO.input(touchPin_Right)
display_sting = ''
if not touchValue_Front:
display_sting += ' Front'
if not touchValue_Back:
display_sting += ' Back'
...#!/usr/bin/python
from MangDang.mini_pupper.display import Display, BehaviorState
import time
disp = Display()
disp.show_image('/var/lib/mini_pupper_bsp/test.png')
time.sleep(5)
disp.show_state(BehaviorState.REST)
time.sleep(5)
disp.show_state(BehaviorState.TROT)
time.sleep(5)
disp.show_state(BehaviorState.LOWBATTERY)
time.sleep(5)
disp.show_ip()tokens, prompt and role
as the price shown on 9/27/2024





Note





Important
Tip
cd ~
git clone https://github.com/mangdangroboticsclub/apps-md-robots
cd apps-md-robots/ai-app/
sudo apt-get install -y python3-pyaudio
sudo pip install -r requirements.txtas
.bashrcYou can save your MicroSD card to an image file

Li Bai