-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adjusting wait times in led config, and separating the led config tes…
…t script
- Loading branch information
1 parent
1ff3e15
commit bd0d970
Showing
3 changed files
with
42 additions
and
36 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
#!/bin/bash | ||
tmp_file_LED_launch="/tmp/led_manager.txt" | ||
##################### LED Configuration ####################### | ||
read -n 2 -p $'\e[1;32mDo you want to test the LEDs? [y/n]\e[0m\n' resp_led | ||
response_led=`echo $resp_led | sed -r 's/(.*)$/\1=/'` | ||
if [[ $response_led =~ ^(y|Y)=$ ]]; then | ||
source $workspace/devel/setup.bash | ||
|
||
echo "####################### LED Configuration #######################" | ||
echo $'\e[0;33mLED testing works only with a battery as the power source!\e[0m' | ||
echo $'\e[1;32mWhich module is the UVDAR board connected to?\e[0m' | ||
echo "Enter:" | ||
echo "1 = /dev/MRS_MODULE1" | ||
echo "2 = /dev/MRS_MODULE2" | ||
echo "3 = /dev/MRS_MODULE3" | ||
echo "4 = /dev/MRS_MODULE4" | ||
read -n 2 resp_module | ||
echo "Starting with LED initialization on:/dev/MRS_MODULE$resp_module... This will take about 20 seconds." | ||
path_to_led_config=/opt/ros/noetic/share/uvdar_core/config/blinking_sequences/test_assignment.txt | ||
roslaunch uvdar_core led_manager.launch sequence_file:=$path_to_led_config portname:=/dev/MRS_MODULE$resp_module &> $tmp_file_LED_launch & | ||
pid_led_manager=$! | ||
sleep 5; rosservice call /$UAV_NAME/uvdar_led_manager_node/quick_start 0 | ||
sleep 2; rosservice call /$UAV_NAME/uvdar_led_manager_node/load_sequences | ||
sleep 2; rosservice call /$UAV_NAME/uvdar_led_manager_node/select_sequences [0,1,2,3] | ||
sleep 2; rosservice call /$UAV_NAME/uvdar_led_manager_node/set_frequency 1 | ||
sleep 5 | ||
|
||
# kill the LED manager and remove temporary file | ||
kill -9 "$pid_led_manager" | ||
rm $tmp_file_LED_launch | ||
echo "##################### LED Configuration done! ###################" | ||
echo $'\e[1;32mPlease verify that the LEDs are correctly wired!\e[0m' | ||
echo "Blinking Pattern: Clockwise blinking circle starting at the left front arm!" | ||
echo $'\e[0;33mIf the blinking pattern didn\'t change: Please shutdown the NUC, detach the battery, attach it again and call this script again!\e[0m' | ||
else | ||
echo "OK. Exiting script..." | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters