Skip to content

Commit

Permalink
Update CI, prepare for Jazzy
Browse files Browse the repository at this point in the history
  • Loading branch information
fred-labs committed Jul 29, 2024
1 parent 0ac88f6 commit 68e4d69
Show file tree
Hide file tree
Showing 34 changed files with 276 additions and 118 deletions.
13 changes: 6 additions & 7 deletions .github/workflows/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
ARG ROS_DISTRO=humble
# Use the ROS desktop-full image as the base

FROM osrf/ros:${ROS_DISTRO}-desktop-full
SHELL ["/bin/bash", "-xo", "pipefail", "-c"]

# Install system dependencies
# hadolint ignore=DL3008
Expand All @@ -16,14 +17,10 @@ RUN --mount=type=bind,source=.,target=/scenario_execution \
rosdep install --rosdistro=${ROS_DISTRO} --from-paths /scenario_execution/ --ignore-src -r -y && \
rm -rf /var/lib/apt/lists/*

# hadolint ignore=DL3042
RUN --mount=type=bind,source=.,target=/scenario_execution \
pip3 install -r /scenario_execution/requirements.txt && \
pip3 install -r /scenario_execution/libs/scenario_execution_floorplan_dsl/requirements.txt && \
pip3 install -r /scenario_execution/libs/scenario_execution_pybullet/requirements.txt
pip3 install --no-cache-dir -r /scenario_execution/libs/scenario_execution_pybullet/requirements.txt

# install rosbag2_to_video used within github actions
SHELL ["/bin/bash", "-xo", "pipefail", "-c"]
WORKDIR /rosbag2_to_video/src
RUN git clone https://github.com/ivanpauno/rosbag2_to_video.git
WORKDIR /rosbag2_to_video/src/rosbag2_to_video
Expand All @@ -32,5 +29,7 @@ WORKDIR /rosbag2_to_video
RUN apt-get update && \
rosdep install --from-paths src --ignore-src -y && \
rm -rf "/var/lib/apt/lists/*" && \
. /opt/ros/${ROS_DISTRO}/setup.bash && \
. "/opt/ros/${ROS_DISTRO}/setup.bash" && \
colcon build

WORKDIR /scenario_execution
6 changes: 2 additions & 4 deletions .github/workflows/scan.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
---
name: Scan
on:
# Triggers the workflow on push or pull request events but
# only for the main branch
push:
branches: [main,humble,jazzy]
branches: [main, humble, jazzy]
pull_request:
branches: [main,humble,jazzy]
branches: [main, humble, jazzy]
workflow_dispatch:
permissions: read-all
jobs:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/scorecard.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ jobs:
# For private repositories:
# - `publish_results` will always be set to `false`, regardless
# of the value entered here.
publish_results: true
publish_results: false

# Upload the results as artifacts (optional). Commenting out will disable uploads of run results in SARIF
# format to the repository Actions tab.
Expand Down
10 changes: 7 additions & 3 deletions .github/workflows/test_build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ on:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
permissions: read-all
jobs:
build:
#TODO model dependency to image-workflow. Workaround: retrigger run after image-workflow finished.
Expand Down Expand Up @@ -302,7 +303,7 @@ jobs:
export IGN_PARTITION=${HOSTNAME}:${GITHUB_RUN_ID}
sed -i 's/240s/900s/g' examples/example_multi_robot/scenarios/example_multi_robot.osc
# shellcheck disable=SC1083
scenario_batch_execution -i examples/example_multi_robot/scenarios/ -o test_example_multirobot -- ros2 launch tb4_sim_scenario sim_nav_scenario_launch.py scenario:={SCENARIO} yaw:=3.14 output_dir:={OUTPUT_DIR} headless:=True
scenario_batch_execution -i examples/example_multi_robot/scenarios/ -o test_example_multirobot -- ros2 launch tb4_sim_scenario sim_nav_scenario_launch.py scenario:={SCENARIO} output_dir:={OUTPUT_DIR} headless:=True
- name: Upload result
uses: actions/upload-artifact@0b2256b8c012f0828dc542b3febcab082c67f72b # v4.3.4
if: always()
Expand Down Expand Up @@ -412,7 +413,7 @@ jobs:
source install/setup.bash
Xvfb :1 -screen 0 800x600x16 &
export DISPLAY=:1.0
sed -i 's/p.GUI/p.DIRECT/g' ./install/scenario_execution_pybullet/lib/python3.10/site-packages/scenario_execution_pybullet/actions/sim_initialize.py
sed -i 's/p.GUI/p.DIRECT/g' ./install/scenario_execution_pybullet/lib/python3.1*/site-packages/scenario_execution_pybullet/actions/sim_initialize.py
ros2 run scenario_execution scenario_execution libs/scenario_execution_pybullet/scenarios/example_pybullet.osc -t -s 0.00416666666 -o test_scenario_execution_pybullet
- name: Upload result
uses: actions/upload-artifact@0b2256b8c012f0828dc542b3febcab082c67f72b # v4.3.4
Expand All @@ -436,6 +437,9 @@ jobs:
- test-scenario-execution-pybullet
runs-on: intellabs-01
if: ${{ always() }}
permissions:
checks: write
pull-requests: write
steps:
- name: Download all artifacts
uses: actions/download-artifact@7a1cd3216ca9260cd8022db641d960b1db4d1be4 #v4.0
Expand Down Expand Up @@ -467,4 +471,4 @@ jobs:
downloaded-artifacts/test-example-multirobot-result/test.xml
downloaded-artifacts/test-example-external-method-result/test.xml
downloaded-artifacts/test-scenario-execution-gazebo/test.xml
downloaded-artifacts/test-scenario-execution-pybullet/test.xml
downloaded-artifacts/test-scenario-execution-pybullet/test.xml
4 changes: 1 addition & 3 deletions deb_requirements.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
ros-humble-turtlebot4-simulator
ros-humble-py-trees-ros-interfaces
ros-humble-py-trees
python3-autopep8
clang-format
pylint
python3-antlr4
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@ scenario multi_robot:
robot2.spawn(pose_3d(position_3d(x: -3.0, y: 1.5, z: 0.3), orientation_3d(yaw: -1.57)), model: 'example_multi_robot://models/robot.sdf')
ros_launch("example_multi_robot", "robot2_launch.py", wait_for_shutdown: false)
ros_launch("gazebo_static_camera", "spawn_static_camera_launch.py", [ key_value('x', '-3'), key_value('z', '10'), key_value('pitch', '1.57')], wait_for_shutdown: false)
record_bag(['/tf', '/tf_static', '/scenario_execution/snapshots', '/map', '/static_camera/image_raw', '/local_costmap/costmap', '/initialpose'], use_sim_time: true)
record_bag(['/tf', '/tf_static', '/scenario_execution/snapshots', '/map', '/static_camera/image_raw', '/local_costmap/costmap'], use_sim_time: true)
parallel:
test_drive: serial:
robot.init_nav2(initial_pose: pose_3d(orientation: orientation_3d(yaw: 3.14rad)))
robot.init_nav2(initial_pose: pose_3d())
robot.nav_to_pose(goal_pose: pose_3d(position: position_3d(x: -4.0m), orientation: orientation_3d(yaw: 3.14rad)))
emit end
serial:
Expand Down
1 change: 1 addition & 0 deletions libs/scenario_execution_floorplan_dsl/package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@

