forked from lucidvisionlabs/arena_camera_ros
-
Notifications
You must be signed in to change notification settings - Fork 0
/
ros_and_workspace_setup.sh
executable file
·115 lines (90 loc) · 3.66 KB
/
ros_and_workspace_setup.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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
#!/bin/bash
#
# MAIN VARS TO CHANGE
#
ARENA_INSTALLATION_ROOT="$HOME/software/OutputDirectory/Linux"
ARENA_ROS_WORDSPACE_TO_SETUP="$HOME/arena_camera_ros/catkin_ws" #change to workspace location
INSTALL_ROS=1
############################################################
# Note:
# ArenaSDK does not need to be installed as long as
# $ARENA_INSTALLATION_ROOT point to ArenaSDK binaries
#
############################################################
set -x #echo on
# only run with sudo
if [ `id -u` -ne 0 ]; then
echo "Please run as root"
exit
fi
# info
CURR_OS="$(lsb_release -sc)"
if [ $CURR_OS = "xenial" ]; then
ROS_DIS="kinetic"
elif [ $CURR_OS = "bionic" ]; then
ROS_DIS="melodic"
elif [ $CURR_OS = "focal" ]; then
ROS1_DIS="noetic"
else
echo "$CURR_OS is might not be supported yet! check https://support.thinklucid.com/using-ros-for-linux/"
exit -1
fi
############################################################
# ROS section
############################################################
if [ $INSTALL_ROS -eq 1 ]; then
# Set up your system to acquire software from packages.ros.org
sudo echo "deb http://packages.ros.org/ros/ubuntu $CURR_OS main" > /etc/apt/sources.list.d/ros-latest.list
# Use apt-key to install the Open Robotics key to your list of trusted keys.
# to remove the key at uninstaltion time run `sudo apt-key del F42ED6FBAB17C654`
sudo apt-key adv --keyserver 'hkp://keyserver.ubuntu.com:80' --recv-key C1CF6E31E6BADE8868B172B4F42ED6FBAB17C654
# Install ROS Desktop.
sudo apt-get update
sudo apt-get install ros-$ROS_DIS-desktop-full
# Setup system dependencies for ROS.
# NOTE: might need sudo apt-get install python[3]-rosdep
sudo rosdep init
sudo rosdep fix-permissions
rosdep update
# Setups ROS environment variables
#echo "# load ROS env vars" >> ~/.bashrc
#echo "source /opt/ros/$ROS_DIS/setup.bash" >> ~/.bashrc
#echo "# load ROS env vars" >> ~/.zshrc
#echo "source /opt/ros/$ROS_DIS/setup.zsh" >> ~/.zshrc
# would not have an effect if script is not run in intractive mode
#source ~/.bashrc
#
# Install ROS package workspace dependencies. This will allow
# you to create and manage your own ROS workspaces, including
# the ROS workspace usedby arena_camera.
#
sudo apt-get install python-rosinstall \
python-rosinstall-generator \
python-wstool \
build-essential
fi
############################################################
# Arena SDK section
############################################################
# dont not need to be installed as long as
# $ARENA_INSTALLATION_ROOT points to ArenaSDK binaries
# Set up your ARENA_ROOT environment variable. This
# environment variable should be the path where you have
# installed Arena SDK.
#echo "export ARENA_ROOT=$ARENA_INSTALLATION_ROOT">> ~/.bashrc
#echo "export ARENA_ROOT=$ARENA_INSTALLATION_ROOT">> ~/.zshrc
# would not have an effect if script is not run in intractive mode
#source ~/.bashrc
############################################################
# Workspace section
############################################################
# Copy the included image_encoding.h to your ROS include folder after
# baking the old one up (if existed).
# A custom image_encoding.h is included to enable streaming
# support for LUCID’s Helios camera.
sudo cp -f \
/opt/ros/$ROS_DIS/include/sensor_msgs/image_encodings.h \
/opt/ros/$ROS_DIS/include/sensor_msgs/image_encodings.h.bak
sudo cp -f \
$ARENA_ROS_WORDSPACE_TO_SETUP/inc/image_encodings.h \
/opt/ros/$ROS_DIS/include/sensor_msgs/image_encodings.h