Skip to content

Commit 42185fa

Browse files
Add CI (#8)
* add CI files * lint * redo job list * lint * lint
1 parent 65ed7f5 commit 42185fa

File tree

4 files changed

+66
-23
lines changed

4 files changed

+66
-23
lines changed

.github/workflows/lint.yml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
name: Lint
2+
on:
3+
pull_request:
4+
5+
jobs:
6+
ament_lint_general:
7+
name: ament_${{ matrix.linter }}
8+
runs-on: ubuntu-latest
9+
container:
10+
image: rostooling/setup-ros-docker:ubuntu-noble-ros-rolling-ros-base-latest
11+
strategy:
12+
fail-fast: false
13+
matrix:
14+
linter: [copyright, xmllint, pep257, flake8]
15+
steps:
16+
- uses: actions/checkout@v2
17+
- uses: ros-tooling/[email protected]
18+
with:
19+
linter: ${{ matrix.linter }}
20+
distribution: rolling
21+
package-name: |
22+
nav2_minimal_tb3_sim
23+
nav2_minimal_tb4_description
24+
nav2_minimal_tb4_sim

.github/workflows/test.yml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name: Test
2+
on:
3+
pull_request:
4+
push:
5+
branches:
6+
- main
7+
8+
jobs:
9+
build_and_test:
10+
runs-on: ubuntu-latest
11+
env:
12+
ROS_DISTRO: ${{ matrix.ros_distro }}
13+
RMW_IMPLEMENTATION: rmw_cyclonedds_cpp
14+
container:
15+
image: rostooling/setup-ros-docker:ubuntu-noble-ros-rolling-ros-base-latest
16+
strategy:
17+
fail-fast: false
18+
matrix:
19+
ros_distro: [rolling]
20+
steps:
21+
- uses: actions/checkout@v2
22+
- name: Install Cyclone DDS
23+
run: sudo apt install ros-${{ matrix.ros_distro }}-rmw-cyclonedds-cpp -y
24+
- name: Build and run tests
25+
id: action-ros-ci
26+
uses: ros-tooling/[email protected]
27+
with:
28+
import-token: ${{ secrets.GITHUB_TOKEN }}
29+
target-ros2-distro: ${{ matrix.ros_distro }}
30+
- uses: actions/upload-artifact@v1
31+
with:
32+
name: colcon-logs
33+
path: ros_ws/log

nav2_minimal_tb4_sim/launch/simulation.launch.py

Lines changed: 2 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,10 @@
2929
OpaqueFunction,
3030
RegisterEventHandler,
3131
)
32-
from launch.substitutions import Command
3332
from launch.conditions import IfCondition
3433
from launch.event_handlers import OnShutdown
3534
from launch.launch_description_sources import PythonLaunchDescriptionSource
35+
from launch.substitutions import Command
3636
from launch.substitutions import LaunchConfiguration, PythonExpression
3737

3838
from launch_ros.actions import Node
@@ -46,14 +46,12 @@ def generate_launch_description():
4646

4747
# Create the launch configuration variables
4848
namespace = LaunchConfiguration('namespace')
49-
use_namespace = LaunchConfiguration('use_namespace')
5049
use_sim_time = LaunchConfiguration('use_sim_time')
5150

5251
# Launch configuration variables specific to simulation
5352
rviz_config_file = LaunchConfiguration('rviz_config_file')
5453
use_simulator = LaunchConfiguration('use_simulator')
5554
use_robot_state_pub = LaunchConfiguration('use_robot_state_pub')
56-
use_rviz = LaunchConfiguration('use_rviz')
5755
headless = LaunchConfiguration('headless')
5856
world = LaunchConfiguration('world')
5957
pose = {
@@ -80,12 +78,6 @@ def generate_launch_description():
8078
'namespace', default_value='', description='Top-level namespace'
8179
)
8280

83-
declare_use_namespace_cmd = DeclareLaunchArgument(
84-
'use_namespace',
85-
default_value='false',
86-
description='Whether to apply a namespace to the navigation stack',
87-
)
88-
8981
declare_use_sim_time_cmd = DeclareLaunchArgument(
9082
'use_sim_time',
9183
default_value='True',
@@ -110,10 +102,6 @@ def generate_launch_description():
110102
description='Whether to start the robot state publisher',
111103
)
112104

