From 0606187cee891c875a2af00df409d1539f7fe796 Mon Sep 17 00:00:00 2001 From: Chris Iverach-Brereton Date: Wed, 6 Nov 2024 11:37:21 -0500 Subject: [PATCH 1/3] Apply linting fixes --- .../clearpath_config_handler.py | 9 ++++----- .../clearpath_config_live | 18 +++++++++--------- .../clearpath_config_updater.py | 7 ++++--- .../clearpath_config_watcher.py | 5 +++-- 4 files changed, 20 insertions(+), 19 deletions(-) diff --git a/clearpath_config_live/clearpath_config_live/clearpath_config_handler.py b/clearpath_config_live/clearpath_config_live/clearpath_config_handler.py index bf557e5..6da2108 100644 --- a/clearpath_config_live/clearpath_config_live/clearpath_config_handler.py +++ b/clearpath_config_live/clearpath_config_live/clearpath_config_handler.py @@ -12,16 +12,15 @@ # See the License for the specific language governing permissions and # limitations under the License. -from rclpy.task import Future -from watchdog.events import EVENT_TYPE_MODIFIED -from watchdog.events import FileSystemEventHandler - from clearpath_config_live.clearpath_config_watcher import ( ClearpathConfigWatcher ) from clearpath_config_live.robot_description_client import ( RobotDescriptionClient ) +from rclpy.task import Future +from watchdog.events import EVENT_TYPE_MODIFIED +from watchdog.events import FileSystemEventHandler class ClearpathConfigHandler(FileSystemEventHandler): @@ -48,5 +47,5 @@ def on_modified(self, event): ) except Exception as ex: self.future = Future() - self.logger.error("Updater failed to regenerate config:") + self.logger.error('Updater failed to regenerate config:') self.logger.error(str(ex)) diff --git a/clearpath_config_live/clearpath_config_live/clearpath_config_live b/clearpath_config_live/clearpath_config_live/clearpath_config_live index c09fe0e..50a71a8 100755 --- a/clearpath_config_live/clearpath_config_live/clearpath_config_live +++ b/clearpath_config_live/clearpath_config_live/clearpath_config_live @@ -32,19 +32,19 @@ from clearpath_config_live.robot_description_client import ( def main(): # Node rclpy.init() - node = rclpy.create_node("clearpath_config_live") - node.declare_parameter("setup_path", "/etc/clearpath") - logger = rclpy.logging.get_logger("clearpath_config_live") + node = rclpy.create_node('clearpath_config_live') + node.declare_parameter('setup_path', '/etc/clearpath') + logger = rclpy.logging.get_logger('clearpath_config_live') # Get File - setup_path_param = node.get_parameter("setup_path") + setup_path_param = node.get_parameter('setup_path') setup_path = setup_path_param.get_parameter_value().string_value # Watcher, Handler, and Client client = RobotDescriptionClient( node, - "robot_state_publisher", - "robot_description" + 'robot_state_publisher', + 'robot_description' ) watcher = ClearpathConfigWatcher(setup_path, logger) handler = ClearpathConfigHandler(watcher, client, logger) @@ -53,17 +53,17 @@ def main(): try: watcher.start(handler) except Exception as ex: - logger.error("Live updater failed: \n") + logger.error('Live updater failed: \n') logger.error(ex.args) # Spin try: rclpy.spin(node) except KeyboardInterrupt: - logger.info("Live updater exited with keyboard interrupt.") + logger.info('Live updater exited with keyboard interrupt.') finally: watcher.stop() -if __name__ == "__main__": +if __name__ == '__main__': main() diff --git a/clearpath_config_live/clearpath_config_live/clearpath_config_updater.py b/clearpath_config_live/clearpath_config_live/clearpath_config_updater.py index 87e331a..c89a68d 100644 --- a/clearpath_config_live/clearpath_config_live/clearpath_config_updater.py +++ b/clearpath_config_live/clearpath_config_live/clearpath_config_updater.py @@ -13,10 +13,11 @@ # limitations under the License. import os -import xacro + from clearpath_generator_common.description.generator import ( DescriptionGenerator ) +import xacro class ClearpathConfigUpdater: @@ -34,7 +35,7 @@ def __init__( def get_robot_description(self): """Get Robot Description Parameter.""" - return self.doc.toprettyxml(indent=" ") + return self.doc.toprettyxml(indent=' ') def is_file(self, path: str) -> bool: """Check if File is the Same.""" @@ -49,5 +50,5 @@ def update(self) -> None: dg.generate() # Re-load Description self.doc = xacro.process_file( - os.path.join(self.setup_path, "robot.urdf.xacro") + os.path.join(self.setup_path, 'robot.urdf.xacro') ) diff --git a/clearpath_config_live/clearpath_config_live/clearpath_config_watcher.py b/clearpath_config_live/clearpath_config_live/clearpath_config_watcher.py index 1401da3..e5a4207 100644 --- a/clearpath_config_live/clearpath_config_live/clearpath_config_watcher.py +++ b/clearpath_config_live/clearpath_config_live/clearpath_config_watcher.py @@ -12,10 +12,11 @@ # See the License for the specific language governing permissions and # limitations under the License. +from typing import Set + from clearpath_config_live.clearpath_config_updater import ( ClearpathConfigUpdater ) -from typing import Set from watchdog.events import FileSystemEventHandler from watchdog.observers import Observer @@ -46,7 +47,7 @@ def update_watched(self, event_handler: FileSystemEventHandler) -> None: """Update Directories being Watched.""" self.observer.unschedule_all() for path in self.updater.paths: - self.logger.info("Watching directory: %s" % dir) + self.logger.info('Watching directory: %s' % dir) self.observer.schedule(event_handler, path=path, recursive=False) def update(self, event_handler: FileSystemEventHandler) -> None: From 7c1f666681d7565df07b89d318e8e08f3e41df3e Mon Sep 17 00:00:00 2001 From: Chris Iverach-Brereton Date: Wed, 6 Nov 2024 12:38:35 -0500 Subject: [PATCH 2/3] Update CI for Jazzy --- .github/workflows/ci.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f5dc3c0..3fd91c7 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -8,14 +8,14 @@ on: jobs: build_and_test: - name: humble + name: jazzy strategy: matrix: env: - - {ROS_DISTRO: humble, ROS_REPO: testing} - - {ROS_DISTRO: humble, ROS_REPO: main} + - {ROS_DISTRO: jazzy, ROS_REPO: testing} + - {ROS_DISTRO: jazzy, ROS_REPO: main} fail-fast: false - runs-on: ubuntu-22.04 + runs-on: ubuntu-24.04 steps: - uses: actions/checkout@v3 - uses: 'ros-industrial/industrial_ci@master' From c4577b4534d1fdf4e2b458a9614e680eb16d9dcc Mon Sep 17 00:00:00 2001 From: Chris Iverach-Brereton Date: Wed, 6 Nov 2024 15:32:30 -0500 Subject: [PATCH 3/3] Add source CI --- .github/workflows/ci.yml | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 3fd91c7..c2c38fa 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -20,3 +20,21 @@ jobs: - uses: actions/checkout@v3 - uses: 'ros-industrial/industrial_ci@master' env: ${{matrix.env}} + + clearpath_desktop_src_ci: + name: Jazzy Clearpath Source + runs-on: ubuntu-24.04 + steps: + - uses: actions/checkout@v3 + - uses: ros-tooling/setup-ros@v0.7 + with: + required-ros-distributions: jazzy + - uses: ros-tooling/action-ros-ci@v0.3 + id: action_ros_ci_step + with: + target-ros2-distro: jazzy + package-name: | + clearpath_config_live + clearpath_desktop + ckearpath_viz + vcs-repo-file-url: dependencies.repos