Skip to content

Commit

Permalink
Fix usage of alternative ROS location when distro is not installed. (S…
Browse files Browse the repository at this point in the history
…toglRobotics#85)

* Fix usage of alternative ROS location when distro is not installed.
* Fix CI setup.
  • Loading branch information
destogl authored Dec 6, 2022
1 parent 8826439 commit f872374
Show file tree
Hide file tree
Showing 9 changed files with 110 additions and 12 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci-format.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
with:
python-version: '3.9.7'
python-version: '3.9'
cache: 'pip'
- name: Install clang-format-12
run: sudo apt-get install clang-format-12
Expand Down
6 changes: 4 additions & 2 deletions .github/workflows/ci-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,20 +7,22 @@ jobs:
ament_lint:
name: ament_${{ matrix.linter }}
runs-on: ubuntu-latest
env:
AMENT_CPPCHECK_ALLOW_SLOW_VERSIONS: True
strategy:
fail-fast: false
matrix:
linter: [cppcheck, cpplint, lint_cmake]
arguments: [""]
include:
- linter: copyright
arguments: "--exclude conf.py test_robot_description.launch.py view_robot.launch.py robot_ros2_control.launch.py robot_ros2_control_sim.launch.py test_forward_position_controller.launch.py test_joint_trajectory_controller.launch.py"
arguments: "--exclude docs/conf.py"
steps:
- uses: actions/checkout@v2
- uses: ros-tooling/setup-ros@master
- uses: ros-tooling/action-ros-lint@master
with:
distribution: galactic
distribution: rolling
linter: ${{ matrix.linter }}
arguments: ${{ matrix.arguments }}
package-name:
Expand Down
6 changes: 3 additions & 3 deletions scripts/_RosTeamWs_Defines.bash
Original file line number Diff line number Diff line change
Expand Up @@ -383,14 +383,14 @@ function check_ros_distro {
local upper_case=$(echo $ros_distro | tr '[:lower:]' '[:upper:]')
local alternative_ros_location=ALTERNATIVE_ROS_${upper_case}_LOCATION
if [ ! -f "${!alternative_ros_location}/setup.bash" ]; then
notify_user "You are possibly trying to run unsupported ROS distro ('$ros_distro') for your version of Ubuntu. Please set ${alternative_ros_location} variable, e.g., 'export ${alternative_ros_location}=/opt/ros/rolling/setup.bash'. The best is to add that line somewhere at the beginning of the '~/.ros_team_ws_rc' file."
notify_user "You are possibly trying to run unsupported ROS distro ('$ros_distro') for your version of Ubuntu. Please set ${alternative_ros_location} variable, e.g., 'export ${alternative_ros_location}=/opt/ros/rolling'. The best is to add that line somewhere at the beginning of the '~/.ros_team_ws_rc' file."

print_and_exit "FATAL: ROS '$ros_distro' not installed on this computer! Exiting..."
else
user_decision "Using ${alternative_ros_location} for ${ros_distro}." user_answer
user_decision "Using ${!alternative_ros_location} for ${ros_distro}." user_answer
# check if the chosen ros-distro location is correct.
if [[ " ${negative_answers[*]} " =~ " ${user_answer} " ]]; then
print_and_exit "Please set your ALTERNATIVE_ROS_LOCATION to the correct location. Exiting..."
print_and_exit "Please set ${alternative_ros_location} to the correct location. Exiting..."
fi
fi
fi
Expand Down
18 changes: 17 additions & 1 deletion templates/robot_description/test_robot_description.launch.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,20 @@
# $LICENSE$
# Copyright (c) 2022, Stogl Robotics Consulting UG (haftungsbeschränkt) (template)
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
#
# Author: Dr. Denis
#

from launch import LaunchDescription
from launch.actions import DeclareLaunchArgument
Expand Down
18 changes: 17 additions & 1 deletion templates/robot_description/view_robot.launch.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,20 @@
# $LICENSE$
# Copyright (c) 2022, Stogl Robotics Consulting UG (haftungsbeschränkt) (template)
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
#
# Author: Dr. Denis
#

from launch import LaunchDescription
from launch.actions import DeclareLaunchArgument
Expand Down
18 changes: 17 additions & 1 deletion templates/ros2_control/robot_ros2_control.launch.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,20 @@
# $LICENSE$
# Copyright (c) 2022, Stogl Robotics Consulting UG (haftungsbeschränkt) (template)
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
#
# Author: Dr. Denis
#

from launch import LaunchDescription
from launch.actions import (
Expand Down
18 changes: 17 additions & 1 deletion templates/ros2_control/robot_ros2_control_sim.launch.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,20 @@
# $LICENSE$
# Copyright (c) 2022, Stogl Robotics Consulting UG (haftungsbeschränkt) (template)
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
#
# Author: Dr. Denis
#

from launch import LaunchDescription
from launch.actions import (
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,20 @@
# $LICENSE$
# Copyright (c) 2022, Stogl Robotics Consulting UG (haftungsbeschränkt) (template)
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
#
# Author: Dr. Denis
#

from launch import LaunchDescription
from launch.substitutions import PathJoinSubstitution
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,20 @@
# $LICENSE$
# Copyright (c) 2022, Stogl Robotics Consulting UG (haftungsbeschränkt) (template)
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
#
# Author: Dr. Denis
#

from launch import LaunchDescription
from launch.substitutions import PathJoinSubstitution
Expand Down

0 comments on commit f872374

Please sign in to comment.