-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Arpit Aggarwal
committed
Sep 27, 2022
1 parent
94a4587
commit d41c941
Showing
5 changed files
with
137 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
- type: system | ||
name: python3-colcon-common-extensions |
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,64 @@ | ||
#! /usr/bin/env bash | ||
|
||
keyurl="https://raw.githubusercontent.com/ros/rosdistro/master/ros.key" | ||
keyfile=/usr/share/keyrings/ros-archive-keyring.gpg | ||
rosrepo="ros2" | ||
|
||
rosrepourl="http://packages.ros.org/${rosrepo}/ubuntu $(lsb_release -sc) main" | ||
sourcefile=/etc/apt/sources.list.d/ros2.list | ||
sourceurl="deb [signed-by=${keyfile}] ${rosrepourl}" | ||
|
||
ADD_ROS_SOURCES=false | ||
ADD_ROS_GPG_KEY=false | ||
FORCE_UPDATE=false | ||
|
||
if [[ ! -f "${sourcefile}" ]] | ||
then | ||
tue-install-debug "Adding ROS2 sources to apt-get" | ||
ADD_ROS_SOURCES=true | ||
ADD_ROS_GPG_KEY=true | ||
elif [[ $(cat "${sourcefile}") != "${sourceurl}" ]] | ||
then | ||
tue-install-debug "Updating ROS2 sources to apt-get" | ||
ADD_ROS_SOURCES=true | ||
ADD_ROS_GPG_KEY=true | ||
else | ||
tue-install-debug "ROS2 sources already added to apt-get" | ||
fi | ||
|
||
if [[ "${ADD_ROS_GPG_KEY}" == "false" ]] | ||
then | ||
if [[ ! -f "${keyfile}" ]] | ||
then | ||
tue-install-debug "No existing GPG key of ROS2 repository found, adding a new one" | ||
ADD_ROS_GPG_KEY=true | ||
elif gpg --import --import-options show-only "${keyfile}" 2> /dev/null | grep -q expired | ||
then | ||
tue-install-debug "Updating expired GPG key of ROS2 repository" | ||
ADD_ROS_GPG_KEY=true | ||
else | ||
tue-install-debug "Not updating the existing GPG of the ROS2 repository" | ||
fi | ||
fi | ||
|
||
if [[ "${ADD_ROS_GPG_KEY}" == "true" ]] | ||
then | ||
sudo curl -sSL "${keyurl}" -o "${keyfile}" | ||
tue-install-debug "Successfully added/updated ROS2 repository GPG key" | ||
|
||
FORCE_UPDATE=true | ||
fi | ||
|
||
if [[ "${ADD_ROS_SOURCES}" == "true" ]] | ||
then | ||
echo "${sourceurl}" | sudo tee "${sourcefile}" > /dev/null | ||
tue-install-debug "Successfully added/updated ROS2 source file in apt" | ||
|
||
FORCE_UPDATE=true | ||
fi | ||
|
||
if [[ "${FORCE_UPDATE}" == "true" ]] | ||
then | ||
sudo apt-get update -qq | ||
tue-install-debug "Successfully updated ROS2 sources" | ||
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
#! /usr/bin/env bash | ||
# shellcheck disable=SC1090 | ||
|
||
if [ -z "$TUE_ROS_DISTRO" ] | ||
then | ||
tue-install-error "TUE_ROS_DISTRO was not set" | ||
return 1 | ||
fi | ||
|
||
# Install basic ROS packages and eProsima DDS implementation. | ||
tue-install-system-now ros-"$TUE_ROS_DISTRO"-ros-core ros-"$TUE_ROS_DISTRO"-rmw-fastrtps-cpp | ||
|
||
# Setup the build environment | ||
mkdir -p "$TUE_WS_DIR" | ||
|
||
if [ ! -f "$TUE_WS_DIR"/install/setup.bash ] | ||
then | ||
[[ -z "${TUE_ROS_VERSION}" ]] && { tue-install-warning "tue-env variable TUE_ROS_VERSION is not set. This will not be allowed in the future.\nSetting TUE_ROS_VERSION=2 temporarily."; } | ||
TUE_ROS_VERSION=2 tue-make || tue-install-error "Error in building the ROS2 system workspace" | ||
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
- type: target | ||
name: ros2-setup | ||
|
||
- type: target-now | ||
name: colcon | ||
|
||
- type: target-now | ||
name: build-essential |
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,43 @@ | ||
#! /usr/bin/env bash | ||
|
||
if [ -z "$TUE_ROS_DISTRO" ] | ||
then | ||
echo "[ros2] TUE_ROS_DISTRO was not set" | ||
return 1 | ||
fi | ||
|
||
# shellcheck disable=SC1090 | ||
# Add ROS sourcing to the shell startup script | ||
if [ -f "/opt/ros/${TUE_ROS_DISTRO}/setup.bash" ] | ||
then | ||
source "/opt/ros/${TUE_ROS_DISTRO}/setup.bash" | ||
else | ||
echo -e "\033[33;1m[ros2] ROS 2 ${TUE_ROS_DISTRO} setup.bash not found. \033[0m" | ||
fi | ||
|
||
# shellcheck disable=SC1090 | ||
if [ -f "${TUE_WS_DIR}/install/local_setup.bash" ] | ||
then | ||
source "${TUE_WS_DIR}/install/local_setup.bash" | ||
else | ||
echo -e "\033[33;1m[ros2] ${TUE_WS_DIR}/install/local_setup.bash not found. \033[0m" | ||
fi | ||
|
||
# Add Colcon sourcing to the shell startup script | ||
if [ -f "/usr/share/colcon_cd/function/colcon_cd.sh" ] | ||
then | ||
# shellcheck disable=SC1091 | ||
source /usr/share/colcon_cd/function/colcon_cd.sh | ||
# shellcheck disable=SC2016 | ||
export _colcon_cd_root="${TUE_WS_DIR}" | ||
else | ||
echo -e "\033[33;5;1m[ros2] colcon_cd setup not found. colcon_cd command disabled. \033[0m" | ||
fi | ||
|
||
# shellcheck disable=SC2016 | ||
ROSCONSOLE_FORMAT='[${severity}][${node}][${time}]: ${message}' | ||
export ROSCONSOLE_FORMAT | ||
|
||
# shellcheck disable=SC2016 | ||
# Make eProsima DDS implementation default | ||
export RMW_IMPLEMENTATION=rmw_fastrtps_cpp |