Skip to content

Commit 233af10

Browse files
Merge pull request clearpathrobotics#69 from clearpathrobotics/lcamero/continuous-integration
Continuous Integration
2 parents 014582a + f7488b4 commit 233af10

File tree

22 files changed

+328
-71
lines changed

22 files changed

+328
-71
lines changed

.github/workflows/ci.yml

Lines changed: 55 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,16 +7,67 @@ on:
77
- cron: "0 0 * * *" # every day at midnight
88

99
jobs:
10-
build_and_test:
11-
name: humble
10+
clearpath_common_osrf_industrial_ci:
11+
name: Humble OSRF Industrial
1212
strategy:
1313
matrix:
1414
env:
15-
- {ROS_DISTRO: humble, ROS_REPO: testing}
16-
- {ROS_DISTRO: humble, ROS_REPO: main}
15+
- {ROS_REPO: testing, ROS_DISTRO: humble}
16+
- {ROS_REPO: main, ROS_DISTRO: humble}
1717
fail-fast: false
1818
runs-on: ubuntu-22.04
1919
steps:
2020
- uses: actions/checkout@v3
2121
- uses: 'ros-industrial/industrial_ci@master'
2222
env: ${{matrix.env}}
23+
clearpath_common_cpr_ci:
24+
name: Humble Clearpath Release
25+
runs-on: ubuntu-22.04
26+
steps:
27+
- uses: actions/checkout@v3
28+
- uses: ros-tooling/[email protected]
29+
with:
30+
required-ros-distributions: humble
31+
- name: clearpath-package-server
32+
run: |
33+
sudo apt install wget
34+
wget https://packages.clearpathrobotics.com/public.key -O - | sudo apt-key add -
35+
sudo sh -c 'echo "deb https://packages.clearpathrobotics.com/stable/ubuntu $(lsb_release -cs) main" > /etc/apt/sources.list.d/clearpath-latest.list'
36+
sudo apt-get update
37+
- uses: ros-tooling/[email protected]
38+
id: action_ros_ci_step
39+
with:
40+
target-ros2-distro: humble
41+
package-name: |
42+
clearpath_common
43+
clearpath_control
44+
clearpath_customization
45+
clearpath_description
46+
clearpath_generator_common
47+
clearpath_mounts_description
48+
clearpath_platform
49+
clearpath_platform_description
50+
clearpath_sensors_description
51+
clearpath_common_src_ci:
52+
name: Humble Clearpath Source
53+
runs-on: ubuntu-22.04
54+
steps:
55+
- uses: actions/checkout@v3
56+
- uses: ros-tooling/[email protected]
57+
with:
58+
required-ros-distributions: humble
59+
- uses: ros-tooling/[email protected]
60+
id: action_ros_ci_step
61+
with:
62+
target-ros2-distro: humble
63+
package-name: |
64+
clearpath_common
65+
clearpath_control
66+
clearpath_customization
67+
clearpath_description
68+
clearpath_generator_common
69+
clearpath_mounts_description
70+
clearpath_platform
71+
clearpath_platform_description
72+
clearpath_sensors_description
73+
vcs-repo-file-url: dependencies.repos

clearpath_customization/project_bringup/launch/device.launch.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,13 @@
77

88
def generate_launch_description():
99
# Node Name, Package and Executable
10-
name = "device"
11-
package = "realsense2_camera"
12-
executable = "realsense2_camera_node"
10+
name = 'device'
11+
package = 'realsense2_camera'
12+
executable = 'realsense2_camera_node'
1313

1414
# Namespace from Clearpath Config
1515
namespace = ClearpathConfig('/etc/clearpath/robot.yaml').system.namespace
16-
extra_namespace = "/extras/device/"
16+
extra_namespace = '/extras/device/'
1717

1818
# Project Directory
1919
pkg_project_bringup = FindPackageShare('project_bringup')

