forked from robotology-playground/robotology-superbuild
-
Notifications
You must be signed in to change notification settings - Fork 3
/
robotology-setup.bash
299 lines (243 loc) · 12.8 KB
/
robotology-setup.bash
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
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
#!/bin/bash
ROBOTOLOGY_ROOT=$(dirname $(readlink --canonicalize --no-newline $BASH_SOURCE))
export ROBOTOLOGY_ROOT
export XBOT_ROOT=$ROBOTOLOGY_ROOT
if [ -f $ROBOTOLOGY_ROOT/build/active_profile ]; then
source $ROBOTOLOGY_ROOT/build/active_profile
else
export ROBOTOLOGY_PROFILE=SIMULATION
fi
pathadd() {
if [ -z ${!1} ]; then
export $1=$2
elif [ -d "$2" ] && [[ ! ${!1} =~ (^|:)$2(:|$) ]]; then
export $1+=:$2
fi
}
if [ -f /opt/ros/hydro/setup.bash ]; then
source /opt/ros/hydro/setup.bash
fi
if [ -f /opt/ros/indigo/setup.bash ]; then
source /opt/ros/indigo/setup.bash
fi
if [ -f /opt/ros/kinetic/setup.bash ]; then
source /opt/ros/kinetic/setup.bash
fi
if [ -f ${ROBOTOLOGY_ROOT}/external/moveit/install/setup.bash ]; then
source ${ROBOTOLOGY_ROOT}/external/moveit/install/setup.bash
fi
#if [ -d /usr/xenomai/include/cobalt/ ]; then
# pathadd CPATH /usr/xenomai/include/cobalt/
#fi
#orocos
if [ -f ${ROBOTOLOGY_ROOT}/orocos_ws/install_isolated/setup.bash ]; then
source ${ROBOTOLOGY_ROOT}/orocos_ws/install_isolated/setup.bash
if [ -f ${ROBOTOLOGY_ROOT}/orocos_ws/src/env.sh ]; then
source ${ROBOTOLOGY_ROOT}/orocos_ws/src/env.sh
fi
pathadd CPATH ${ROBOTOLOGY_ROOT}/orocos_ws/install_isolated/include
pathadd CPATH ${ROBOTOLOGY_ROOT}/orocos_ws/install_isolated/include/orocos
export LD_LIBRARY_PATH=$ROBOTOLOGY_ROOT/orocos_ws/install_isolated/lib:$LD_LIBRARY_PATH
export LIBRARY_PATH=$ROBOTOLOGY_ROOT/orocos_ws/install_isolated/lib:$LIBRARY_PATH
pathadd RTT_COMPONENT_PATH /opt/ros/${ROS_DISTRO}/lib/orocos/gnulinux/ocl
pathadd RTT_COMPONENT_PATH /opt/ros/${ROS_DISTRO}/lib/orocos/gnulinux/plugins
pathadd RTT_COMPONENT_PATH $ROBOTOLOGY_ROOT/build/install/lib/orocos
if [ -f ${ROBOTOLOGY_ROOT}/external/rtt-gazebo-lwr4plus-sim/CMakeLists.txt ]; then
pathadd RTT_COMPONENT_PATH $ROBOTOLOGY_ROOT/build/external/rtt-gazebo-lwr4plus-sim/orocos
fi
if [ -f ${ROBOTOLOGY_ROOT}/robots/cogimon-gazebo-models/database.config ]; then
pathadd GAZEBO_MODEL_PATH $ROBOTOLOGY_ROOT/robots/cogimon-gazebo-models
fi
if [ -f ${ROBOTOLOGY_ROOT}/external/rtt-gazebo-clock-plugin/CMakeLists.txt ]; then
pathadd GAZEBO_PLUGIN_PATH $ROBOTOLOGY_ROOT/build/install/lib/orocos/gnulinux/rtt_gazebo_system
fi
if [ -f ${ROBOTOLOGY_ROOT}/external/orocos_ros_joint_state_publisher/CMakeLists.txt ]; then
if [ ${OROCOS_TARGET} = 'xenomai' ]; then
pathadd RTT_COMPONENT_PATH $ROBOTOLOGY_ROOT/build/install/lib/orocos/xenomai/orocos_ros_joint_state_publisher
else
pathadd RTT_COMPONENT_PATH $ROBOTOLOGY_ROOT/build/install/lib/orocos/gnulinux/orocos_ros_joint_state_publisher
fi
fi
if [ -f ${ROBOTOLOGY_ROOT}/robots/rtt_coman/CMakeLists.txt ]; then
if [ ${OROCOS_TARGET} = 'xenomai' ]; then
pathadd RTT_COMPONENT_PATH $ROBOTOLOGY_ROOT/build/install/lib/orocos/xenomai/rtt_coman
else
pathadd RTT_COMPONENT_PATH $ROBOTOLOGY_ROOT/build/install/lib/orocos/gnulinux/rtt_coman
fi
fi
if [ -f ${ROBOTOLOGY_ROOT}/external/ros_orocos_joints_gui/CMakeLists.txt ]; then
if [ ${OROCOS_TARGET} = 'xenomai' ]; then
pathadd RTT_COMPONENT_PATH $ROBOTOLOGY_ROOT/build/install/lib/orocos/xenomai/ros_orocos_joints_gui
else
pathadd RTT_COMPONENT_PATH $ROBOTOLOGY_ROOT/build/install/lib/orocos/gnulinux/ros_orocos_joints_gui
fi
fi
if [ -f ${ROBOTOLOGY_ROOT}/external/ros_orocos_joint_trajectory_server/CMakeLists.txt ]; then
if [ ${OROCOS_TARGET} = 'xenomai' ]; then
pathadd RTT_COMPONENT_PATH $ROBOTOLOGY_ROOT/build/install/lib/orocos/xenomai/ros_orocos_joint_trajectory_server
else
pathadd RTT_COMPONENT_PATH $ROBOTOLOGY_ROOT/build/install/lib/orocos/gnulinux/ros_orocos_joint_trajectory_server
fi
fi
if [ -f ${ROBOTOLOGY_ROOT}/external/RobotInterfaceOROCOS/CMakeLists.txt ]; then
pathadd RTT_COMPONENT_PATH $ROBOTOLOGY_ROOT/build/install/lib
pathadd RTT_COMPONENT_PATH $ROBOTOLOGY_ROOT/build/install/lib/orocos/gnulinux/RobotInterfaceOROCOS
pathadd RTT_COMPONENT_PATH $ROBOTOLOGY_ROOT/build/install/lib/orocos/xenomai/RobotInterfaceOROCOS
fi
fi
#gazebo setup
if [ -f /usr/share/gazebo/setup.sh ]; then
source /usr/share/gazebo/setup.sh
fi
if [ -f ${ROBOTOLOGY_ROOT}/external/ros2_ws/install/local_setup.sh ]; then
source ${ROBOTOLOGY_ROOT}/external/ros2_ws/install/local_setup.*
fi
export PATH=$ROBOTOLOGY_ROOT/build/install/bin:$PATH
export LD_LIBRARY_PATH=$ROBOTOLOGY_ROOT/build/install/lib:$LD_LIBRARY_PATH
export LTDL_LIBRARY_PATH=$ROBOTOLOGY_ROOT/build/install/lib/roboptim-core:$LTDL_LIBRARY_PATH
pathadd CMAKE_PREFIX_PATH $ROBOTOLOGY_ROOT/build/install
export ROS_PACKAGE_PATH=$ROBOTOLOGY_ROOT/build/install/share:$ROS_PACKAGE_PATH
pathadd ROS_PACKAGE_PATH $ROBOTOLOGY_ROOT/build/install/stacks
pathadd ROS_PACKAGE_PATH $ROBOTOLOGY_ROOT/build/install/lib
pathadd ROS_PACKAGE_PATH $ROBOTOLOGY_ROOT/robots/iit-walkman-ros-pkg
pathadd GAZEBO_MODEL_PATH $ROBOTOLOGY_ROOT/robots/iit-walkman-ros-pkg/walkman_gazebo/database
pathadd ROS_PACKAGE_PATH $ROBOTOLOGY_ROOT/robots/reemc_robot/reemc_description
pathadd ROS_PACKAGE_PATH $ROBOTOLOGY_ROOT/external/tutorial_iros2018
pathadd GAZEBO_MODEL_PATH $ROBOTOLOGY_ROOT/robots/gazebo_models
pathadd GAZEBO_MODEL_PATH $ROBOTOLOGY_ROOT/external/srcsim/models
pathadd ROS_PACKAGE_PATH $ROBOTOLOGY_ROOT/robots/iit-coman-ros-pkg
pathadd ROS_PACKAGE_PATH $ROBOTOLOGY_ROOT/robots/IITComanRosPkg
pathadd ROS_PACKAGE_PATH $ROBOTOLOGY_ROOT/robots/abb-yumi-ros-pkg
pathadd ROS_PACKAGE_PATH $ROBOTOLOGY_ROOT/robots/icub_description
pathadd ROS_PACKAGE_PATH $ROBOTOLOGY_ROOT/robots/hyq-description
pathadd ROS_PACKAGE_PATH $ROBOTOLOGY_ROOT/robots/hyqreal-description
pathadd ROS_PACKAGE_PATH $ROBOTOLOGY_ROOT/robots/iit-teleop-ros-pkg
pathadd ROS_PACKAGE_PATH $ROBOTOLOGY_ROOT/robots/iit-pholus-ros-pkg
pathadd GAZEBO_MODEL_PATH $ROBOTOLOGY_ROOT/robots/iit-pholus-ros-pkg/pholus_gazebo/database
pathadd ROS_PACKAGE_PATH $ROBOTOLOGY_ROOT/robots/iit-hyqreal-teleop-ros-pkg
pathadd ROS_PACKAGE_PATH $ROBOTOLOGY_ROOT/robots/universal_robots/ur_description
pathadd ROS_PACKAGE_PATH $ROBOTOLOGY_ROOT/robots/zed-ros-wrapper/zed_wrapper
pathadd GAZEBO_MODEL_PATH $ROBOTOLOGY_ROOT/robots/iit-teleop-ros-pkg/teleop_gazebo/database
pathadd GAZEBO_MODEL_PATH $ROBOTOLOGY_ROOT/robots/iit-hyqreal-teleop-ros-pkg/hyqreal-teleop_gazebo/database
pathadd CPATH $ROBOTOLOGY_ROOT/build/install/include
pathadd CPATH /opt/ros/${ROS_DISTRO}/include
pathadd PYTHONPATH $ROBOTOLOGY_ROOT/build/install/lib/python2.7/site-packages
pathadd PYTHONPATH $ROBOTOLOGY_ROOT/build/install/lib/python2.7/dist-packages
pathadd PYTHONPATH $ROBOTOLOGY_ROOT/external/OpenSoT/python/interfaces/yarp
pathadd PKG_CONFIG_PATH $ROBOTOLOGY_ROOT/build/install/lib/pkgconfig
pathadd GAZEBO_PLUGIN_PATH /opt/ros/${ROS_DISTRO}/lib
pathadd GAZEBO_PLUGIN_PATH $ROBOTOLOGY_ROOT/build/install/lib
pathadd GAZEBO_MODEL_PATH $ROBOTOLOGY_ROOT/robots/iit-coman-ros-pkg/coman_gazebo/database
pathadd GAZEBO_MODEL_PATH $ROBOTOLOGY_ROOT/robots/icub_gazebo
if [ -d $ROBOTOLOGY_ROOT/robots/walkman_final_demo_field ]; then
pathadd GAZEBO_MODEL_PATH $ROBOTOLOGY_ROOT/robots/walkman_final_demo_field
pathadd ROS_PACKAGE_PATH $ROBOTOLOGY_ROOT/robots/walkman_final_demo_field
fi
if [ -d $ROBOTOLOGY_ROOT/robots/iit-bigman-ros-pkg ]; then
pathadd ROS_PACKAGE_PATH $ROBOTOLOGY_ROOT/robots/iit-bigman-ros-pkg
pathadd GAZEBO_MODEL_PATH $ROBOTOLOGY_ROOT/robots/iit-bigman-ros-pkg/bigman_gazebo/database
fi
if [ -d $ROBOTOLOGY_ROOT/robots/iit-panda-ros-pkg ]; then
pathadd ROS_PACKAGE_PATH $ROBOTOLOGY_ROOT/robots/iit-panda-ros-pkg
fi
if [ -d $ROBOTOLOGY_ROOT/robots/iit-kuka_lwr-ros-pkg ]; then
pathadd ROS_PACKAGE_PATH $ROBOTOLOGY_ROOT/robots/iit-kuka_lwr-ros-pkg
# pathadd GAZEBO_MODEL_PATH $ROBOTOLOGY_ROOT/robots/iit-kuka_lwr-ros-pkg/kuka_gazebo/database
fi
if [ -d $ROBOTOLOGY_ROOT/robots/iit-iiwa-ros-pkg ]; then
pathadd ROS_PACKAGE_PATH $ROBOTOLOGY_ROOT/robots/iit-iiwa-ros-pkg #/iiwa_description/
# pathadd GAZEBO_MODEL_PATH $ROBOTOLOGY_ROOT/robots/iit-kuka_lwr-ros-pkg/kuka_gazebo/database
fi
if [ -d $ROBOTOLOGY_ROOT/robots/openth/ynl-hydra-ros-pkg ]; then
pathadd ROS_PACKAGE_PATH $ROBOTOLOGY_ROOT/robots/openth/ynl-hydra-ros-pkg
pathadd GAZEBO_MODEL_PATH $ROBOTOLOGY_ROOT/robots/openth/ynl-hydra-ros-pkg/hydra_gazebo/database
fi
if [ -d $ROBOTOLOGY_ROOT/robots/iit-cogimon-ros-pkg ]; then
pathadd ROS_PACKAGE_PATH $ROBOTOLOGY_ROOT/robots/iit-cogimon-ros-pkg
pathadd GAZEBO_MODEL_PATH $ROBOTOLOGY_ROOT/robots/iit-cogimon-ros-pkg/cogimon_gazebo/database
fi
if [ -d $ROBOTOLOGY_ROOT/robots/iit-bonn-centauro-ros-pkg ]; then
pathadd ROS_PACKAGE_PATH $ROBOTOLOGY_ROOT/robots/iit-bonn-centauro-ros-pkg
pathadd GAZEBO_MODEL_PATH $ROBOTOLOGY_ROOT/robots/iit-bonn-centauro-ros-pkg/bonn_centauro_gazebo/database
fi
if [ -d $ROBOTOLOGY_ROOT/external/yarp_ros_joint_state_publisher ]; then
pathadd ROS_PACKAGE_PATH $ROBOTOLOGY_ROOT/external/yarp_ros_joint_state_publisher
fi
if [ -d $ROBOTOLOGY_ROOT/external/robot_state_publisher_ext ]; then
pathadd ROS_PACKAGE_PATH $ROBOTOLOGY_ROOT/external/robot_state_publisher_ext
fi
if [ -d ${ROBOTOLOGY_ROOT}/external/ros_orocos_joints_gui ]; then
pathadd ROS_PACKAGE_PATH $ROBOTOLOGY_ROOT/external/ros_orocos_joints_gui
pathadd ROS_PACKAGE_PATH $ROBOTOLOGY_ROOT/external/ros_orocos_joints_gui/python
fi
if [ -d ${ROBOTOLOGY_ROOT}/robots/centauro-simulator ]; then
pathadd ROS_PACKAGE_PATH $ROBOTOLOGY_ROOT/robots/centauro-simulator
fi
if [ -d ${ROBOTOLOGY_ROOT}/robots/gazebo_ros_demos ]; then
pathadd ROS_PACKAGE_PATH $ROBOTOLOGY_ROOT/robots/gazebo_ros_demos
fi
if [ -d $ROBOTOLOGY_ROOT/robots/iit-flying_arm-ros-pkg ]; then
pathadd ROS_PACKAGE_PATH $ROBOTOLOGY_ROOT/robots/iit-flying_arm-ros-pkg
fi
# vigir stuffs
if [ -d $ROBOTOLOGY_ROOT/vigir/vigir_footstep_planning_basics ]; then
pathadd ROS_PACKAGE_PATH $ROBOTOLOGY_ROOT/vigir/vigir_footstep_planning_basics
fi
if [ -d $ROBOTOLOGY_ROOT/vigir/vigir_footstep_planning_core ]; then
pathadd ROS_PACKAGE_PATH $ROBOTOLOGY_ROOT/vigir/vigir_footstep_planning_core
fi
if [ -d $ROBOTOLOGY_ROOT/vigir/vigir_footstep_planning_msgs ]; then
pathadd ROS_PACKAGE_PATH $ROBOTOLOGY_ROOT/vigir/vigir_footstep_planning_msgs
fi
if [ -d $ROBOTOLOGY_ROOT/vigir/vigir_generic_params ]; then
pathadd ROS_PACKAGE_PATH $ROBOTOLOGY_ROOT/vigir/vigir_generic_params
fi
if [ -d $ROBOTOLOGY_ROOT/vigir/vigir_pluginlib ]; then
pathadd ROS_PACKAGE_PATH $ROBOTOLOGY_ROOT/vigir/vigir_pluginlib
fi
if [ -d $ROBOTOLOGY_ROOT/vigir/vigir_terrain_classifier ]; then
pathadd ROS_PACKAGE_PATH $ROBOTOLOGY_ROOT/vigir/vigir_terrain_classifier
fi
if [ -d $ROBOTOLOGY_ROOT/external/gazebo-pkgs ]; then
pathadd ROS_PACKAGE_PATH $ROBOTOLOGY_ROOT/external/gazebo-pkgs/gazebo_grasp_plugin
fi
if [ -d $ROBOTOLOGY_ROOT/network/nimbro_network ]; then
pathadd ROS_PACKAGE_PATH $ROBOTOLOGY_ROOT/external/network/nimbro_network
fi
export COMAN_ROOT=${ROBOTOLOGY_ROOT}/build/install
# TODO add a switch here to select correct robot
export YARP_ROBOT_NAME=bigman
export YARP_COLORED_OUTPUT=1
export YARP_DATA_DIRS=${ROBOTOLOGY_ROOT}/build/install/share/yarp/
unset YARP_CLOCK
unalias gazebo > /dev/null 2>&1
unalias gzserver > /dev/null 2>&1
if [ "${ROBOTOLOGY_PROFILE:=DEFAULT}" == "SIMULATION" ]; then
export YARP_CLOCK=/clock
alias gazeboyarp='gazebo --verbose -s libgazebo_yarp_clock.so'
alias gazeboros='export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$ROBOTOLOGY_ROOT/build/install/lib/drcsim_gazebo_ros_plugins/plugins; gazebo --verbose -s libgazebo_ros_api_plugin.so'
alias gazeborosyarp='export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$ROBOTOLOGY_ROOT/build/install/lib/drcsim_gazebo_ros_plugins/plugins; gazebo --verbose -s libgazebo_ros_api_plugin.so -s libgazebo_yarp_clock.so'
fi
export YARP_WORKSPACE=${ROBOTOLOGY_ROOT}/robots
if [ -f ${ROBOTOLOGY_ROOT}/external/YARP/scripts/yarp_completion ]; then
source ${ROBOTOLOGY_ROOT}/external/YARP/scripts/yarp_completion
fi
# Some aliases for superbuild/scripts
alias superbuild=". ${ROBOTOLOGY_ROOT}/scripts/superbuild.sh"
source ${ROBOTOLOGY_ROOT}/scripts/superbuild.profile
# add robotology folder for robot models
if [ -d $ROBOTOLOGY_ROOT/build/install/share/robots ]; then
export ROBOTOLOGY_ROBOTS=$ROBOTOLOGY_ROOT/build/install/share/robots
else
unset ROBOTOLOGY_ROBOTS
fi
#export xbot config
mkdir -p $ROBOTOLOGY_ROOT/build/install/configs
if [ -d $ROBOTOLOGY_ROOT/build/install/configs ]; then
export XBOT_CONFIG=$ROBOTOLOGY_ROOT/build/install/configs/active_config.yaml
else
export XBOT_CONFIG=
fi
export XBOT_PATH=$LD_LIBRARY_PATH
export BLOCKFACTORY_PLUGIN_PATH=~/devel-superbuild/build/install/lib/
export MATLABPATH=~/devel-superbuild/build/install/mex