Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
78 commits
Select commit Hold shift + click to select a range
a633cfe
Merge pull request #8 from DIT-ROBOTICS/main
SeanChangX Jan 9, 2025
8ee7d9b
Add Docker setup for Foxglove Bridge with 2 version of ROS
SeanChangX Jan 30, 2025
b1b83c6
Enhance ROS environment setup in Docker with custom function for sour…
SeanChangX Jan 30, 2025
7bf8aba
Add custom alias and sourcing for colcon environment in Docker ROS setup
SeanChangX Jan 31, 2025
b030481
Add initial ROS2 dashboard integration and ncdu dep.
SeanChangX Feb 17, 2025
87a97f4
Add lichtblick submodule and update Docker Compose configuration
SeanChangX Feb 17, 2025
5ae50e9
Add git-lfs to pre-installation dependencies and set ROS_DOMAIN_ID in…
SeanChangX Feb 17, 2025
c7a4210
Update lichtblick submodule to latest commit
SeanChangX Feb 19, 2025
7489e6f
Update Conky configuration and add Xbox teleoperation support in Dock…
SeanChangX Feb 19, 2025
b231e8d
Update Docker Compose configuration to ensure service restarts and up…
SeanChangX Feb 19, 2025
5cb71f1
Add desktop entries and scripts for localization and navigation proce…
SeanChangX Feb 20, 2025
71da20f
Close #9: add lidar & chassis udev rules
SeanChangX Feb 20, 2025
d85f034
Refactor index.html layout and enhance dashboard structure
SeanChangX Feb 20, 2025
cb6de99
Update Docker Compose to add camera image processing and update licht…
SeanChangX Feb 25, 2025
e7ae2c9
Update udev rules for chassis serial and update lichtblick submodule
SeanChangX Feb 25, 2025
6ce581a
Update submodule to latest release v1.9.0
SeanChangX Feb 27, 2025
87936a8
Update installation script: change conky to conky-all and modify back…
SeanChangX Feb 27, 2025
15a6569
Update Docker Compose to use dynamic ROS_DOMAIN_ID based on hostname
SeanChangX Feb 27, 2025
a3d162d
Refactor installation script and Docker setup: improve user prompts, …
SeanChangX Feb 27, 2025
81bccca
Update README and entrypoint script: add getting started instructions…
SeanChangX Feb 27, 2025
2304f67
Update entrypoint script and Docker Compose: modify entrypoint comman…
SeanChangX Feb 27, 2025
54dadd5
Update .bashrc to set ROS_DOMAIN_ID based on hostname
SeanChangX Feb 27, 2025
96657b4
Remove static ROS_DOMAIN_ID export and update Docker Compose to use d…
SeanChangX Feb 27, 2025
a6674e9
Add system environment setup step and create env setup script for ROS…
SeanChangX Feb 27, 2025
251b81e
Update README: change Git LFS install command to use local option
SeanChangX Feb 28, 2025
fc83a3b
Add new Plymouth theme images for abstract ring alt progress indicator
SeanChangX Mar 3, 2025
311ea5a
Add desktop entries and scripts for launching DIT applications with t…
SeanChangX Mar 3, 2025
e1569d8
Refactor user preference restoration into separate script and add nav…
SeanChangX Mar 14, 2025
4211085
Update Conky configuration and enhance user preference restoration sc…
SeanChangX Mar 14, 2025
3a52693
Merge pull request #11 from DIT-ROBOTICS/hotfix/desktop_shortcut
SeanChangX Mar 14, 2025
42e7aa6
Update scripts and desktop entries for DIT applications; enhance sess…
SeanChangX Mar 16, 2025
9f13e62
Add command to remove main Docker service in remove.sh script
SeanChangX Mar 16, 2025
439fe3b
Update DIT desktop entry to use dynamic IP address for websocket conn…
SeanChangX Mar 16, 2025
c8cab54
Add battery and network watchdog scripts with audio alerts for low ba…
SeanChangX Mar 16, 2025
3635402
Update conky_entry.sh to use absolute path for welcome sound effect
SeanChangX Mar 16, 2025
a243b0e
Enhance volume control in conky_entry.sh for different Ubuntu versions
SeanChangX Mar 16, 2025
2c951e8
Update remove.sh to use correct Docker project names for localization…
SeanChangX Mar 17, 2025
27c49ac
Add Robot Status Bridge with battery monitoring functionality
SeanChangX Mar 17, 2025
c6f9123
Add robot status monitoring with publisher and subscriber for battery…
SeanChangX Mar 17, 2025
0606a19
Add udev rule for mission stm. Closes #12
SeanChangX Mar 17, 2025
b5d8f6f
Update robot status monitoring to stable version
SeanChangX Mar 17, 2025
1307a09
Change topic format from msg to topic layer
SeanChangX Mar 18, 2025
c3af408
Refactor robot status node to remove hostname dependency and streamli…
SeanChangX Mar 18, 2025
2d94058
Merge pull request #13 from DIT-ROBOTICS/feature/robot-status-bridge
SeanChangX Mar 18, 2025
509400c
Add ESP Daemon setup with Docker support and ROS environment configur…
SeanChangX Mar 18, 2025
5859e76
Rename voice_nav service to robot-status-bridge in docker-compose.yaml
SeanChangX Mar 18, 2025
95230b9
Update ESP Daemon with micro-ROS
SeanChangX Mar 19, 2025
1c1c5f1
Add web interface for robot status with HTML, CSS, and JavaScript
SeanChangX Mar 19, 2025
5adc2fb
Add ROS subscribers for Int32 messages and update timer callback logic
SeanChangX Mar 19, 2025
730c31a
Add udev rules for DIT-2025-14 Closes #16 #17
SeanChangX Mar 19, 2025
1674de1
Add desktop entries and scripts to stop main and navigation services
SeanChangX Mar 20, 2025
a5e1d08
Refactor ROS initialization and update node name to "esp32_watchdog"
SeanChangX Mar 20, 2025
b4a1096
Add USB status monitoring and power consumption metrics to robot stat…
SeanChangX Mar 20, 2025
40fb785
Merge pull request #18 from DIT-ROBOTICS/feature/robot-status-bridge
SeanChangX Mar 20, 2025
18fb8b9
Update Xbox configuration for teleoperation and enhance performance
SeanChangX Mar 20, 2025
ef65370
Fix docker-compose file path in main.run script
SeanChangX Mar 21, 2025
bf5d171
Fix docker-compose file paths in main.run and rm-main.sh scripts
SeanChangX Mar 21, 2025
0e65170
Add udev rule for new mission device Closes #19
SeanChangX Mar 24, 2025
47b3b41
Update udev rules setup script and archive Vive device rules
SeanChangX Mar 24, 2025
131142a
Implement ESP-NOW communication and update Docker configuration for d…
SeanChangX Mar 25, 2025
870234d
Update submodule web/lichtblick to v1.11.0
SeanChangX Mar 25, 2025
6326c12
Add script to update git submodules
SeanChangX Mar 25, 2025
736cc4c
Add usbutils to Dockerfile and update USB topic polling intervals
SeanChangX Mar 25, 2025
0f46b8a
Add Samba service to Docker Compose for file sharing
SeanChangX Mar 25, 2025
2a095d0
Fix path in remove script for main Docker Compose file
SeanChangX Mar 28, 2025
c5607b8
Update .gitignore to ignore all vscode directories recursively
SeanChangX Mar 30, 2025
562767c
Merge branch 'dev' into feature/esp-daemon
SeanChangX Apr 1, 2025
35577d1
Enhance Docker setup and ignore micro-ROS files
SeanChangX Apr 3, 2025
28744dd
Add initial implementation of WiFi, ESP-NOW, web server, LED control,…
SeanChangX Apr 3, 2025
8eaf3e1
Refactor micro-ROS integration and enhance web interface with system …
SeanChangX Apr 4, 2025
51c1e49
Remove example main.cpp file for ESP Daemon
SeanChangX Apr 4, 2025
5a26cf4
Add PlatformIO directory to .gitignore
SeanChangX Apr 5, 2025
47dfac5
Enhance robot status monitoring with battery uptime tracking
SeanChangX Apr 5, 2025
eb138e2
Implement battery status monitoring and sound alerts; update Docker a…
SeanChangX Apr 5, 2025
3431b7a
Fix typo in .gitignore for micro-ROS directory
SeanChangX Apr 5, 2025
cfba25b
Merge branch 'dev' into feature/esp-daemon
SeanChangX Apr 5, 2025
20aafae
Add emergency controls UI and functionality; enhance web server endpo…
SeanChangX Apr 5, 2025
2aaf875
Merge branch 'feature/esp-daemon' into dev
SeanChangX Apr 5, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 8 additions & 6 deletions .config/conky/conky-esp-config/.conky_esp32
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
conky.config = {
update_interval = 0.5,
update_interval = 1,
total_run_times = 0,
own_window = true,
own_window_type = 'normal',
Expand All @@ -9,20 +9,22 @@ conky.config = {
own_window_hints = 'undecorated,below,sticky,skip_taskbar,skip_pager',
background = false,
double_buffer = true,
alignment = 'top_right',
gap_x = 300,
gap_y = 200,
alignment = 'top_left',
gap_x = 680,
gap_y = 180,
minimum_width = 200, minimum_height = 50,
draw_outline = true,
draw_borders = false,
use_xft = true,
font = 'DejaVu Sans Mono:size=128',
font = 'Ubuntu Regular:size=28',
default_color = 'white',
default_outline_color = 'grey',
default_shade_color = 'black',
color0 = 'white',
};

conky.text = [[
${execi 1 /home/ditrobotics/.config/conky/conky-esp-config/conky_esp32.sh} V
${exec awk '{getline v < "/sys/class/power_supply/BAT0/voltage_now"; printf "%.1f W\n", v * $1 / 1000000000000}' /sys/class/power_supply/BAT0/current_now}
]];

-- ${execi 1 /home/ditrobotics/.config/conky/conky-esp-config/conky_esp32.sh} V
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
#!/bin/bash

DIR="/home/ditrobotics/DIT-Scripts/.config/conky/conky-esp-config/10-battery_watchdog"
cd $DIR

BATTERY_STATUS_FILE="/home/ditrobotics/DIT-Scripts/app/robot_status_bridge/robot_status_br/tmp/battery_status.json"
LOW_BATTERY_THRESHOLD=17.5
DISCONNECTED_THRESHOLD=0.0
LOW_BATTERY_SOUND="warning_low_battery_en_1.mp3"
DISCONNECTED_SOUND="battery_removed.mp3"
DISCONNECTED_PLAYED=false

while true; do
if [ -f "$BATTERY_STATUS_FILE" ]; then
voltage=$(jq -r '.voltage' "$BATTERY_STATUS_FILE")

if (( $(echo "$voltage == $DISCONNECTED_THRESHOLD" | bc -l) )); then
if [ "$DISCONNECTED_PLAYED" = false ]; then
if ! pgrep -x "ffplay" > /dev/null; then
# Play battery disconnected sound once
ffplay -nodisp -autoexit "$DISCONNECTED_SOUND" > /dev/null 2>&1 &
DISCONNECTED_PLAYED=true
fi
fi
else
DISCONNECTED_PLAYED=false

if (( $(echo "$voltage < $LOW_BATTERY_THRESHOLD" | bc -l) )); then
if ! pgrep -x "ffplay" > /dev/null; then
# Broadcast low battery warning
ffplay -nodisp -autoexit "$LOW_BATTERY_SOUND" > /dev/null 2>&1 &
fi
fi
fi
fi

sleep 5
done

Binary file not shown.
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
#!/bin/bash

DIR="/home/ditrobotics/DIT-Scripts/.config/conky/conky-esp-config/10-network_watchdog"
cd $DIR

# https://ttsmaker.com/
# 2599 - Christ-United States Male

prev_state=0
while true; do

# Check Wi-Fi connection status
state=$(nmcli -t -f GENERAL.STATE device show wlp2s0 | awk -F: '{print $2}' | awk '{print $1}')

if [[ $state -eq 100 ]]; then
# Wi-Fi is connected
if [[ $prev_state -ne 100 ]]; then
ffplay -nodisp -autoexit starlink_engaged.mp3 > /dev/null 2>&1 &
fi
echo -e "\e[32mWi-Fi is connected\e[0m"
else
# Wi-Fi is disconnected
if [[ $prev_state -eq 100 ]]; then
ffplay -nodisp -autoexit wifi_problem.mp3 > /dev/null 2>&1 &
fi
echo -e "\e[33mWi-Fi is not connected [$(nmcli -t -f GENERAL.STATE device show wlp2s0)]\e[0m"
fi
prev_state=$state

sleep 5
done

Binary file not shown.
Binary file not shown.
28 changes: 0 additions & 28 deletions .config/conky/conky-esp-config/battery_watchdog.sh

This file was deleted.

Binary file removed .config/conky/conky-esp-config/fur_elise.mp3
Binary file not shown.
34 changes: 32 additions & 2 deletions .config/conky/conky_entry.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,38 @@
DIR="/home/ditrobotics/.config/conky"

conky -c $DIR/conky-esp-config/.conky_esp32 &
$DIR/lean-conky-config/start-lcc.sh
$DIR/conky-esp-config/battery_watchdog.sh &
$DIR/lean-conky-config/start-lcc.sh;

sleep 3
# Set the volume to 95%
VOLUME_LEVEL="95%"
UBUNTU_VERSION=$(lsb_release -r | awk '{print $2}')

if [[ "$UBUNTU_VERSION" == "22.04" ]]; then
pactl set-sink-volume @DEFAULT_SINK@ "$VOLUME_LEVEL"
elif [[ "$UBUNTU_VERSION" == "24.04" ]]; then
amixer set Master "$VOLUME_LEVEL"
else
echo "Unrecognized Ubuntu version, trying to auto-detect available tools..."
if command -v pactl &> /dev/null; then
pactl set-sink-volume @DEFAULT_SINK@ "$VOLUME_LEVEL"
elif command -v amixer &> /dev/null; then
amixer set Master "$VOLUME_LEVEL"
else
echo "Unable to find volume control tool! Please check system installation."
fi
fi

# Boot-up sound effect
sleep 1
ffplay -nodisp -autoexit /home/ditrobotics/DIT-Scripts/.config/conky/conky-esp-config/welcome.mp3
# ========================================
# ===== PUT SOUND EFFECT MODULE HERE =====

$DIR/conky-esp-config/10-battery_watchdog/battery_watchdog.sh &
$DIR/conky-esp-config/10-network_watchdog/network_watchdog.sh &

# ========================================

# # Run the Web Pannel essential scripts
# /home/ditrobotics/DIT-Scripts/web-ui/scripts/aio.sh &
Expand Down
28 changes: 25 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,26 @@
# Ignore the vscode directory
**/.vscode/

# Ignore the build directory
**/build/
**/install/
**/log/

# Ignore python cache files
**/__pycache__/

# Ignore mirco-ROS files
**/src/micro_ros/
**/src/uros/
**/ros2.repos

# Ignore the PlatformIO directory
**/.pio/

# Ignore tmp files
**/tmp/*
!**/tmp/.gitkeep

# Other pecific files or directories
web-ui/data/*
!data/.gitkeep
.arduino/Battery_watchdog/build/*
.vscode/*
!data/.gitkeep
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[submodule "web/lichtblick"]
path = web/lichtblick
url = https://github.com/Lichtblick-Suite/lichtblick.git
48 changes: 34 additions & 14 deletions 00-pre-installation.sh
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ progress_bar() {

# Initialize step and total steps variables
step=1
total_steps=10 # Adjust based on the actual number of steps you have
total_steps=11 # Adjust based on the actual number of steps you have

upgrade_system() {
echo -e "\033[32mUpdating and upgrading system...\033[0m"
Expand All @@ -46,7 +46,7 @@ install_dependencies() {
net-tools \
iw \
lm-sensors \
conky \
conky-all \
tmux \
screen \
htop \
Expand All @@ -55,26 +55,32 @@ install_dependencies() {
timeshift \
cheese \
ffmpeg \
jq
jq \
ncdu \
git-lfs

# net-tools --- for network configuration
# iw --- for wireless network configuration
# lm-sensors --- for device temperature monitoring
# conky --- for system monitoring panel
# conky-all --- for system monitoring panel (update conky -> conky-all for Ubuntu 24.04)
# iperf3 --- for network performance testing
# timeshift --- for system snapshot and restore
# cheese --- for camera testing
# ffmpeg --- for audio and video processing (ex. boot-on sound)
# jq --- for JSON parsing
# ncdu --- for disk usage analysis
# git-lfs --- for git large file storage

sleep 1
progress_bar $step $total_steps
((step++))
}

# Fix for USB device detection issue
# |
# | Reference:
# | https://askubuntu.com/questions/1403705/dev-ttyusb0-not-present-in-ubuntu-22-04
# |
remove_brltty() {
echo -e "\033[32mRemoving brltty...\033[0m"

Expand All @@ -95,7 +101,7 @@ install_docker() {

groupadd docker
usermod -aG docker ditrobotics
newgrp docker # optional
# newgrp docker # optional

sleep 1
progress_bar $step $total_steps
Expand Down Expand Up @@ -146,11 +152,14 @@ setup_dit_logger() {
((step++))
}

# Setup touch screen orientation
# Setup touch screen orientation:
# |
# | This is for Eurobot 2024 external usb touch screen, it isn't needed in general.
# |
flip_screen() {
echo -e "\033[32mSetting up touch screen HID layout...\033[0m"

read -p "Would you like to rotate touch screen? (y/N): " answer
read -p "Would you like to rotate external touch screen? (y/N): " answer

case $answer in
[Yy]* )
Expand All @@ -169,11 +178,21 @@ flip_screen() {
((step++))
}

# Restore firefox user preference
restore_firefox() {
echo -e "\033[32mRestoring firefox user preference...\033[0m"
# Restore user preference
restore_user_preference() {

find /home/ditrobotics/snap/firefox/common/.mozilla/firefox/ -type d -name "*.default" -exec cp -r /home/ditrobotics/DIT-Scripts/.mozilla/firefox/dit_config.default/* {} \;
./15-user_preference.sh all

sleep 1
progress_bar $step $total_steps
((step++))
}

# Setup system environment
setup_system_env() {
echo -e "\033[32mSetting up system environment...\033[0m"

./20-env_setup.sh

sleep 1
progress_bar $step $total_steps
Expand All @@ -195,7 +214,8 @@ for ((i=step; i<=total_steps; i++)); do
7) create_user;;
8) setup_dit_logger;;
9) flip_screen;;
10) restore_firefox;;
10) restore_user_preference;;
11) setup_system_env;;
*) echo -e "\033[31mInvalid step\033[0m";;
esac
done
Expand All @@ -211,8 +231,8 @@ REBOOT YOUR SYSTEM!!!
IF ALL LOOKS GOOD, THEN CHECK THE FOLLOWING ITEM

A) Do your first timeshift
B) Use Clonezilla backup to external SSD
C) ...
B) [ABANDONED] Use Clonezilla backup to external SSD
C) Install Active Backup for Business (Synology NAS) and backup to NAS
"
echo "$MOTD"

2 changes: 1 addition & 1 deletion 10-conky_setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ cp -r .config/autostart /home/ditrobotics/.config/

# Setup udev rules for USB devices (e.g. esp32|stm32|imu|lidar|vive|touchscreen|...)
echo "Copying udev rules files to /etc/udev/rules.d/"
cp -r udev/. /etc/udev/rules.d/.
cp udev/*.rules /etc/udev/rules.d/

# Reload udev rules
udevadm control --reload-rules && udevadm trigger
Loading