clearpath_generator_common/CMakeLists.txt

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,21 @@ if(BUILD_TESTING)
2828
# a copyright and license is added to all source files
2929
set(ament_cmake_cpplint_FOUND TRUE)
3030
ament_lint_auto_find_test_dependencies()
31+
# pytest
32+
find_package(ament_cmake_pytest REQUIRED)
33+
set(_pytest_tests
34+
test/test_generator_bash.py
35+
test/test_generator_description.py
36+
test/test_generator_discovery_server.py
37+
)
38+
foreach(_test_path ${_pytest_tests})
39+
get_filename_component(_test_name ${_test_path} NAME_WE)
40+
ament_add_pytest_test(${_test_name} ${_test_path}
41+
APPEND_ENV PYTHONPATH=${CMAKE_CURRENT_BINARY_DIR}
42+
TIMEOUT 60
43+
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
44+
)
45+
endforeach()
3146
endif()
3247

3348
ament_package()

clearpath_generator_common/clearpath_generator_common/bash/generator.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434

3535
from clearpath_config.common.types.discovery import Discovery
3636
from clearpath_generator_common.bash.writer import BashWriter
37-
from clearpath_generator_common.common import BashFile, BaseGenerator
37+
from clearpath_generator_common.common import BaseGenerator, BashFile
3838

3939

4040
class BashGenerator(BaseGenerator):

clearpath_generator_common/clearpath_generator_common/common.py

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,21 +25,21 @@
2525
# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
2626
# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
2727
# POSSIBILITY OF SUCH DAMAGE.
28-
29-
from typing import List
30-
3128
import getopt
3229
import os
3330
import sys
3431

32+
from typing import List
33+
3534
from ament_index_python.packages import get_package_share_directory
3635

36+
from clearpath_config.clearpath_config import ClearpathConfig
3737
from clearpath_config.common.utils.dictionary import flatten_dict
3838
from clearpath_config.common.utils.yaml import read_yaml
39-
from clearpath_config.clearpath_config import ClearpathConfig
4039

4140

4241
class Package():
42+
4343
def __init__(self,
4444
name: str
4545
) -> None:
@@ -50,15 +50,17 @@ def get_name(self) -> str:
5050
return self.name
5151

5252
def find_package_share(self) -> str:
53-
return '{0} = FindPackageShare(\'{1}\')'.format(self.declaration, self.name)
53+
return "{0} = FindPackageShare('{1}')".format(self.declaration, self.name)
5454

5555

5656
class LaunchFile():
5757
class LaunchComponent():
58+
5859
def __init__(self, name: str) -> None:
5960
self.name = name
6061

