diff --git a/scripts/install_rl_cruise_accel_planner.sh b/scripts/install_rl_cruise_accel_planner.sh new file mode 100755 index 0000000..802602c --- /dev/null +++ b/scripts/install_rl_cruise_accel_planner.sh @@ -0,0 +1,33 @@ +#!/bin/bash +# Author: Matt Bunting + +# if you follow conventions correctly, you only need to change the below two parameters + +UPDATE_SCRIPT=update_rl_cruise_accel_planner.sh +LAUNCH_FILE=rl_cruise_accel_planner_readonly.launch + +echo "----------------------------" +if [[ $EUID == 0 ]]; + then echo "Do NOT run this script as root" + exit +fi + +# uninstall the current installations +source ~/.bashrc +sh uninstallRobotUpstart.sh + + +# run the update script +./${UPDATE_SCRIPT} + +pushd ~/catkin_ws +source devel/setup.sh +rosrun robot_upstart uninstall can +rosrun robot_upstart install can_to_ros/launch/${LAUNCH_FILE} --user root + +echo "Enabling can_to_ros startup script" +sudo systemctl daemon-reload +sudo systemctl enable can +popd + +echo "----------------------------" diff --git a/scripts/rosRepositories.csv b/scripts/rosRepositories.csv index 15b9614..802a524 100644 --- a/scripts/rosRepositories.csv +++ b/scripts/rosRepositories.csv @@ -1,4 +1,4 @@ -jmscslgroup, can_to_ros, b6d316c2ffb5bb52b2231eb2046a8d61319fd197 +jmscslgroup, can_to_ros, eee44a39432ed128e06b4f9978f1d74e25646eee jmscslgroup, setpointreader, bf9116d7e7a8284527e1d94537de1228c2b3abb8 jmscslgroup, live_tracker, a974d92748f4137b2bf1d083cebf6ac974b5bf49 -CIRCLES-consortium, algos-stack, f95d26f78ffed06cd21fa73fcf414d5d5e5042a2 +CIRCLES-consortium, algos-stack, 26a532a9941b122f89f02074f5e85ae02865445f diff --git a/scripts/update_rl_cruise_accel_planner.sh b/scripts/update_rl_cruise_accel_planner.sh new file mode 100755 index 0000000..45ac99c --- /dev/null +++ b/scripts/update_rl_cruise_accel_planner.sh @@ -0,0 +1,59 @@ +#!/bin/bash +# Author: Matt Bunting + +# Change params below, assuming you followed conventions, this should be +# all you need to change IF YOU ARE USING ONNX MODELS for your controller + +PRETTY_STRING="RL Cruise Accel-based Planner" +ALGOS_STACK_BRANCH=rl_cruise_accel + +echo "----------------------------" +if [[ $EUID == 0 ]]; + then echo "Do NOT run this script as root" + exit +fi + +echo "Installing/Updating ${PRETTY_STRING} packages" + +source ~/.bashrc + +sh uninstallRobotUpstart.sh + +#cd ~ +#if [ ! -d catkin_ws/src ]; then +# mkdir -p catkin_ws/src +#fi +#cd catkin_ws/src +# +## The following are repositories under jmscslgroup: +#declare -a repositories=(can_to_ros live_tracker) +# +#for repository in "${repositories[@]}" +#do +# echo "Checking" $repository +# if [ -d ${repository} ]; then +# cd ${repository} +# git pull +# cd .. +# else +# git clone "https://github.com/jmscslgroup/${repository}.git" +# fi +#done +# +## this requires credentials: +#if [ -d algos-stack ]; then +# cd algos-stack +# git pull +# cd .. +#else +# git clone https://github.com/CIRCLES-consortium/algos-stack +#fi +#cd algos-stack +## checkout the repository branch we need +#git checkout ${ALGOS_STACK_BRANCH} +# +#cd ~/catkin_ws +#catkin_make + +echo "----------------------------" + diff --git a/update_rl_accel.sh b/update_rl_accel.sh new file mode 100755 index 0000000..53a8103 --- /dev/null +++ b/update_rl_accel.sh @@ -0,0 +1,53 @@ +#!/bin/bash +# Author: Matt Bunting + +echo "Running libpanda's update_rl_accel.sh." +echo "Meant to be used on Toyota RAV-4." + +if [[ $EUID == 0 ]]; + then echo "Do NOT run this script as root" + exit +fi + +source /opt/ros/noetic/setup.bash + +cd /home/circles/libpanda # likely unnecessary +git pull + +# TODO Could allow this to allow for changes. +INSTALLED_LIBPANDA_GIT_VERSION=$(cat /etc/libpanda.d/libpanda_version) +CURRENT_LIBPANDA_GIT_VERSION=$(git rev-parse HEAD | tr -d "\n\r") + +if [ "$INSTALLED_LIBPANDA_GIT_VERSION" = "$CURRENT_LIBPANDA_GIT_VERSION" ]; +then + echo "Software stack is already up to date!" + exit 1 +fi + +echo "Update needed, Git hash mismatch: $INSTALLED_LIBPANDA_GIT_VERSION != $CURRENT_LIBPANDA_GIT_VERSION" + + +echo "Stopping can_to_ros..." +sudo systemctl stop rosnodeChecker +sudo systemctl stop can +sudo sh -c "echo 'ROS has been stopped for update!' > /etc/libpanda.d/logMessage" + +echo "Updating libpanda..." +./install.sh + +cd scripts +echo "Executing installMVTRosPackages..." +./installMVTRosPackages.sh + +echo "Executing install_rl_cruise_accel_planner..." +./install_rl_cruise_accel_planner.sh + +# Do the following at the end of installs to ensure all other processes completed +echo "Saving current pandaversion to /etc/libpanda.d/libpanda_version" +sudo sh -c "pandaversion > /etc/libpanda.d/libpanda_version" + +echo "Starting can_to_ros..." +sudo systemctl start can +sudo systemctl start rosnodeChecker + +echo "libpanda update.sh done."