<exec_depend>docker</exec_depend>
<exec_depend>py_trees</exec_depend>
<exec_depend>python3-docker</exec_depend>

<test_depend>ament_copyright</test_depend>
<test_depend>ament_flake8</test_depend>
Expand Down
1 change: 0 additions & 1 deletion libs/scenario_execution_floorplan_dsl/requirements.txt

This file was deleted.

2 changes: 2 additions & 0 deletions libs/scenario_execution_gazebo/package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@

<exec_depend>rclpy</exec_depend>
<exec_depend>py_trees</exec_depend>
<exec_depend>python3-transforms3d</exec_depend>
<exec_depend>python3-defusedxml</exec_depend>

<test_depend>ament_copyright</test_depend>
<test_depend>ament_flake8</test_depend>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@

class ActorExistsActionState(Enum):
"""
States for executing a entity check in ignition
States for executing a entity check in gazebo
"""
IDLE = 1
WAITING_FOR_ACTOR = 2
Expand All @@ -33,7 +33,7 @@ class ActorExistsActionState(Enum):

class GazeboActorExists(RunProcess):
"""
Class to check existance of an entity in Ignition
Class to check existance of an entity in gazebo
"""

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ class DeleteActionState(Enum):

class GazeboDeleteActor(RunProcess):
"""
Class to delete an entity in Ignition
Class to delete an entity in gazebo
"""

