-
Notifications
You must be signed in to change notification settings - Fork 1
/
start_arm.sh
executable file
·48 lines (38 loc) · 981 Bytes
/
start_arm.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
#!/bin/bash
current_dir=$(pwd)
sudo -i << EOF
cd "$current_dir"
### sourcing ROS files
source /opt/ros/foxy/setup.bash
source ROS_ws/install/setup.bash
### Launch the daemon
# Finds the USB port used for the arm, assumed that only one port is used
if [ -z "$(ls /dev/ttyUSB* 2>/dev/null)" ]
then
echo "Arm not connected"
else
cd umi-rtx/bin
sudo ./rtxd $(ls /dev/ttyUSB* 2>/dev/null)
echo "------------------"
### Launch ros_interface
cd ../..
if [ -e ./umi-rtx/ports/rtx-socket ]; then
# ros2 run ros_interface_umi_rtx nodeArm
echo "Start ROS2 interface ..."
ros2 launch ros_interface_umi_rtx arm.launch.py
##### REMOVE NEXT LINE IF YOU WANT LOGS #####
echo "Delete logs...."
rm -rf logs/*
cd
rm -rf .ros/log/*
#####
echo "------------------"
echo "Reboot ROS2 daemon"
ros2 daemon stop
ros2 daemon start
else
echo "umi-rtx/ports/rtx-socket file not found"
fi
fi
exit
EOF