6162
class Process(LaunchComponent):
63+
6264
def __init__(self,
6365
name: str,
6466
cmd: List[list] | List[str]) -> None:
@@ -67,17 +69,20 @@ def __init__(self,
6769
self.cmd = cmd
6870

6971
class LaunchArg(LaunchComponent):
72+
7073
def __init__(self, name: str, default_value: str = '', description: str = '') -> None:
7174
super().__init__(name)
7275
self.default_value = default_value
7376
self.description = description
7477
self.declaration = 'launch_arg_' + self.name
7578

7679
class Variable(LaunchComponent):
80+
7781
def __init__(self, name: str) -> None:
7882
super().__init__(name)
7983

8084
class Node(LaunchComponent):
85+
8186
def __init__(self,
8287
name: str,
8388
package: Package,
@@ -143,6 +148,7 @@ def get_full_path(self):
143148

144149

145150
class ParamFile():
151+
146152
def __init__(self,
147153
name: str,
148154
namespace: str = '',
@@ -193,6 +199,7 @@ def update(self, parameters: dict) -> None:
193199

194200

195201
class BashFile():
202+
196203
def __init__(self,
197204
filename: str,
198205
path: str,

clearpath_generator_common/clearpath_generator_common/description/attachments.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,15 +29,14 @@
2929
# Redistribution and use in source and binary forms, with or without
3030
# modification, is not permitted without the express permission
3131
# of Clearpath Robotics.
32+
from typing import List
3233

3334
from clearpath_config.platform.attachments.a200 import A200Attachment
3435
from clearpath_config.platform.attachments.config import BaseAttachment
3536
from clearpath_config.platform.attachments.j100 import J100Attachment
3637
from clearpath_config.platform.attachments.w200 import W200Attachment
3738
from clearpath_config.platform.types.bumper import Bumper
3839

39-
from typing import List
40-
4140

4241
class AttachmentsDescription():
4342
class BaseDescription():

clearpath_generator_common/clearpath_generator_common/description/generator.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,12 +36,12 @@
3636

3737
from clearpath_config.common.types.package_path import PackagePath
3838
from clearpath_generator_common.common import BaseGenerator
39-
from clearpath_generator_common.description.writer import XacroWriter
39+
from clearpath_generator_common.description.attachments import AttachmentsDescription
40+
from clearpath_generator_common.description.links import LinkDescription
4041
from clearpath_generator_common.description.mounts import MountDescription
4142
from clearpath_generator_common.description.platform import PlatformDescription
42-
from clearpath_generator_common.description.links import LinkDescription
43-
from clearpath_generator_common.description.attachments import AttachmentsDescription
4443
from clearpath_generator_common.description.sensors import SensorDescription
44+
from clearpath_generator_common.description.writer import XacroWriter
4545

4646

4747
class DescriptionGenerator(BaseGenerator):

clearpath_generator_common/clearpath_generator_common/description/links.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -31,16 +31,16 @@
3131
# of Clearpath Robotics.
3232
import os
3333

34+
from typing import List
35+
3436
from clearpath_config.common.types.file import File
3537
from clearpath_config.links.links import Link
36-
from clearpath_config.links.types.link import BaseLink
3738
from clearpath_config.links.types.box import Box
3839
from clearpath_config.links.types.cylinder import Cylinder
40+
from clearpath_config.links.types.link import BaseLink
3941
from clearpath_config.links.types.mesh import Mesh
4042
from clearpath_config.links.types.sphere import Sphere
4143

42-
from typing import List
43-
4444

4545
class LinkDescription():
4646
class BaseDescription():
@@ -104,12 +104,12 @@ def __init__(self, link: Mesh) -> None:
104104
super().__init__(link)
105105
if (link.visual.package):
106106
self.parameters.update({
107-
self.VISUAL: os.path.join("package://" + link.visual.package,
107+
self.VISUAL: os.path.join('package://' + link.visual.package,
108108
File.clean(link.visual.path, make_abs=False))
109109
})
110110
else:
111111
self.parameters.update({
112-
self.VISUAL: "file://" + File.clean(link.visual.path, make_abs=False)
112+
self.VISUAL: 'file://' + File.clean(link.visual.path, make_abs=False)
113113
})
114114

115115
MODEL = {

clearpath_generator_common/clearpath_generator_common/description/mounts.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,15 +29,14 @@
2929
# Redistribution and use in source and binary forms, with or without
3030
# modification, is not permitted without the express permission
3131
# of Clearpath Robotics.
32+
from typing import List
3233

33-
from clearpath_config.mounts.types.mount import BaseMount
3434
from clearpath_config.mounts.types.fath_pivot import FathPivot
35+
from clearpath_config.mounts.types.mount import BaseMount
3536
from clearpath_config.mounts.types.pacs import PACS
3637
from clearpath_config.mounts.types.post import Post
3738
from clearpath_config.mounts.types.sick import SICKStand
3839

39-
from typing import List
40-
4140

4241
class MountDescription():
4342
class BaseDescription():

clearpath_generator_common/clearpath_generator_common/description/platform.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,11 +29,11 @@
2929
# Redistribution and use in source and binary forms, with or without
3030
# modification, is not permitted without the express permission
3131
# of Clearpath Robotics.
32+
import os
3233

33-
from clearpath_config.common.types.platform import Platform
3434
from clearpath_config.clearpath_config import ClearpathConfig
35+
from clearpath_config.common.types.platform import Platform
3536
from clearpath_config.platform.platform import DescriptionPackagePath
36-
import os
3737

3838

3939
class PlatformDescription():
@@ -67,6 +67,7 @@ def __init__(self, config: ClearpathConfig) -> None:
6767
)
6868

6969
class GenericPlatform(BasePlatform):
70+
7071
def __init__(self, config: ClearpathConfig) -> None:
7172
description = config.platform.description
7273
package = description[DescriptionPackagePath.PACKAGE]
@@ -75,7 +76,7 @@ def __init__(self, config: ClearpathConfig) -> None:
7576
super().__init__(
7677
package=package,
7778
file=os.path.basename(path),
78-
path=os.path.dirname(path)+"/",
79+
path=os.path.dirname(path)+'/',
7980
macro=macro,
8081
parameters=None
8182
)

0 commit comments

Comments
 (0)