Expand Down
6 changes: 5 additions & 1 deletion libs/scenario_execution_gazebo/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,11 @@
['resource/' + PACKAGE_NAME]),
('share/' + PACKAGE_NAME, ['package.xml'])
],
install_requires=['setuptools'],
install_requires=[
'setuptools',
'transforms3d==0.3.1',
'defusedxml==0.7.1',
],
zip_safe=True,
maintainer='Intel Labs',
maintainer_email='[email protected]',
Expand Down
2 changes: 2 additions & 0 deletions scenario_coverage/package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
<license file="../LICENSE">Apache-2.0</license>

<exec_depend>scenario_execution</exec_depend>
<test_depend>python3-pexpect</test_depend>
<test_depend>python3-defusedxml</test_depend>

<test_depend>ament_copyright</test_depend>
<test_depend>ament_flake8</test_depend>
Expand Down
6 changes: 5 additions & 1 deletion scenario_coverage/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,11 @@
('share/' + PACKAGE_NAME, ['package.xml']),
(os.path.join('share', PACKAGE_NAME, 'launch'), glob('launch/*launch.py'))
],
install_requires=['setuptools'],
install_requires=[
'setuptools',
'pexpect==4.8.0',
'defusedxml==0.7.1',
],
zip_safe=True,
maintainer='Intel Labs',
maintainer_email='[email protected]',
Expand Down
1 change: 1 addition & 0 deletions scenario_execution/package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
<license file="../LICENSE">Apache-2.0</license>

<exec_depend>py_trees</exec_depend>
<exec_depend>python3-yaml</exec_depend>

<test_depend>ament_copyright</test_depend>
<test_depend>ament_flake8</test_depend>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
#
# SPDX-License-Identifier: Apache-2.0

# Generated from OpenSCENARIO2.g4 by ANTLR 4.7.2
# Generated from OpenSCENARIO2.g4 by ANTLR 4.9.1
from antlr4 import *
from io import StringIO
from typing.io import TextIO
Expand Down Expand Up @@ -579,7 +579,7 @@ class OpenSCENARIO2Lexer(Lexer):

def __init__(self, input=None, output: TextIO = sys.stdout):
super().__init__(input, output)
self.checkVersion("4.7.2")
self.checkVersion("4.9.1")
self._interp = LexerATNSimulator(self, self.atn, self.decisionsToDFA, PredictionContextCache())
self._actions = None
self._predicates = None
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
#
# SPDX-License-Identifier: Apache-2.0

# Generated from OpenSCENARIO2.g4 by ANTLR 4.7.2
# Generated from OpenSCENARIO2.g4 by ANTLR 4.9.1
from antlr4 import *
if __name__ is not None and "." in __name__:
from .OpenSCENARIO2Parser import OpenSCENARIO2Parser
Expand Down Expand Up @@ -1249,3 +1249,6 @@ def enterIntegerLiteral(self, ctx: OpenSCENARIO2Parser.IntegerLiteralContext):
# Exit a parse tree produced by OpenSCENARIO2Parser#integerLiteral.
def exitIntegerLiteral(self, ctx: OpenSCENARIO2Parser.IntegerLiteralContext):
pass


del OpenSCENARIO2Parser
Loading

0 comments on commit 68e4d69

Please sign in to comment.