Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@ build/
ui/
*.uf2
ev3-usb.sh
.vscode/
3 changes: 3 additions & 0 deletions install_ROS2.sh
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,9 @@ if [[ $MIRTE_TYPE == "mirte-master" ]]; then
cd ../../rplidar_ros
chmod +x ./scripts/create_udev_rules.sh || true
./scripts/create_udev_rules.sh || true
cd /home/mirte/mirte_ws/ || exit 1
cd src/orbbecsdk_ros2/ || true
sudo ./orbbec_camera/scripts/install_udev_rules.sh || true

fi

Expand Down
1 change: 1 addition & 0 deletions install_mirte.sh
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,7 @@ sudo apt install -y overlayroot
} 2>&1 | sed -u 's/^/overlayfs::: /' &

#sudo bash -c "echo 'overlayroot=\"tmpfs\"' >> /etc/overlayroot.conf"
sudo systemctl disable --now unattended-upgrades.service || true # either no network or do it manually

# update time in /etc/fake-hwclock.data
sudo fake-hwclock save
Expand Down
1 change: 1 addition & 0 deletions install_web.sh
Original file line number Diff line number Diff line change
Expand Up @@ -66,3 +66,4 @@ curl -s https://install.zerotier.com | sudo bash
sudo rm /var/lib/zerotier-one/identity.public || true
sudo rm /var/lib/zerotier-one/identity.secret || true
# new identity should be generated on first boot
sudo systemctl disable --now zerotier-one.service || true # fails bc not started with systemd
26 changes: 24 additions & 2 deletions services/mirte_shutdown.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,38 @@ if ! systemctl list-jobs | grep -q -E 'shutdown.target.*start'; then
exit
fi

REBOOT=false
# if rebooting, then dont shutdown the robot
if systemctl list-jobs | grep -q -E 'reboot.target.*start'; then
echo "reboot target active"
REBOOT=true
fi

source /home/mirte/.bashrc
source /home/mirte/.mirte_settings
source /home/mirte/.mirte_settings.sh
source /home/mirte/mirte_ws/install/setup.bash
touch /home/mirte/.shutdown
service=/io/oled/oled/set_text
shutdown_service=/io/power/power_watcher/shutdown
if [ "$MIRTE_USE_MULTIROBOT" = "true" ]; then
mirte_space=$(cat /etc/hostname | tr '[:upper:]' '[:lower:]' | tr '-' '_')
service="/$mirte_space$service"
shutdown_service="/$mirte_space$shutdown_service"
fi

if [ "$(ros2 service list | grep "$service$")" ]; then
ros2 service list || true # make sure ros2 daemon is running
ros2 service list || true # make sure ros2 daemon is running

stop_service="/stop"
if [ "$(ros2 service list | grep "$stop_service$")" ]; then
ros2 service call "$stop_service" std_srvs/srv/Empty "{}"
fi

if [ "$(ros2 service list | grep "$service$")" ] && [ "$REBOOT" = "false" ]; then
ros2 service call "$service" mirte_msgs/srv/SetOLEDText "{ text: 'Shutting down...'}"
ros2 service call "$shutdown_service" std_srvs/srv/SetBool "{ data: true }"
fi

if [ "$(ros2 service list | grep "$service$")" ] && [ "$REBOOT" = "true" ]; then
ros2 service call "$service" mirte_msgs/srv/SetOLEDText "{ text: 'Rebooting...'}"
fi
Loading