113-
declare_use_rviz_cmd = DeclareLaunchArgument(
114-
'use_rviz', default_value='True', description='Whether to start RVIZ'
115-
)
116-
117105
declare_simulator_cmd = DeclareLaunchArgument(
118106
'headless', default_value='False', description='Whether to execute gzclient)'
119107
)
@@ -143,7 +131,7 @@ def generate_launch_description():
143131
output='screen',
144132
parameters=[
145133
{'use_sim_time': use_sim_time,
146-
'robot_description': Command(['xacro', ' ', robot_sdf])}
134+
'robot_description': Command(['xacro', ' ', robot_sdf])}
147135
],
148136
remappings=remappings,
149137
)
@@ -214,13 +202,11 @@ def generate_launch_description():
214202

215203
# Declare the launch options
216204
ld.add_action(declare_namespace_cmd)
217-
ld.add_action(declare_use_namespace_cmd)
218205
ld.add_action(declare_use_sim_time_cmd)
219206

220207
ld.add_action(declare_rviz_config_file_cmd)
221208
ld.add_action(declare_use_simulator_cmd)
222209
ld.add_action(declare_use_robot_state_pub_cmd)
223-
ld.add_action(declare_use_rviz_cmd)
224210
ld.add_action(declare_simulator_cmd)
225211
ld.add_action(declare_world_cmd)
226212
ld.add_action(declare_robot_name_cmd)

nav2_minimal_tb4_sim/launch/spawn_tb4.launch.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -15,14 +15,14 @@
1515

1616
import os
1717
from pathlib import Path
18+
1819
from ament_index_python.packages import get_package_share_directory
1920

2021
from launch import LaunchDescription
2122
from launch.actions import AppendEnvironmentVariable
2223
from launch.actions import DeclareLaunchArgument
2324
from launch.conditions import IfCondition
2425
from launch.substitutions import LaunchConfiguration
25-
from launch.substitutions import Command
2626

2727
from launch_ros.actions import Node
2828

@@ -35,7 +35,7 @@ def generate_launch_description():
3535
namespace = LaunchConfiguration('namespace')
3636
use_simulator = LaunchConfiguration('use_simulator')
3737
robot_name = LaunchConfiguration('robot_name')
38-
robot_sdf = LaunchConfiguration('robot_sdf')
38+
# robot_sdf = LaunchConfiguration('robot_sdf')
3939
pose = {'x': LaunchConfiguration('x_pose', default='-8.00'),
4040
'y': LaunchConfiguration('y_pose', default='-0.50'),
4141
'z': LaunchConfiguration('z_pose', default='0.01'),
@@ -65,10 +65,10 @@ def generate_launch_description():
6565
default_value='turtlebot4',
6666
description='name of the robot')
6767

68-
declare_robot_sdf_cmd = DeclareLaunchArgument(
69-
'robot_sdf',
70-
default_value=os.path.join(desc_dir, 'urdf', 'standard', 'turtlebot4.urdf.xacro'),
71-
description='Full path to robot sdf file to spawn the robot in gazebo')
68+
# declare_robot_sdf_cmd = DeclareLaunchArgument(
69+
# 'robot_sdf',
70+
# default_value=os.path.join(desc_dir, 'urdf', 'standard', 'turtlebot4.urdf.xacro'),
71+
# description='Full path to robot sdf file to spawn the robot in gazebo')
7272

7373
bridge = Node(
7474
package='ros_gz_bridge',
@@ -128,7 +128,7 @@ def generate_launch_description():
128128
ld = LaunchDescription()
129129
ld.add_action(declare_namespace_cmd)
130130
ld.add_action(declare_robot_name_cmd)
131-
ld.add_action(declare_robot_sdf_cmd)
131+
# ld.add_action(declare_robot_sdf_cmd)
132132
ld.add_action(declare_use_simulator_cmd)
133133
ld.add_action(declare_use_sim_time_cmd)
134134

0 commit comments

Comments
 (0)