11#! /usr/bin/env bash
22
3+ # Copyright 2022 Clearpath Robotics, Inc.
4+ #
5+ # Licensed under the Apache License, Version 2.0 (the "License");
6+ # you may not use this file except in compliance with the License.
7+ # You may obtain a copy of the License at
8+ #
9+ # http://www.apache.org/licenses/LICENSE-2.0
10+ #
11+ # Unless required by applicable law or agreed to in writing, software
12+ # distributed under the License is distributed on an "AS IS" BASIS,
13+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+ # See the License for the specific language governing permissions and
15+ # limitations under the License.
16+ #
17+ # @author Roni Kreinin ([email protected] )18+
319# Flags:
420# -m Turtlebot4 Model (lite, standard)
5- # -c OAK-D Camera Model (lite, pro)
621
722Help ()
823{
@@ -49,32 +64,14 @@ SETUP_DIR=${SCRIPT_DIR%/*}
4964bash $SCRIPT_DIR /galactic.sh
5065source /opt/ros/galactic/setup.bash
5166
52- # Install source packages
53- vcs import src < $SETUP_DIR /turtlebot4_packages.repos
54-
55- # Install additional packages
67+ # Install packages
5668sudo apt install -y \
57- libgpiod-dev \
5869network-manager \
5970daemontools \
6071ros-galactic-robot-upstart \
61- chrony
62-
63- # Install bluetooth packages
64- bash $SCRIPT_DIR /bluetooth.sh
65- # Install OAK-D drivers
66- bash $SCRIPT_DIR /oakd.sh
67-
68- # Run rosdep
69- sudo rosdep init
70- rosdep update
71- rosdep install -r --from-paths src -i -y --rosdistro galactic
72-
73- # Add swap memory and build packages
74- sudo bash $SCRIPT_DIR /swap_on.sh
75- colcon build --symlink-install
76- source install/setup.bash
77- sudo bash $SCRIPT_DIR /swap_off.sh
72+ chrony \
73+ ros-galactic-turtlebot4-robot \
74+ ros-galactic-irobot-create-control
7875
7976# Copy udev rules
8077sudo cp $SETUP_DIR /udev/turtlebot4.rules /etc/udev/rules.d/
@@ -93,21 +90,32 @@ sudo sed -i '${s/$/ modules-load=dwc2,g_ether/}' /boot/firmware/cmdline.txt
9390echo " dtoverlay=i2c-gpio,bus=3,i2c_gpio_delay_us=1,i2c_gpio_sda=4,i2c_gpio_scl=5" | sudo tee -a /boot/firmware/usercfg.txt
9491
9592# Configure cyclonedds
93+ sudo cp $SETUP_DIR /conf/cyclonedds_rpi.xml /etc/
9694echo " export RMW_IMPLEMENTATION=rmw_cyclonedds_cpp" | sudo tee -a ~ /.bashrc
97- echo " export CYCLONEDDS_URI='<CycloneDDS><Domain><General><NetworkInterfaceAddress>wlan0,usb0</></></></>' " | sudo tee -a ~ /.bashrc
95+ echo " export CYCLONEDDS_URI=/etc/cyclonedds_rpi.xml " | sudo tee -a ~ /.bashrc
9896
9997# Source galactic setup in bashrc
10098echo " source /opt/ros/galactic/setup.bash" | sudo tee -a ~ /.bashrc
10199
102100# Robot upstart
103-
104- ros2 run robot_upstart install turtlebot4_bringup/launch/$model .launch.py --job turtlebot4 --rmw rmw_cyclonedds_cpp --rmw_config " '<CycloneDDS><Domain><General><NetworkInterfaceAddress>wlan0,usb0</></></></>'"
101+ $SCRIPT_DIR /install.py $model
105102
106103sudo systemctl daemon-reload
107104
108105# Copy scripts to local bin
109- sudo cp $SETUP_DIR /scripts/wifi.sh $SETUP_DIR /scripts/create_update.sh $SETUP_DIR /scripts/swap_on.sh $SETUP_DIR /scripts/swap_off.sh /usr/local/bin
110-
111- read -p " Installation complete, press enter to reboot."
112-
113- sudo reboot
106+ sudo cp $SCRIPT_DIR /wifi.sh \
107+ $SCRIPT_DIR /create_update_0.4.0.sh \
108+ $SCRIPT_DIR /create_update.sh \
109+ $SCRIPT_DIR /swap_on.sh \
110+ $SCRIPT_DIR /swap_off.sh \
111+ $SCRIPT_DIR /bluetooth.sh \
112+ $SCRIPT_DIR /install.py \
113+ $SCRIPT_DIR /uninstall.py /usr/local/bin
114+
115+ # Set image information
116+ sudo touch /etc/turtlebot4
117+ echo " TurtleBot 4 $model v0.1.2" | sudo tee /etc/turtlebot4
118+
119+ echo " Installation complete, press enter to reboot in AP mode."
120+
121+ sudo $SETUP_DIR /scripts/wifi.sh -a && sudo reboot
0 commit comments