├── .clang-format ├── .github ├── CODEOWNERS ├── ISSUE_TEMPLATE │ ├── bug.md │ └── feature.md └── workflows │ └── ci.yml ├── .gitignore ├── LICENSE ├── README ├── clearpath_generator_robot ├── CHANGELOG.rst ├── CMakeLists.txt ├── clearpath_generator_robot │ ├── __init__.py │ ├── launch │ │ ├── __init__.py │ │ ├── generate_launch │ │ ├── generator.py │ │ └── sensors.py │ └── param │ │ ├── __init__.py │ │ ├── generate_param │ │ ├── generator.py │ │ └── sensors.py ├── package.xml └── test │ ├── test_generator_launch.py │ └── test_generator_param.py ├── clearpath_hardware_interfaces ├── CHANGELOG.rst ├── CMakeLists.txt ├── clearpath_hardware_interfaces │ ├── __init__.py │ └── battery_state │ │ ├── __init__.py │ │ ├── battery.py │ │ ├── battery_state_control │ │ └── battery_state_estimator ├── include │ └── clearpath_hardware_interfaces │ │ ├── a200 │ │ ├── hardware.hpp │ │ ├── horizon_legacy │ │ │ ├── Exception.h │ │ │ ├── Logger.h │ │ │ ├── Message.h │ │ │ ├── Message_cmd.h │ │ │ ├── Message_data.h │ │ │ ├── Message_request.h │ │ │ ├── Number.h │ │ │ ├── Transport.h │ │ │ ├── clearpath.h │ │ │ ├── crc.h │ │ │ ├── horizon_legacy_wrapper.h │ │ │ └── serial.h │ │ └── status.hpp │ │ ├── a300 │ │ ├── fan_control.hpp │ │ └── software_low_soc_cutoff.hpp │ │ ├── diff_drive │ │ ├── hardware.hpp │ │ └── hardware_interface.hpp │ │ ├── j100 │ │ ├── hardware.hpp │ │ └── hardware_interface.hpp │ │ ├── lighting │ │ ├── color.hpp │ │ ├── lighting.hpp │ │ ├── platform.hpp │ │ └── sequence.hpp │ │ ├── lynx │ │ ├── hardware.hpp │ │ └── hardware_interface.hpp │ │ ├── pinout │ │ └── pinout_control.hpp │ │ ├── puma │ │ ├── hardware.hpp │ │ └── hardware_interface.hpp │ │ ├── visibility_control.h │ │ └── w200 │ │ ├── hardware.hpp │ │ └── hardware_interface.hpp ├── package.xml └── src │ ├── a200 │ ├── hardware.cpp │ ├── hardware.xml │ ├── horizon_legacy │ │ ├── Logger.cpp │ │ ├── Message.cpp │ │ ├── Message_cmd.cpp │ │ ├── Message_data.cpp │ │ ├── Message_request.cpp │ │ ├── Number.cpp │ │ ├── Transport.cpp │ │ ├── crc.cpp │ │ ├── horizon_legacy_wrapper.cpp │ │ └── linux_serial.cpp │ └── status.cpp │ ├── a300 │ ├── fan_control.cpp │ └── software_low_soc_cutoff.cpp │ ├── diff_drive │ ├── hardware.cpp │ └── hardware_interface.cpp │ ├── j100 │ ├── hardware.cpp │ ├── hardware.xml │ └── hardware_interface.cpp │ ├── lighting │ ├── color.cpp │ ├── lighting.cpp │ ├── main.cpp │ └── sequence.cpp │ ├── lynx │ ├── hardware.cpp │ ├── hardware.xml │ └── hardware_interface.cpp │ ├── pinout │ └── pinout_control.cpp │ ├── puma │ ├── hardware.cpp │ ├── hardware.xml │ └── hardware_interface.cpp │ └── w200 │ ├── hardware.cpp │ ├── hardware.xml │ └── hardware_interface.cpp ├── clearpath_motor_drivers ├── lynx_motor_driver │ ├── CHANGELOG.rst │ ├── CMakeLists.txt │ ├── LICENSE │ ├── README.md │ ├── bin │ │ └── lynx_firmware-release-0.0.3.txt │ ├── config │ │ ├── a300.yaml │ │ └── single_test.yaml │ ├── include │ │ └── lynx_motor_driver │ │ │ ├── can_api.hpp │ │ │ ├── lynx_motor_driver.hpp │ │ │ ├── lynx_motor_node.hpp │ │ │ └── message.hpp │ ├── launch │ │ └── lynx_motor_driver.launch.py │ ├── package.xml │ └── src │ │ ├── calibrate_action.cpp │ │ ├── lynx_motor_driver.cpp │ │ ├── lynx_motor_node.cpp │ │ ├── main.cpp │ │ ├── system_protection.cpp │ │ └── update_action.cpp └── puma_motor_driver │ ├── CHANGELOG.rst │ ├── CMakeLists.txt │ ├── include │ └── puma_motor_driver │ │ ├── can_proto.hpp │ │ ├── driver.hpp │ │ └── multi_puma_node.hpp │ ├── package.xml │ └── src │ ├── driver.cpp │ └── multi_puma_node.cpp ├── clearpath_robot ├── CHANGELOG.rst ├── CMakeLists.txt ├── debian │ ├── install │ ├── postinst │ └── udev ├── install_config │ └── logind │ │ └── 70-clearpath-standard-logind.conf ├── package.xml ├── scripts │ ├── check │ ├── generate │ ├── grab-diagnostics │ ├── install │ ├── shutdown.py │ └── vcan └── services │ ├── clearpath-discovery.service │ ├── clearpath-manipulators.service │ ├── clearpath-platform-extras.service │ ├── clearpath-platform.service │ ├── clearpath-robot.service │ ├── clearpath-sensors.service │ ├── clearpath-shutdown.service │ ├── clearpath-vcan.service │ └── clearpath-zenoh-router.service ├── clearpath_sensors ├── CHANGELOG.rst ├── CMakeLists.txt ├── config │ ├── axis_camera.yaml │ ├── chrobotics_um6.yaml │ ├── fixposition.yaml │ ├── flir_blackfly.yaml │ ├── garmin_18x.yaml │ ├── hokuyo_ust.yaml │ ├── image_rectify.yaml │ ├── image_resize.yaml │ ├── imu_filter.yaml │ ├── intel_realsense.yaml │ ├── luxonis_oakd.yaml │ ├── microstrain_gq7.yaml │ ├── microstrain_imu.yaml │ ├── novatel_smart6.yaml │ ├── novatel_smart7.yaml │ ├── ouster_os1.yaml │ ├── phidgets_spatial.yaml │ ├── redshift_um7.yaml │ ├── sick_lms1xx.yaml │ ├── stereolabs_zed.yaml │ ├── swiftnav_duro.yaml │ ├── velodyne_lidar.yaml │ └── wiferion.yaml ├── debian │ └── udev ├── launch │ ├── axis_camera.launch.py │ ├── chrobotics_um6.launch.py │ ├── fixposition.launch.py │ ├── flir_blackfly.launch.py │ ├── garmin_18x.launch.py │ ├── hokuyo_ust.launch.py │ ├── image_ffmpeg_to_raw.launch.py │ ├── image_raw_to_ffmpeg.launch.py │ ├── image_rectify.launch.py │ ├── image_resize.launch.py │ ├── imu_filter.launch.py │ ├── intel_realsense.launch.py │ ├── luxonis_oakd.launch.py │ ├── microstrain_gq7.launch.py │ ├── microstrain_imu.launch.py │ ├── novatel_smart6.launch.py │ ├── novatel_smart7.launch.py │ ├── ouster_os1.launch.py │ ├── phidgets_spatial.launch.py │ ├── redshift_um7.launch.py │ ├── sick_lms1xx.launch.py │ ├── stereolabs_zed.launch.py │ ├── swiftnav_duro.launch.py │ ├── velodyne_lidar.launch.py │ └── wiferion.launch.py └── package.xml ├── clearpath_tests ├── CHANGELOG.rst ├── README.md ├── clearpath_tests │ ├── __init__.py │ ├── all_tests.py │ ├── canbus_test.py │ ├── diagnostic_test.py │ ├── drive_test.py │ ├── estop_test.py │ ├── fan_test.py │ ├── imu_test.py │ ├── light_test.py │ ├── linear_acceleration_test.py │ ├── mcu_test.py │ ├── mobility_test.py │ ├── rotation_test.py │ ├── test_node.py │ ├── tf.py │ └── wifi_test.py ├── launch │ └── production_tests.launch.py ├── package.xml ├── resource │ └── clearpath_tests ├── setup.cfg ├── setup.py └── test │ ├── test_copyright.py │ ├── test_flake8.py │ └── test_pep257.py └── dependencies.repos /.clang-format: -------------------------------------------------------------------------------- 1 | --- 2 | Language: Cpp 3 | BasedOnStyle: Google 4 | 5 | ColumnLimit: 100 6 | AccessModifierOffset: -2 7 | AlignAfterOpenBracket: AlwaysBreak 8 | BreakBeforeBraces: Allman 9 | ConstructorInitializerIndentWidth: 0 10 | ContinuationIndentWidth: 2 11 | DerivePointerAlignment: false 12 | PointerAlignment: Middle 13 | ReflowComments: false 14 | IncludeBlocks: Preserve 15 | ... 16 | -------------------------------------------------------------------------------- /.github/CODEOWNERS: -------------------------------------------------------------------------------- 1 | # Default all changes will request review from: 2 | * @clearpathrobotics/clearpath-platform-team 3 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/bug.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Bug Report 3 | about: Provide a report for that the issue is 4 | title: '' 5 | labels: bug 6 | assignees: clearpathrobotics/clearpath-platform-team 7 | 8 | --- 9 | 10 | **Please provide the following information:** 11 | - OS: (e.g. Ubuntu 24.04) 12 | - ROS 2 Distro: (e.g. Jazzy) 13 | - Built from source or installed: 14 | - Package version: (if from repository, give version from `sudo dpkg -s ros-$ROS_DISTRO-clearpath-robot`, if from source, give commit hash) 15 | - Real hardware or simulation: 16 | 17 | **Expected behaviour** 18 | A clear and concise description of what you expected to happen. 19 | 20 | **Actual behaviour** 21 | A clear and concise description of what you encountered. 22 | 23 | **To Reproduce** 24 | Provide the steps to reproduce: 25 | 1. run something 26 | 2. launch something else 27 | 3. see the error 28 | 29 | 30 | **Other notes** 31 | Add anything else you think is important. 32 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/feature.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Feature request 3 | about: Provide context for the feature you are requesting 4 | title: '' 5 | labels: enhancement 6 | assignees: clearpathrobotics/clearpath-platform-team 7 | 8 | --- 9 | 10 | **Describe the the feature you would like** 11 | A clear and concise description of what you want to happen. 12 | 13 | **Other notes** 14 | Add anything else you think is important. 15 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | __pycache__/ 2 | *.py[cod] 3 | .obj-x86_64-linux-gnu/ 4 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | BSD 3-Clause License 2 | 3 | Copyright (c) 2023, clearpathrobotics 4 | 5 | Redistribution and use in source and binary forms, with or without 6 | modification, are permitted provided that the following conditions are met: 7 | 8 | 1. Redistributions of source code must retain the above copyright notice, this 9 | list of conditions and the following disclaimer. 10 | 11 | 2. Redistributions in binary form must reproduce the above copyright notice, 12 | this list of conditions and the following disclaimer in the documentation 13 | and/or other materials provided with the distribution. 14 | 15 | 3. Neither the name of the copyright holder nor the names of its 16 | contributors may be used to endorse or promote products derived from 17 | this software without specific prior written permission. 18 | 19 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 20 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 21 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 22 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 23 | FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 24 | DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 25 | SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 26 | CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 27 | OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 28 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 | -------------------------------------------------------------------------------- /README: -------------------------------------------------------------------------------- 1 | # clearpath_robot 2 | 3 | ROS 2 packages for interfacing with Clearpath Platforms (real hardware). 4 | 5 | For supported platforms, sensors and manipulators plus additional details, please see: https://docs.clearpathrobotics.com/docs/ros/ -------------------------------------------------------------------------------- /clearpath_generator_robot/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.8) 2 | project(clearpath_generator_robot) 3 | 4 | if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang") 5 | add_compile_options(-Wall -Wextra -Wpedantic) 6 | endif() 7 | 8 | # find dependencies 9 | find_package(ament_cmake REQUIRED) 10 | find_package(ament_cmake_python REQUIRED) 11 | 12 | install(PROGRAMS 13 | ${PROJECT_NAME}/launch/generate_launch 14 | ${PROJECT_NAME}/param/generate_param 15 | DESTINATION lib/${PROJECT_NAME} 16 | ) 17 | 18 | ament_python_install_package(${PROJECT_NAME}) 19 | 20 | if(BUILD_TESTING) 21 | find_package(ament_lint_auto REQUIRED) 22 | # the following line skips the linter which checks for copyrights 23 | # comment the line when a copyright and license is added to all source files 24 | set(ament_cmake_copyright_FOUND TRUE) 25 | # the following line skips cpplint (only works in a git repo) 26 | # comment the line when this package is in a git repo and when 27 | # a copyright and license is added to all source files 28 | set(ament_cmake_cpplint_FOUND TRUE) 29 | ament_lint_auto_find_test_dependencies() 30 | # pytest 31 | find_package(ament_cmake_pytest REQUIRED) 32 | set(_pytest_tests 33 | test/test_generator_launch.py 34 | test/test_generator_param.py 35 | ) 36 | foreach(_test_path ${_pytest_tests}) 37 | get_filename_component(_test_name ${_test_path} NAME_WE) 38 | ament_add_pytest_test(${_test_name} ${_test_path} 39 | APPEND_ENV PYTHONPATH=${CMAKE_CURRENT_BINARY_DIR} 40 | TIMEOUT 60 41 | WORKING_DIRECTORY ${CMAKE_SOURCE_DIR} 42 | ) 43 | endforeach() 44 | endif() 45 | 46 | ament_package() 47 | -------------------------------------------------------------------------------- /clearpath_generator_robot/clearpath_generator_robot/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/clearpathrobotics/clearpath_robot/0ba339e643a8e1d86902dc01249bdc2132dbbc71/clearpath_generator_robot/clearpath_generator_robot/__init__.py -------------------------------------------------------------------------------- /clearpath_generator_robot/clearpath_generator_robot/launch/__init__.py: -------------------------------------------------------------------------------- 1 | # Software License Agreement (BSD) 2 | # 3 | # @author Roni Kreinin 4 | # @copyright (c) 2023, Clearpath Robotics, Inc., All rights reserved. 5 | # 6 | # Redistribution and use in source and binary forms, with or without 7 | # modification, are permitted provided that the following conditions are met: 8 | # * Redistributions of source code must retain the above copyright notice, 9 | # this list of conditions and the following disclaimer. 10 | # * Redistributions in binary form must reproduce the above copyright notice, 11 | # this list of conditions and the following disclaimer in the documentation 12 | # and/or other materials provided with the distribution. 13 | # * Neither the name of Clearpath Robotics nor the names of its contributors 14 | # may be used to endorse or promote products derived from this software 15 | # without specific prior written permission. 16 | # 17 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 18 | # AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 19 | # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 20 | # ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE 21 | # LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 22 | # CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 23 | # SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 24 | # INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 25 | # CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 26 | # ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 27 | # POSSIBILITY OF SUCH DAMAGE. 28 | 29 | # Redistribution and use in source and binary forms, with or without 30 | # modification, is not permitted without the express permission 31 | # of Clearpath Robotics. 32 | -------------------------------------------------------------------------------- /clearpath_generator_robot/clearpath_generator_robot/launch/generate_launch: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | 3 | # Software License Agreement (BSD) 4 | # 5 | # @author Roni Kreinin 6 | # @copyright (c) 2023, Clearpath Robotics, Inc., All rights reserved. 7 | # 8 | # Redistribution and use in source and binary forms, with or without 9 | # modification, are permitted provided that the following conditions are met: 10 | # * Redistributions of source code must retain the above copyright notice, 11 | # this list of conditions and the following disclaimer. 12 | # * Redistributions in binary form must reproduce the above copyright notice, 13 | # this list of conditions and the following disclaimer in the documentation 14 | # and/or other materials provided with the distribution. 15 | # * Neither the name of Clearpath Robotics nor the names of its contributors 16 | # may be used to endorse or promote products derived from this software 17 | # without specific prior written permission. 18 | # 19 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 20 | # AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 21 | # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 22 | # ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE 23 | # LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 24 | # CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 25 | # SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 26 | # INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 27 | # CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 28 | # ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 29 | # POSSIBILITY OF SUCH DAMAGE. 30 | 31 | # Redistribution and use in source and binary forms, with or without 32 | # modification, is not permitted without the express permission 33 | # of Clearpath Robotics. 34 | 35 | from clearpath_config.common.types.exception import ( 36 | UnsupportedAccessoryException, 37 | UnsupportedMiddlewareException, 38 | UnsupportedPlatformException, 39 | ) 40 | from clearpath_generator_common.common import BaseGenerator 41 | from clearpath_generator_robot.launch.generator import RobotLaunchGenerator 42 | 43 | 44 | def main(): 45 | try: 46 | setup_path = BaseGenerator.get_args() 47 | rlg = RobotLaunchGenerator(setup_path) 48 | rlg.generate() 49 | except UnsupportedAccessoryException as err: 50 | print(f'[ERROR] Unable to generate robot launch: {err}') 51 | except UnsupportedMiddlewareException as err: 52 | print(f'[ERROR] Unable to generate robot launch: {err}') 53 | except UnsupportedPlatformException as err: 54 | print(f'[ERROR] Unable to generate robot launch: {err}') 55 | 56 | 57 | if __name__ == '__main__': 58 | main() 59 | -------------------------------------------------------------------------------- /clearpath_generator_robot/clearpath_generator_robot/param/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/clearpathrobotics/clearpath_robot/0ba339e643a8e1d86902dc01249bdc2132dbbc71/clearpath_generator_robot/clearpath_generator_robot/param/__init__.py -------------------------------------------------------------------------------- /clearpath_generator_robot/clearpath_generator_robot/param/generate_param: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | 3 | # Software License Agreement (BSD) 4 | # 5 | # @author Roni Kreinin 6 | # @copyright (c) 2023, Clearpath Robotics, Inc., All rights reserved. 7 | # 8 | # Redistribution and use in source and binary forms, with or without 9 | # modification, are permitted provided that the following conditions are met: 10 | # * Redistributions of source code must retain the above copyright notice, 11 | # this list of conditions and the following disclaimer. 12 | # * Redistributions in binary form must reproduce the above copyright notice, 13 | # this list of conditions and the following disclaimer in the documentation 14 | # and/or other materials provided with the distribution. 15 | # * Neither the name of Clearpath Robotics nor the names of its contributors 16 | # may be used to endorse or promote products derived from this software 17 | # without specific prior written permission. 18 | # 19 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 20 | # AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 21 | # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 22 | # ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE 23 | # LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 24 | # CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 25 | # SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 26 | # INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 27 | # CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 28 | # ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 29 | # POSSIBILITY OF SUCH DAMAGE. 30 | 31 | # Redistribution and use in source and binary forms, with or without 32 | # modification, is not permitted without the express permission 33 | # of Clearpath Robotics. 34 | 35 | from clearpath_config.common.types.exception import ( 36 | UnsupportedAccessoryException, 37 | UnsupportedMiddlewareException, 38 | UnsupportedPlatformException, 39 | ) 40 | from clearpath_generator_common.common import BaseGenerator 41 | from clearpath_generator_robot.param.generator import RobotParamGenerator 42 | 43 | 44 | def main(): 45 | try: 46 | setup_path = BaseGenerator.get_args() 47 | rpg = RobotParamGenerator(setup_path) 48 | rpg.generate() 49 | except UnsupportedAccessoryException as err: 50 | print(f'[ERROR] Unable to generate robot parameters: {err}') 51 | except UnsupportedMiddlewareException as err: 52 | print(f'[ERROR] Unable to generate robot parameters: {err}') 53 | except UnsupportedPlatformException as err: 54 | print(f'[ERROR] Unable to generate robot parameters: {err}') 55 | 56 | 57 | if __name__ == '__main__': 58 | main() 59 | -------------------------------------------------------------------------------- /clearpath_generator_robot/clearpath_generator_robot/param/generator.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | 3 | # Software License Agreement (BSD) 4 | # 5 | # @author Roni Kreinin 6 | # @copyright (c) 2023, Clearpath Robotics, Inc., All rights reserved. 7 | # 8 | # Redistribution and use in source and binary forms, with or without 9 | # modification, are permitted provided that the following conditions are met: 10 | # * Redistributions of source code must retain the above copyright notice, 11 | # this list of conditions and the following disclaimer. 12 | # * Redistributions in binary form must reproduce the above copyright notice, 13 | # this list of conditions and the following disclaimer in the documentation 14 | # and/or other materials provided with the distribution. 15 | # * Neither the name of Clearpath Robotics nor the names of its contributors 16 | # may be used to endorse or promote products derived from this software 17 | # without specific prior written permission. 18 | # 19 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 20 | # AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 21 | # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 22 | # ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE 23 | # LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 24 | # CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 25 | # SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 26 | # INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 27 | # CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 28 | # ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 29 | # POSSIBILITY OF SUCH DAMAGE. 30 | 31 | # Redistribution and use in source and binary forms, with or without 32 | # modification, is not permitted without the express permission 33 | # of Clearpath Robotics. 34 | 35 | from clearpath_generator_common.common import Package 36 | from clearpath_generator_common.param.generator import ParamGenerator 37 | from clearpath_generator_robot.param.sensors import SensorParam 38 | 39 | 40 | class RobotParamGenerator(ParamGenerator): 41 | 42 | def __init__(self, setup_path: str = '/etc/clearpath') -> None: 43 | super().__init__(setup_path=setup_path) 44 | 45 | # Additional packages specific to physical robots 46 | self.pkg_clearpath_sensors = Package('clearpath_sensors') 47 | self.pkg_clearpath_hardware_interfaces = Package('clearpath_hardware_interfaces') 48 | 49 | def generate_sensors(self) -> None: 50 | sensors = self.clearpath_config.sensors.get_all_sensors() 51 | for sensor in sensors: 52 | if sensor.get_launch_enabled(): 53 | sensor_param = SensorParam(sensor, self.namespace, self.sensors_params_path) 54 | sensor_param.generate_config() 55 | -------------------------------------------------------------------------------- /clearpath_generator_robot/package.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | clearpath_generator_robot 5 | 2.5.0 6 | Clearpath Robot Generator 7 | Roni Kreinin 8 | BSD 9 | Roni Kreinin 10 | 11 | ament_cmake 12 | 13 | clearpath_config 14 | clearpath_diagnostics 15 | clearpath_generator_common 16 | clearpath_hardware_interfaces 17 | clearpath_motor_msgs 18 | clearpath_sensors 19 | 20 | imu_filter_madgwick 21 | canopen_inventus_bringup 22 | micro_ros_agent 23 | python3-apt 24 | 25 | 26 | wireless_msgs 27 | wireless_watcher 28 | 29 | ament_lint_auto 30 | ament_lint_common 31 | ament_cmake_pytest 32 | 33 | 34 | ament_cmake 35 | 36 | 37 | -------------------------------------------------------------------------------- /clearpath_generator_robot/test/test_generator_launch.py: -------------------------------------------------------------------------------- 1 | # Software License Agreement (BSD) 2 | # 3 | # @author Luis Camero 4 | # @copyright (c) 2024, Clearpath Robotics, Inc., All rights reserved. 5 | # 6 | # Redistribution and use in source and binary forms, with or without 7 | # modification, are permitted provided that the following conditions are met: 8 | # * Redistributions of source code must retain the above copyright notice, 9 | # this list of conditions and the following disclaimer. 10 | # * Redistributions in binary form must reproduce the above copyright notice, 11 | # this list of conditions and the following disclaimer in the documentation 12 | # and/or other materials provided with the distribution. 13 | # * Neither the name of Clearpath Robotics nor the names of its contributors 14 | # may be used to endorse or promote products derived from this software 15 | # without specific prior written permission. 16 | # 17 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 18 | # AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 19 | # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 20 | # ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE 21 | # LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 22 | # CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 23 | # SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 24 | # INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 25 | # CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 26 | # ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 27 | # POSSIBILITY OF SUCH DAMAGE. 28 | import os 29 | import shutil 30 | 31 | from ament_index_python.packages import get_package_share_directory 32 | from clearpath_config.common.types.exception import ( 33 | UnsupportedAccessoryException, 34 | UnsupportedPlatformException, 35 | ) 36 | from clearpath_generator_robot.launch.generator import RobotLaunchGenerator 37 | 38 | 39 | class TestRobotLaunchGenerator: 40 | 41 | def test_samples(self): 42 | errors = [] 43 | share_dir = get_package_share_directory('clearpath_config') 44 | sample_dir = os.path.join(share_dir, 'sample') 45 | for sample in os.listdir(sample_dir): 46 | # Create Clearpath Directory 47 | src = os.path.join(sample_dir, sample) 48 | dst = os.path.join(os.environ['HOME'], '.clearpath', 'robot.yaml') 49 | shutil.rmtree(os.path.dirname(dst), ignore_errors=True) 50 | os.makedirs(os.path.dirname(dst), exist_ok=True) 51 | shutil.copy(src, dst) 52 | # Generate 53 | try: 54 | rlg = RobotLaunchGenerator(os.path.dirname(dst)) 55 | rlg.generate() 56 | except UnsupportedAccessoryException as e: 57 | print(f'Unsupported accessory: {e}') 58 | except UnsupportedPlatformException as e: 59 | print(f'Unsupported platform: {e}') 60 | except Exception as e: 61 | errors.append("Sample '%s' failed to load: '%s'" % ( 62 | sample, 63 | e.args[0], 64 | )) 65 | assert not errors, 'Errors: %s' % '\n'.join(errors) 66 | -------------------------------------------------------------------------------- /clearpath_generator_robot/test/test_generator_param.py: -------------------------------------------------------------------------------- 1 | # Software License Agreement (BSD) 2 | # 3 | # @author Luis Camero 4 | # @copyright (c) 2024, Clearpath Robotics, Inc., All rights reserved. 5 | # 6 | # Redistribution and use in source and binary forms, with or without 7 | # modification, are permitted provided that the following conditions are met: 8 | # * Redistributions of source code must retain the above copyright notice, 9 | # this list of conditions and the following disclaimer. 10 | # * Redistributions in binary form must reproduce the above copyright notice, 11 | # this list of conditions and the following disclaimer in the documentation 12 | # and/or other materials provided with the distribution. 13 | # * Neither the name of Clearpath Robotics nor the names of its contributors 14 | # may be used to endorse or promote products derived from this software 15 | # without specific prior written permission. 16 | # 17 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 18 | # AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 19 | # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 20 | # ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE 21 | # LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 22 | # CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 23 | # SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 24 | # INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 25 | # CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 26 | # ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 27 | # POSSIBILITY OF SUCH DAMAGE. 28 | import os 29 | import shutil 30 | 31 | from ament_index_python.packages import get_package_share_directory 32 | from clearpath_config.common.types.exception import ( 33 | UnsupportedAccessoryException, 34 | UnsupportedPlatformException, 35 | ) 36 | from clearpath_generator_common.ros import ROS_DISTRO 37 | from clearpath_generator_robot.param.generator import RobotParamGenerator 38 | 39 | 40 | SAMPLE_DIR = f'/opt/ros/{ROS_DISTRO}/share/clearpath_config/sample/' 41 | 42 | 43 | class TestRobotLaunchGenerator: 44 | 45 | def test_samples(self): 46 | errors = [] 47 | share_dir = get_package_share_directory('clearpath_config') 48 | sample_dir = os.path.join(share_dir, 'sample') 49 | for sample in os.listdir(sample_dir): 50 | # Create Clearpath Directory 51 | src = os.path.join(sample_dir, sample) 52 | dst = os.path.join(os.environ['HOME'], '.clearpath', 'robot.yaml') 53 | shutil.rmtree(os.path.dirname(dst), ignore_errors=True) 54 | os.makedirs(os.path.dirname(dst), exist_ok=True) 55 | shutil.copy(src, dst) 56 | # Generate 57 | try: 58 | rpg = RobotParamGenerator(os.path.dirname(dst)) 59 | rpg.generate() 60 | except UnsupportedAccessoryException as e: 61 | print(f'Unsupported accessory: {e}') 62 | except UnsupportedPlatformException as e: 63 | print(f'Unsupported platform: {e}') 64 | except Exception as e: 65 | errors.append("Sample '%s' failed to load: '%s'" % ( 66 | sample, 67 | e.args[0], 68 | )) 69 | assert not errors, 'Errors: %s' % '\n'.join(errors) 70 | -------------------------------------------------------------------------------- /clearpath_hardware_interfaces/clearpath_hardware_interfaces/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/clearpathrobotics/clearpath_robot/0ba339e643a8e1d86902dc01249bdc2132dbbc71/clearpath_hardware_interfaces/clearpath_hardware_interfaces/__init__.py -------------------------------------------------------------------------------- /clearpath_hardware_interfaces/clearpath_hardware_interfaces/battery_state/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/clearpathrobotics/clearpath_robot/0ba339e643a8e1d86902dc01249bdc2132dbbc71/clearpath_hardware_interfaces/clearpath_hardware_interfaces/battery_state/__init__.py -------------------------------------------------------------------------------- /clearpath_hardware_interfaces/include/clearpath_hardware_interfaces/a200/hardware.hpp: -------------------------------------------------------------------------------- 1 | #ifndef CLEARPATH_HARDWARE_INTERFACES__A200_HARDWARE_HPP_ 2 | #define CLEARPATH_HARDWARE_INTERFACES__A200_HARDWARE_HPP_ 3 | 4 | #include 5 | #include 6 | #include 7 | #include 8 | 9 | #include "hardware_interface/handle.hpp" 10 | #include "hardware_interface/hardware_info.hpp" 11 | #include "hardware_interface/system_interface.hpp" 12 | #include "hardware_interface/types/hardware_interface_return_values.hpp" 13 | #include "rclcpp/macros.hpp" 14 | 15 | #include "rclcpp/rclcpp.hpp" 16 | 17 | #include "std_msgs/msg/bool.hpp" 18 | #include "std_msgs/msg/float32.hpp" 19 | 20 | #include "clearpath_hardware_interfaces/a200/horizon_legacy/horizon_legacy_wrapper.h" 21 | #include "clearpath_hardware_interfaces/a200/status.hpp" 22 | #include "clearpath_hardware_interfaces/visibility_control.h" 23 | 24 | #include "clearpath_platform_msgs/msg/power.hpp" 25 | #include "clearpath_platform_msgs/msg/status.hpp" 26 | #include "clearpath_platform_msgs/msg/stop_status.hpp" 27 | 28 | using namespace std::chrono_literals; 29 | 30 | namespace clearpath_hardware_interfaces 31 | { 32 | 33 | class A200Hardware : public hardware_interface::SystemInterface 34 | { 35 | public: 36 | RCLCPP_SHARED_PTR_DEFINITIONS(A200Hardware) 37 | 38 | HARDWARE_INTERFACE_PUBLIC 39 | hardware_interface::CallbackReturn on_init(const hardware_interface::HardwareInfo & info) override; 40 | 41 | HARDWARE_INTERFACE_PUBLIC 42 | std::vector export_state_interfaces() override; 43 | 44 | HARDWARE_INTERFACE_PUBLIC 45 | std::vector export_command_interfaces() override; 46 | 47 | HARDWARE_INTERFACE_PUBLIC 48 | hardware_interface::CallbackReturn on_activate(const rclcpp_lifecycle::State & previous_state) override; 49 | 50 | HARDWARE_INTERFACE_PUBLIC 51 | hardware_interface::CallbackReturn on_deactivate(const rclcpp_lifecycle::State & previous_state) override; 52 | 53 | HARDWARE_INTERFACE_PUBLIC 54 | hardware_interface::return_type read(const rclcpp::Time & time, const rclcpp::Duration & period) override; 55 | 56 | HARDWARE_INTERFACE_PUBLIC 57 | hardware_interface::return_type write(const rclcpp::Time & time, const rclcpp::Duration & period) override; 58 | 59 | private: 60 | void resetTravelOffset(); 61 | double linearToAngular(const double &travel) const; 62 | double angularToLinear(const double &angle) const; 63 | void writeCommandsToHardware(); 64 | void limitDifferentialSpeed(double &diff_speed_left, double &diff_speed_right); 65 | void updateJointsFromHardware(); 66 | void readStatusFromHardware(); 67 | uint8_t isLeft(const std::string &str); 68 | 69 | // ROS Parameters 70 | std::string serial_port_; 71 | double polling_timeout_; 72 | double wheel_diameter_, max_accel_, max_speed_; 73 | 74 | // Store the command for the robot 75 | std::vector hw_commands_; 76 | std::vector hw_states_position_, hw_states_position_offset_, hw_states_velocity_; 77 | 78 | uint8_t left_cmd_joint_index_, right_cmd_joint_index_; 79 | 80 | std::shared_ptr status_node_; 81 | clearpath_platform_msgs::msg::Power power_msg_; 82 | clearpath_platform_msgs::msg::Status status_msg_; 83 | clearpath_platform_msgs::msg::StopStatus stop_status_msg_; 84 | std_msgs::msg::Bool stop_msg_; 85 | std_msgs::msg::Float32 driver_left_temp_msg_, driver_right_temp_msg_; 86 | std_msgs::msg::Float32 motor_left_temp_msg_, motor_right_temp_msg_; 87 | }; 88 | 89 | } // namespace clearpath_hardware_interfaces 90 | 91 | #endif // CLEARPATH_HARDWARE_INTERFACES__A200_HARDWARE_HPP_ 92 | -------------------------------------------------------------------------------- /clearpath_hardware_interfaces/include/clearpath_hardware_interfaces/a200/horizon_legacy/Exception.h: -------------------------------------------------------------------------------- 1 | /** 2 | * _____ 3 | * / _ \ 4 | * / _/ \ \ 5 | * / / \_/ \ 6 | * / \_/ _ \ ___ _ ___ ___ ____ ____ ___ _____ _ _ 7 | * \ / \_/ \ / / _\| | | __| / _ \ | ++ \ | ++ \ / _ \ |_ _|| | | | 8 | * \ \_/ \_/ / | | | | | ++ | |_| || ++ / | ++_/| |_| | | | | +-+ | 9 | * \ \_/ / | |_ | |_ | ++ | _ || |\ \ | | | _ | | | | +-+ | 10 | * \_____/ \___/|___||___||_| |_||_| \_\|_| |_| |_| |_| |_| |_| 11 | * ROBOTICS™ 12 | * 13 | * File: Exception.h 14 | * Desc: Provides the clearpath::Exception class, which is the parent class 15 | * for all clearpath exceptions. 16 | * Auth: Iain Peet 17 | * 18 | * Copyright (c) 2010, Clearpath Robotics, Inc. 19 | * All Rights Reserved 20 | * 21 | * Redistribution and use in source and binary forms, with or without 22 | * modification, are permitted provided that the following conditions are met: 23 | * * Redistributions of source code must retain the above copyright 24 | * notice, this list of conditions and the following disclaimer. 25 | * * Redistributions in binary form must reproduce the above copyright 26 | * notice, this list of conditions and the following disclaimer in the 27 | * documentation and/or other materials provided with the distribution. 28 | * * Neither the name of Clearpath Robotics, Inc. nor the 29 | * names of its contributors may be used to endorse or promote products 30 | * derived from this software without specific prior written permission. 31 | * 32 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 33 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 34 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 35 | * DISCLAIMED. IN NO EVENT SHALL CLEARPATH ROBOTICS, INC. BE LIABLE FOR ANY 36 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 37 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 38 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 39 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 40 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 41 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 42 | * 43 | * Please send comments, questions, or patches to skynet@clearpathrobotics.com 44 | * 45 | */ 46 | 47 | #ifndef CPR_EXCEPTION_H 48 | #define CPR_EXCEPTION_H 49 | 50 | #include 51 | 52 | namespace clearpath 53 | { 54 | 55 | class Exception 56 | { 57 | public: 58 | const char *message; 59 | 60 | protected: 61 | Exception(const char *msg = "none") : message(msg) 62 | { 63 | } 64 | }; 65 | 66 | } // namespace clearpath 67 | 68 | #endif // CPR_EXCEPTION_H 69 | -------------------------------------------------------------------------------- /clearpath_hardware_interfaces/include/clearpath_hardware_interfaces/a200/horizon_legacy/Message_request.h: -------------------------------------------------------------------------------- 1 | /** 2 | * _____ 3 | * / _ \ 4 | * / _/ \ \ 5 | * / / \_/ \ 6 | * / \_/ _ \ ___ _ ___ ___ ____ ____ ___ _____ _ _ 7 | * \ / \_/ \ / / _\| | | __| / _ \ | ++ \ | ++ \ / _ \ |_ _|| | | | 8 | * \ \_/ \_/ / | | | | | ++ | |_| || ++ / | ++_/| |_| | | | | +-+ | 9 | * \ \_/ / | |_ | |_ | ++ | _ || |\ \ | | | _ | | | | +-+ | 10 | * \_____/ \___/|___||___||_| |_||_| \_\|_| |_| |_| |_| |_| |_| 11 | * ROBOTICS™ 12 | * 13 | * File: Message_request.h 14 | * Desc: Provides the Request class, which is used to request data messages 15 | * at a particular frequency. 16 | * Auth: Iain Peet 17 | * 18 | * Copyright (c) 2010, Clearpath Robotics, Inc. 19 | * All Rights Reserved 20 | * 21 | * Redistribution and use in source and binary forms, with or without 22 | * modification, are permitted provided that the following conditions are met: 23 | * * Redistributions of source code must retain the above copyright 24 | * notice, this list of conditions and the following disclaimer. 25 | * * Redistributions in binary form must reproduce the above copyright 26 | * notice, this list of conditions and the following disclaimer in the 27 | * documentation and/or other materials provided with the distribution. 28 | * * Neither the name of Clearpath Robotics, Inc. nor the 29 | * names of its contributors may be used to endorse or promote products 30 | * derived from this software without specific prior written permission. 31 | * 32 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 33 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 34 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 35 | * DISCLAIMED. IN NO EVENT SHALL CLEARPATH ROBOTICS, INC. BE LIABLE FOR ANY 36 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 37 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 38 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 39 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 40 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 41 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 42 | * 43 | * Please send comments, questions, or patches to skynet@clearpathrobotics.com 44 | * 45 | */ 46 | 47 | #ifndef CLEARPATH_MESSAGE_REQUEST_H 48 | #define CLEARPATH_MESSAGE_REQUEST_H 49 | 50 | #include "clearpath_hardware_interfaces/a200/horizon_legacy/Message.h" 51 | 52 | namespace clearpath 53 | { 54 | 55 | class Request : public Message 56 | { 57 | public: 58 | Request(uint16_t type, uint16_t freq = 0); 59 | 60 | Request(const Request &other); 61 | }; 62 | 63 | } // namespace clearpath 64 | 65 | #endif // CLEARPATH_MESSAGE_REQUEST_H 66 | -------------------------------------------------------------------------------- /clearpath_hardware_interfaces/include/clearpath_hardware_interfaces/a200/horizon_legacy/Number.h: -------------------------------------------------------------------------------- 1 | /** 2 | * _____ 3 | * / _ \ 4 | * / _/ \ \ 5 | * / / \_/ \ 6 | * / \_/ _ \ ___ _ ___ ___ ____ ____ ___ _____ _ _ 7 | * \ / \_/ \ / / _\| | | __| / _ \ | ++ \ | ++ \ / _ \ |_ _|| | | | 8 | * \ \_/ \_/ / | | | | | ++ | |_| || ++ / | ++_/| |_| | | | | +-+ | 9 | * \ \_/ / | |_ | |_ | ++ | _ || |\ \ | | | _ | | | | +-+ | 10 | * \_____/ \___/|___||___||_| |_||_| \_\|_| |_| |_| |_| |_| |_| 11 | * ROBOTICS™ 12 | * 13 | * File: Number.h 14 | * Desc: Provides a family of functions similar in form to stdlib atoi and 15 | * friends, for conversion between numeric primitives and small-endian 16 | * byte arrays. 17 | * Auth: Iain Peet 18 | * 19 | * Copyright (c) 2010, Clearpath Robotics, Inc. 20 | * All Rights Reserved 21 | * 22 | * Redistribution and use in source and binary forms, with or without 23 | * modification, are permitted provided that the following conditions are met: 24 | * * Redistributions of source code must retain the above copyright 25 | * notice, this list of conditions and the following disclaimer. 26 | * * Redistributions in binary form must reproduce the above copyright 27 | * notice, this list of conditions and the following disclaimer in the 28 | * documentation and/or other materials provided with the distribution. 29 | * * Neither the name of Clearpath Robotics, Inc. nor the 30 | * names of its contributors may be used to endorse or promote products 31 | * derived from this software without specific prior written permission. 32 | * 33 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 34 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 35 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 36 | * DISCLAIMED. IN NO EVENT SHALL CLEARPATH ROBOTICS, INC. BE LIABLE FOR ANY 37 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 38 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 39 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 40 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 41 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 42 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 43 | * 44 | * Please send comments, questions, or patches to skynet@clearpathrobotics.com 45 | * 46 | */ 47 | 48 | #ifndef NUMBER_H_ 49 | #define NUMBER_H_ 50 | 51 | #include 52 | #include 53 | #include 54 | 55 | namespace clearpath 56 | { 57 | 58 | /* Little-endian byte array to number conversion routines. */ 59 | void utob(void *dest, size_t dest_len, uint64_t src); 60 | 61 | void utob(void *dest, size_t dest_len, uint32_t src); 62 | 63 | void utob(void *dest, size_t dest_len, uint16_t src); 64 | 65 | void itob(void *dest, size_t dest_len, int64_t src); 66 | 67 | void itob(void *dest, size_t dest_len, int32_t src); 68 | 69 | void itob(void *dest, size_t dest_len, int16_t src); 70 | 71 | /* void toBytes(void* dest, size_t dest_len, float src, float scale); */ 72 | void ftob(void *dest, size_t dest_len, double src, double scale); 73 | 74 | /* Number to little-endian byte array conversion routines 75 | * Need to provide all, since size of the int param matters. */ 76 | uint64_t btou(void *src, size_t src_len); 77 | 78 | int64_t btoi(void *src, size_t src_len); 79 | 80 | double btof(void *src, size_t src_len, double scale); 81 | 82 | } // namespace clearpath 83 | 84 | #endif // NUMBER_H_ 85 | -------------------------------------------------------------------------------- /clearpath_hardware_interfaces/include/clearpath_hardware_interfaces/a200/horizon_legacy/clearpath.h: -------------------------------------------------------------------------------- 1 | /** 2 | * _____ 3 | * / _ \ 4 | * / _/ \ \ 5 | * / / \_/ \ 6 | * / \_/ _ \ ___ _ ___ ___ ____ ____ ___ _____ _ _ 7 | * \ / \_/ \ / / _\| | | __| / _ \ | ++ \ | ++ \ / _ \ |_ _|| | | | 8 | * \ \_/ \_/ / | | | | | ++ | |_| || ++ / | ++_/| |_| | | | | +-+ | 9 | * \ \_/ / | |_ | |_ | ++ | _ || |\ \ | | | _ | | | | +-+ | 10 | * \_____/ \___/|___||___||_| |_||_| \_\|_| |_| |_| |_| |_| |_| 11 | * ROBOTICS� 12 | * 13 | * File: clearpath.h 14 | * Desc: Includes all CCP headers 15 | * Auth: R. Gariepy, Iain Peet 16 | * 17 | * Copyright (c) 2010, Clearpath Robotics, Inc. 18 | * All Rights Reserved 19 | * 20 | * Redistribution and use in source and binary forms, with or without 21 | * modification, are permitted provided that the following conditions are met: 22 | * * Redistributions of source code must retain the above copyright 23 | * notice, this list of conditions and the following disclaimer. 24 | * * Redistributions in binary form must reproduce the above copyright 25 | * notice, this list of conditions and the following disclaimer in the 26 | * documentation and/or other materials provided with the distribution. 27 | * * Neither the name of Clearpath Robotics, Inc. nor the 28 | * names of its contributors may be used to endorse or promote products 29 | * derived from this software without specific prior written permission. 30 | * 31 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 32 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 33 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 34 | * DISCLAIMED. IN NO EVENT SHALL CLEARPATH ROBOTICS, INC. BE LIABLE FOR ANY 35 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 36 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 37 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 38 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 39 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 40 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 41 | * 42 | * Please send comments, questions, or patches to skynet@clearpathrobotics.com 43 | * 44 | */ 45 | 46 | #ifndef CLEARPATH_H 47 | #define CLEARPATH_H 48 | 49 | #include "clearpath_hardware_interfaces/a200/horizon_legacy/Message.h" 50 | #include "clearpath_hardware_interfaces/a200/horizon_legacy/Message_cmd.h" 51 | #include "clearpath_hardware_interfaces/a200/horizon_legacy/Message_request.h" 52 | #include "clearpath_hardware_interfaces/a200/horizon_legacy/Message_data.h" 53 | #include "clearpath_hardware_interfaces/a200/horizon_legacy/Transport.h" 54 | 55 | #endif // CLEARPATH_H 56 | -------------------------------------------------------------------------------- /clearpath_hardware_interfaces/include/clearpath_hardware_interfaces/a200/horizon_legacy/crc.h: -------------------------------------------------------------------------------- 1 | /** 2 | * _____ 3 | * / _ \ 4 | * / _/ \ \ 5 | * / / \_/ \ 6 | * / \_/ _ \ ___ _ ___ ___ ____ ____ ___ _____ _ _ 7 | * \ / \_/ \ / / _\| | | __| / _ \ | ++ \ | ++ \ / _ \ |_ _|| | | | 8 | * \ \_/ \_/ / | | | | | ++ | |_| || ++ / | ++_/| |_| | | | | +-+ | 9 | * \ \_/ / | |_ | |_ | ++ | _ || |\ \ | | | _ | | | | +-+ | 10 | * \_____/ \___/|___||___||_| |_||_| \_\|_| |_| |_| |_| |_| |_| 11 | * ROBOTICS� 12 | * 13 | * File: crc.h 14 | * Desc: Definitions of a 16 bit CRC. Uses a table-based implementation. 15 | * When INIT_VAL=0xFFFF, this is identical to that used on the 16 | * various uCs which implement Horizon 17 | * Auth: R. Gariepy 18 | * 19 | * Copyright (c) 2010, Clearpath Robotics, Inc. 20 | * All Rights Reserved 21 | * 22 | * Redistribution and use in source and binary forms, with or without 23 | * modification, are permitted provided that the following conditions are met: 24 | * * Redistributions of source code must retain the above copyright 25 | * notice, this list of conditions and the following disclaimer. 26 | * * Redistributions in binary form must reproduce the above copyright 27 | * notice, this list of conditions and the following disclaimer in the 28 | * documentation and/or other materials provided with the distribution. 29 | * * Neither the name of Clearpath Robotics, Inc. nor the 30 | * names of its contributors may be used to endorse or promote products 31 | * derived from this software without specific prior written permission. 32 | * 33 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 34 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 35 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 36 | * DISCLAIMED. IN NO EVENT SHALL CLEARPATH ROBOTICS, INC. BE LIABLE FOR ANY 37 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 38 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 39 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 40 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 41 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 42 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 43 | * 44 | * Please send comments, questions, or patches to skynet@clearpathrobotics.com 45 | * 46 | */ 47 | 48 | #ifndef __CRC16_H 49 | #define __CRC16_H 50 | 51 | #include 52 | 53 | /***----------Table-driven crc function----------***/ 54 | /*Inputs: -size of the character array, the CRC of which is being computed */ 55 | /* - the initial value of the register to be used in the calculation */ 56 | /* - a pointer to the first element of said character array */ 57 | /*Outputs: the crc as an unsigned short int */ 58 | uint16_t crc16(int size, int init_val, uint8_t *data); 59 | 60 | #endif 61 | -------------------------------------------------------------------------------- /clearpath_hardware_interfaces/include/clearpath_hardware_interfaces/a200/horizon_legacy/serial.h: -------------------------------------------------------------------------------- 1 | /** 2 | * _____ 3 | * / _ \ 4 | * / _/ \ \ 5 | * / / \_/ \ 6 | * / \_/ _ \ ___ _ ___ ___ ____ ____ ___ _____ _ _ 7 | * \ / \_/ \ / / _\| | | __| / _ \ | ++ \ | ++ \ / _ \ |_ _|| | | | 8 | * \ \_/ \_/ / | | | | | ++ | |_| || ++ / | ++_/| |_| | | | | +-+ | 9 | * \ \_/ / | |_ | |_ | ++ | _ || |\ \ | | | _ | | | | +-+ | 10 | * \_____/ \___/|___||___||_| |_||_| \_\|_| |_| |_| |_| |_| |_| 11 | * ROBOTICS� 12 | * 13 | * File: HorizonProtocol.cpp 14 | * Desc: Generic serial communication functions. Pass in void pointers, let the 15 | * platform-specific implementation do the work. Usually, this should be 16 | * included by (and linked against) windows_serial.cpp or linux_serial.cpp 17 | * Auth: R. Gariepy 18 | * 19 | * Copyright (c) 2010, Clearpath Robotics, Inc. 20 | * All Rights Reserved 21 | * 22 | * Redistribution and use in source and binary forms, with or without 23 | * modification, are permitted provided that the following conditions are met: 24 | * * Redistributions of source code must retain the above copyright 25 | * notice, this list of conditions and the following disclaimer. 26 | * * Redistributions in binary form must reproduce the above copyright 27 | * notice, this list of conditions and the following disclaimer in the 28 | * documentation and/or other materials provided with the distribution. 29 | * * Neither the name of Clearpath Robotics, Inc. nor the 30 | * names of its contributors may be used to endorse or promote products 31 | * derived from this software without specific prior written permission. 32 | * 33 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 34 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 35 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 36 | * DISCLAIMED. IN NO EVENT SHALL CLEARPATH ROBOTICS, INC. BE LIABLE FOR ANY 37 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 38 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 39 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 40 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 41 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 42 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 43 | * 44 | * Please send comments, questions, or patches to skynet@clearpathrobotics.com 45 | * 46 | */ 47 | 48 | #ifndef SERIAL_H_ 49 | #define SERIAL_H_ 50 | 51 | int OpenSerial(void **handle, const char *port_name); 52 | 53 | int SetupSerial(void *handle); 54 | 55 | int WriteData(void *handle, const char *buffer, int length); 56 | 57 | int ReadData(void *handle, char *buffer, int length); 58 | 59 | int CloseSerial(void *handle); 60 | 61 | #endif /* SERIAL_H_ */ 62 | -------------------------------------------------------------------------------- /clearpath_hardware_interfaces/include/clearpath_hardware_interfaces/a200/status.hpp: -------------------------------------------------------------------------------- 1 | /** 2 | Software License Agreement (BSD) 3 | \file status.hpp 4 | \authors Tony Baltovski 5 | \copyright Copyright (c) 2023, Clearpath Robotics, Inc., All rights reserved. 6 | Redistribution and use in source and binary forms, with or without modification, are permitted provided that 7 | the following conditions are met: 8 | * Redistributions of source code must retain the above copyright notice, this list of conditions and the 9 | following disclaimer. 10 | * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the 11 | following disclaimer in the documentation and/or other materials provided with the distribution. 12 | * Neither the name of Clearpath Robotics nor the names of its contributors may be used to endorse or promote 13 | products derived from this software without specific prior written permission. 14 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WAR- 15 | RANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 16 | PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, IN- 17 | DIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT 18 | OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 19 | ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 20 | ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 21 | */ 22 | 23 | #ifndef CLEARPATH_HARDWARE_INTERFACES__A200_STATUS_HPP 24 | #define CLEARPATH_HARDWARE_INTERFACES__A200_STATUS_HPP 25 | 26 | #include "rclcpp/rclcpp.hpp" 27 | 28 | #include "std_msgs/msg/bool.hpp" 29 | #include "std_msgs/msg/float32.hpp" 30 | 31 | #include "clearpath_platform_msgs/msg/power.hpp" 32 | #include "clearpath_platform_msgs/msg/status.hpp" 33 | #include "clearpath_platform_msgs/msg/stop_status.hpp" 34 | 35 | namespace a200_status 36 | { 37 | 38 | class A200Status 39 | : public rclcpp::Node 40 | { 41 | public: 42 | explicit A200Status(); 43 | 44 | void publish_power(const clearpath_platform_msgs::msg::Power & power_msg); 45 | void publish_status(const clearpath_platform_msgs::msg::Status & status_msg); 46 | void publish_stop_status(const clearpath_platform_msgs::msg::StopStatus & stop_status_msg); 47 | void publish_stop_state(const std_msgs::msg::Bool & stop_msg); 48 | void publish_temps(const std_msgs::msg::Float32 & driver_left_msg, 49 | const std_msgs::msg::Float32 & driver_right_msg, 50 | const std_msgs::msg::Float32 & motor_left_msg, 51 | const std_msgs::msg::Float32 & motor_right_msg); 52 | 53 | private: 54 | rclcpp::Publisher::SharedPtr pub_power_; 55 | rclcpp::Publisher::SharedPtr pub_status_; 56 | rclcpp::Publisher::SharedPtr pub_stop_status_; 57 | rclcpp::Publisher::SharedPtr pub_stop_state_; 58 | rclcpp::Publisher::SharedPtr pub_driver_left_temp_; 59 | rclcpp::Publisher::SharedPtr pub_driver_right_temp_; 60 | rclcpp::Publisher::SharedPtr pub_motor_left_temp_; 61 | rclcpp::Publisher::SharedPtr pub_motor_right_temp_; 62 | }; 63 | 64 | } 65 | 66 | #endif // CLEARPATH_HARDWARE_INTERFACES__A200_STATUS_HPP 67 | -------------------------------------------------------------------------------- /clearpath_hardware_interfaces/include/clearpath_hardware_interfaces/diff_drive/hardware_interface.hpp: -------------------------------------------------------------------------------- 1 | /** 2 | * \file 3 | * \brief Base DiffDrive hardware interface class 4 | * \author Roni Kreinin 5 | * \author Tony Baltovski 6 | * \copyright Copyright (c) 2023, Clearpath Robotics, Inc. 7 | * 8 | * Redistribution and use in source and binary forms, with or without 9 | * modification, are permitted provided that the following conditions are met: 10 | * * Redistributions of source code must retain the above copyright 11 | * notice, this list of conditions and the following disclaimer. 12 | * * Redistributions in binary form must reproduce the above copyright 13 | * notice, this list of conditions and the following disclaimer in the 14 | * documentation and/or other materials provided with the distribution. 15 | * * Neither the name of Clearpath Robotics, Inc. nor the 16 | * names of its contributors may be used to endorse or promote products 17 | * derived from this software without specific prior written permission. 18 | * 19 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 20 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 21 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 22 | * DISCLAIMED. IN NO EVENT SHALL CLEARPATH ROBOTICS, INC. BE LIABLE FOR ANY 23 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 24 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 25 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 26 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 27 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 28 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 | * 30 | * Please send comments, questions, or patches to code@clearpathrobotics.com 31 | * 32 | */ 33 | 34 | #ifndef CLEARPATH_HARDWARE_INTERFACES__DIFF_DRIVE_HARDWARE_INTERFACE_HPP_ 35 | #define CLEARPATH_HARDWARE_INTERFACES__DIFF_DRIVE_HARDWARE_INTERFACE_HPP_ 36 | 37 | #include 38 | 39 | #include "rclcpp/rclcpp.hpp" 40 | 41 | #include "clearpath_platform_msgs/msg/drive.hpp" 42 | #include "clearpath_platform_msgs/msg/feedback.hpp" 43 | 44 | namespace clearpath_hardware_interfaces 45 | { 46 | 47 | 48 | 49 | class DiffDriveHardwareInterface 50 | : public rclcpp::Node 51 | { 52 | public: 53 | explicit DiffDriveHardwareInterface(std::string node_name); 54 | void drive_command(const float & left_wheel, const float & right_wheel, const int8_t & mode); 55 | clearpath_platform_msgs::msg::Feedback get_feedback(); 56 | 57 | private: 58 | void feedback_callback(const clearpath_platform_msgs::msg::Feedback::SharedPtr msg); 59 | 60 | rclcpp::Publisher::SharedPtr drive_pub_; 61 | rclcpp::Subscription::SharedPtr feedback_sub_; 62 | 63 | clearpath_platform_msgs::msg::Feedback feedback_; 64 | std::mutex feedback_mutex_; 65 | }; 66 | 67 | } // namespace clearpath_hardware_interfaces 68 | 69 | #endif // CLEARPATH_HARDWARE_INTERFACES__DIFF_DRIVE_HARDWARE_INTERFACE_HPP_ 70 | -------------------------------------------------------------------------------- /clearpath_hardware_interfaces/include/clearpath_hardware_interfaces/j100/hardware.hpp: -------------------------------------------------------------------------------- 1 | /** 2 | * 3 | * \file 4 | * \brief Base J100 hardware class 5 | * \author Roni Kreinin 6 | * \author Tony Baltovski 7 | * \copyright Copyright (c) 2023, Clearpath Robotics, Inc. 8 | * 9 | * Redistribution and use in source and binary forms, with or without 10 | * modification, are permitted provided that the following conditions are met: 11 | * * Redistributions of source code must retain the above copyright 12 | * notice, this list of conditions and the following disclaimer. 13 | * * Redistributions in binary form must reproduce the above copyright 14 | * notice, this list of conditions and the following disclaimer in the 15 | * documentation and/or other materials provided with the distribution. 16 | * * Neither the name of Clearpath Robotics, Inc. nor the 17 | * names of its contributors may be used to endorse or promote products 18 | * derived from this software without specific prior written permission. 19 | * 20 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 21 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 22 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 23 | * DISCLAIMED. IN NO EVENT SHALL CLEARPATH ROBOTICS, INC. BE LIABLE FOR ANY 24 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 25 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 26 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 27 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 28 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 29 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30 | * 31 | * Please send comments, questions, or patches to code@clearpathrobotics.com 32 | * 33 | */ 34 | 35 | #ifndef CLEARPATH_HARDWARE_INTERFACES_J100__HARDWARE_HPP_ 36 | #define CLEARPATH_HARDWARE_INTERFACES_J100__HARDWARE_HPP_ 37 | 38 | 39 | #include "clearpath_hardware_interfaces/diff_drive/hardware.hpp" 40 | #include "clearpath_hardware_interfaces/j100/hardware_interface.hpp" 41 | 42 | 43 | namespace clearpath_hardware_interfaces 44 | { 45 | 46 | class J100Hardware : public DiffDriveHardware 47 | { 48 | private: 49 | hardware_interface::CallbackReturn initHardwareInterface() override; 50 | }; 51 | 52 | } // namespace clearpath_hardware_interfaces 53 | 54 | #endif // CLEARPATH_HARDWARE_INTERFACES_J100_HARDWARE_HPP_ 55 | -------------------------------------------------------------------------------- /clearpath_hardware_interfaces/include/clearpath_hardware_interfaces/j100/hardware_interface.hpp: -------------------------------------------------------------------------------- 1 | /** 2 | * 3 | * \file 4 | * \brief Base J100 hardware interface class 5 | * \author Roni Kreinin 6 | * \author Tony Baltovski 7 | * \copyright Copyright (c) 2023, Clearpath Robotics, Inc. 8 | * 9 | * Redistribution and use in source and binary forms, with or without 10 | * modification, are permitted provided that the following conditions are met: 11 | * * Redistributions of source code must retain the above copyright 12 | * notice, this list of conditions and the following disclaimer. 13 | * * Redistributions in binary form must reproduce the above copyright 14 | * notice, this list of conditions and the following disclaimer in the 15 | * documentation and/or other materials provided with the distribution. 16 | * * Neither the name of Clearpath Robotics, Inc. nor the 17 | * names of its contributors may be used to endorse or promote products 18 | * derived from this software without specific prior written permission. 19 | * 20 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 21 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 22 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 23 | * DISCLAIMED. IN NO EVENT SHALL CLEARPATH ROBOTICS, INC. BE LIABLE FOR ANY 24 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 25 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 26 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 27 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 28 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 29 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30 | * 31 | * Please send comments, questions, or patches to code@clearpathrobotics.com 32 | * 33 | */ 34 | 35 | #ifndef CLEARPATH_HARDWARE_INTERFACES__J100_HARDWARE_INTERFACE_HPP_ 36 | #define CLEARPATH_HARDWARE_INTERFACES__J100_HARDWARE_INTERFACE_HPP_ 37 | 38 | #include "clearpath_hardware_interfaces/diff_drive/hardware_interface.hpp" 39 | 40 | namespace clearpath_hardware_interfaces 41 | { 42 | 43 | class J100HardwareInterface 44 | : public DiffDriveHardwareInterface 45 | { 46 | public: 47 | explicit J100HardwareInterface(std::string node_name); 48 | 49 | }; 50 | 51 | } // namespace clearpath_hardware_interfaces 52 | 53 | #endif // CLEARPATH_HARDWARE_INTERFACES_J100_HARDWARE_INTERFACE_HPP_ 54 | -------------------------------------------------------------------------------- /clearpath_hardware_interfaces/include/clearpath_hardware_interfaces/lighting/platform.hpp: -------------------------------------------------------------------------------- 1 | /** 2 | * 3 | * \file 4 | * \brief Platform Header 5 | * \author Roni Kreinin 6 | * \copyright Copyright (c) 2023, Clearpath Robotics, Inc. 7 | * 8 | * Redistribution and use in source and binary forms, with or without 9 | * modification, are permitted provided that the following conditions are met: 10 | * * Redistributions of source code must retain the above copyright 11 | * notice, this list of conditions and the following disclaimer. 12 | * * Redistributions in binary form must reproduce the above copyright 13 | * notice, this list of conditions and the following disclaimer in the 14 | * documentation and/or other materials provided with the distribution. 15 | * * Neither the name of Clearpath Robotics, Inc. nor the 16 | * names of its contributors may be used to endorse or promote products 17 | * derived from this software without specific prior written permission. 18 | * 19 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 20 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 21 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 22 | * DISCLAIMED. IN NO EVENT SHALL CLEARPATH ROBOTICS, INC. BE LIABLE FOR ANY 23 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 24 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 25 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 26 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 27 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 28 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 | * 30 | * Please send comments, questions, or patches to code@clearpathrobotics.com 31 | * 32 | * Adapted from https://gist.github.com/borgel/d9a8bc11aeb5e0005d8320026c46f6f7 33 | */ 34 | 35 | #ifndef CLEARPATH_HARDWARE_INTERFACES__LIGHTING__PLATFORM_HPP_ 36 | #define CLEARPATH_HARDWARE_INTERFACES__LIGHTING__PLATFORM_HPP_ 37 | 38 | #include 39 | #include 40 | 41 | namespace clearpath_lighting 42 | { 43 | 44 | enum Platform 45 | { 46 | A300, 47 | DD100, 48 | DO100, 49 | DD150, 50 | DO150, 51 | R100, 52 | W200 53 | }; 54 | 55 | static std::map ClearpathPlatforms 56 | { 57 | {"a300", Platform::A300}, 58 | {"dd100", Platform::DD100}, 59 | {"do100", Platform::DO100}, 60 | {"dd150", Platform::DD150}, 61 | {"do150", Platform::DO150}, 62 | {"r100", Platform::R100}, 63 | {"w200", Platform::W200}, 64 | }; 65 | 66 | static std::map PlatformNumLights 67 | { 68 | {Platform::A300, 4}, 69 | {Platform::DD100, 4}, 70 | {Platform::DO100, 4}, 71 | {Platform::DD150, 4}, 72 | {Platform::DO150, 4}, 73 | {Platform::R100, 8}, 74 | {Platform::W200, 4}, 75 | }; 76 | 77 | static std::map PlatformBrightness 78 | { 79 | {Platform::A300, 0.5f}, 80 | {Platform::DD100, 1.0f}, 81 | {Platform::DO100, 1.0f}, 82 | {Platform::DD150, 1.0f}, 83 | {Platform::DO150, 1.0f}, 84 | {Platform::R100, 1.0f}, 85 | {Platform::W200, 1.0f}, 86 | }; 87 | 88 | } 89 | 90 | #endif // CLEARPATH_HARDWARE_INTERFACES__LIGHTING__PLATFORM_HPP_ 91 | -------------------------------------------------------------------------------- /clearpath_hardware_interfaces/include/clearpath_hardware_interfaces/lynx/hardware_interface.hpp: -------------------------------------------------------------------------------- 1 | /** 2 | * 3 | * \file 4 | * \brief Lynx Motor hardware interface class 5 | * \author Luis Camero 6 | * \author Roni Kreinin 7 | * \copyright Copyright (c) 2024, Clearpath Robotics, Inc. 8 | * 9 | * Redistribution and use in source and binary forms, with or without 10 | * modification, are permitted provided that the following conditions are met: 11 | * * Redistributions of source code must retain the above copyright 12 | * notice, this list of conditions and the following disclaimer. 13 | * * Redistributions in binary form must reproduce the above copyright 14 | * notice, this list of conditions and the following disclaimer in the 15 | * documentation and/or other materials provided with the distribution. 16 | * * Neither the name of Clearpath Robotics, Inc. nor the 17 | * names of its contributors may be used to endorse or promote products 18 | * derived from this software without specific prior written permission. 19 | * 20 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 21 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 22 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 23 | * DISCLAIMED. IN NO EVENT SHALL CLEARPATH ROBOTICS, INC. BE LIABLE FOR ANY 24 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 25 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 26 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 27 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 28 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 29 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30 | * 31 | * Please send comments, questions, or patches to code@clearpathrobotics.com 32 | * 33 | */ 34 | #ifndef CLEARPATH_HARDWARE_INTERFACES__LYNX_HARDWARE_INTERFACE_HPP_ 35 | #define CLEARPATH_HARDWARE_INTERFACES__LYNX_HARDWARE_INTERFACE_HPP_ 36 | 37 | #include "rclcpp/rclcpp.hpp" 38 | #include "sensor_msgs/msg/joint_state.hpp" 39 | 40 | #include "clearpath_motor_msgs/msg/lynx_feedback.hpp" 41 | #include "clearpath_motor_msgs/msg/lynx_multi_feedback.hpp" 42 | 43 | namespace clearpath_hardware_interfaces 44 | { 45 | 46 | class LynxHardwareInterface 47 | : public rclcpp::Node 48 | { 49 | public: 50 | explicit LynxHardwareInterface(std::string node_name); 51 | 52 | void drive_command(const sensor_msgs::msg::JointState msg); 53 | 54 | bool has_new_feedback(); 55 | void feedback_callback(const clearpath_motor_msgs::msg::LynxMultiFeedback::SharedPtr msg); 56 | clearpath_motor_msgs::msg::LynxMultiFeedback get_feedback(); 57 | 58 | private: 59 | rclcpp::Publisher::SharedPtr pub_cmd_; 60 | rclcpp::Subscription::SharedPtr sub_feedback_; 61 | 62 | clearpath_motor_msgs::msg::LynxMultiFeedback feedback_; 63 | std::atomic_bool has_feedback_; 64 | }; 65 | 66 | } // namespace clearpath_hardware_interfaces 67 | 68 | #endif // CLEARPATH_HARDWARE_INTERFACES__LYNX_HARDWARE_INTERFACE_HPP_ 69 | -------------------------------------------------------------------------------- /clearpath_hardware_interfaces/include/clearpath_hardware_interfaces/puma/hardware_interface.hpp: -------------------------------------------------------------------------------- 1 | /** 2 | * 3 | * \file 4 | * \brief Puma Motor hardware interface class 5 | * \author Luis Camero 6 | * \copyright Copyright (c) 2024, Clearpath Robotics, Inc. 7 | * 8 | * Redistribution and use in source and binary forms, with or without 9 | * modification, are permitted provided that the following conditions are met: 10 | * * Redistributions of source code must retain the above copyright 11 | * notice, this list of conditions and the following disclaimer. 12 | * * Redistributions in binary form must reproduce the above copyright 13 | * notice, this list of conditions and the following disclaimer in the 14 | * documentation and/or other materials provided with the distribution. 15 | * * Neither the name of Clearpath Robotics, Inc. nor the 16 | * names of its contributors may be used to endorse or promote products 17 | * derived from this software without specific prior written permission. 18 | * 19 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 20 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 21 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 22 | * DISCLAIMED. IN NO EVENT SHALL CLEARPATH ROBOTICS, INC. BE LIABLE FOR ANY 23 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 24 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 25 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 26 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 27 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 28 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 | * 30 | * Please send comments, questions, or patches to code@clearpathrobotics.com 31 | * 32 | */ 33 | #ifndef CLEARPATH_HARDWARE_INTERFACES__PUMA_DRIVE_HARDWARE_INTERFACE_HPP_ 34 | #define CLEARPATH_HARDWARE_INTERFACES__PUMA_DRIVE_HARDWARE_INTERFACE_HPP_ 35 | 36 | #include "rclcpp/rclcpp.hpp" 37 | #include "sensor_msgs/msg/joint_state.hpp" 38 | 39 | #include "clearpath_motor_msgs/msg/puma_feedback.hpp" 40 | #include "clearpath_motor_msgs/msg/puma_multi_feedback.hpp" 41 | 42 | namespace clearpath_hardware_interfaces 43 | { 44 | 45 | class PumaHardwareInterface 46 | : public rclcpp::Node 47 | { 48 | public: 49 | explicit PumaHardwareInterface(std::string node_name); 50 | 51 | void drive_command(const sensor_msgs::msg::JointState msg); 52 | 53 | bool has_new_feedback(); 54 | void feedback_callback(const clearpath_motor_msgs::msg::PumaMultiFeedback::SharedPtr msg); 55 | clearpath_motor_msgs::msg::PumaMultiFeedback get_feedback(); 56 | 57 | private: 58 | rclcpp::Publisher::SharedPtr pub_cmd_; 59 | rclcpp::Subscription::SharedPtr sub_feedback_; 60 | 61 | clearpath_motor_msgs::msg::PumaMultiFeedback feedback_; 62 | std::atomic_bool has_feedback_; 63 | }; 64 | 65 | } // namespace clearpath_hardware_interfaces 66 | 67 | #endif // CLEARPATH_HARDWARE_INTERFACES__PUMA_DRIVE_HARDWARE_INTERFACE_HPP_ 68 | -------------------------------------------------------------------------------- /clearpath_hardware_interfaces/include/clearpath_hardware_interfaces/visibility_control.h: -------------------------------------------------------------------------------- 1 | // Copyright 2017 Open Source Robotics Foundation, Inc. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | #ifndef HARDWARE_INTERFACE__VISIBILITY_CONTROL_H_ 16 | #define HARDWARE_INTERFACE__VISIBILITY_CONTROL_H_ 17 | 18 | // This logic was borrowed (then namespaced) from the examples on the gcc wiki: 19 | // https://gcc.gnu.org/wiki/Visibility 20 | 21 | #if defined _WIN32 || defined __CYGWIN__ 22 | #ifdef __GNUC__ 23 | #define HARDWARE_INTERFACE_EXPORT __attribute__((dllexport)) 24 | #define HARDWARE_INTERFACE_IMPORT __attribute__((dllimport)) 25 | #else 26 | #define HARDWARE_INTERFACE_EXPORT __declspec(dllexport) 27 | #define HARDWARE_INTERFACE_IMPORT __declspec(dllimport) 28 | #endif 29 | #ifdef HARDWARE_INTERFACE_BUILDING_DLL 30 | #define HARDWARE_INTERFACE_PUBLIC HARDWARE_INTERFACE_EXPORT 31 | #else 32 | #define HARDWARE_INTERFACE_PUBLIC HARDWARE_INTERFACE_IMPORT 33 | #endif 34 | #define HARDWARE_INTERFACE_PUBLIC_TYPE HARDWARE_INTERFACE_PUBLIC 35 | #define HARDWARE_INTERFACE_LOCAL 36 | #else 37 | #define HARDWARE_INTERFACE_EXPORT __attribute__((visibility("default"))) 38 | #define HARDWARE_INTERFACE_IMPORT 39 | #if __GNUC__ >= 4 40 | #define HARDWARE_INTERFACE_PUBLIC __attribute__((visibility("default"))) 41 | #define HARDWARE_INTERFACE_LOCAL __attribute__((visibility("hidden"))) 42 | #else 43 | #define HARDWARE_INTERFACE_PUBLIC 44 | #define HARDWARE_INTERFACE_LOCAL 45 | #endif 46 | #define HARDWARE_INTERFACE_PUBLIC_TYPE 47 | #endif 48 | 49 | #endif // HARDWARE_INTERFACE__VISIBILITY_CONTROL_H_ 50 | -------------------------------------------------------------------------------- /clearpath_hardware_interfaces/include/clearpath_hardware_interfaces/w200/hardware_interface.hpp: -------------------------------------------------------------------------------- 1 | /** 2 | * 3 | * \file 4 | * \brief Base W200 hardware interface class 5 | * \author Roni Kreinin 6 | * \author Tony Baltovski 7 | * \copyright Copyright (c) 2023, Clearpath Robotics, Inc. 8 | * 9 | * Redistribution and use in source and binary forms, with or without 10 | * modification, are permitted provided that the following conditions are met: 11 | * * Redistributions of source code must retain the above copyright 12 | * notice, this list of conditions and the following disclaimer. 13 | * * Redistributions in binary form must reproduce the above copyright 14 | * notice, this list of conditions and the following disclaimer in the 15 | * documentation and/or other materials provided with the distribution. 16 | * * Neither the name of Clearpath Robotics, Inc. nor the 17 | * names of its contributors may be used to endorse or promote products 18 | * derived from this software without specific prior written permission. 19 | * 20 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 21 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 22 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 23 | * DISCLAIMED. IN NO EVENT SHALL CLEARPATH ROBOTICS, INC. BE LIABLE FOR ANY 24 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 25 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 26 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 27 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 28 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 29 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30 | * 31 | * Please send comments, questions, or patches to code@clearpathrobotics.com 32 | * 33 | */ 34 | 35 | #ifndef CLEARPATH_HARDWARE_INTERFACES__W200_HARDWARE_INTERFACE_HPP_ 36 | #define CLEARPATH_HARDWARE_INTERFACES__W200_HARDWARE_INTERFACE_HPP_ 37 | 38 | #include "rclcpp/rclcpp.hpp" 39 | 40 | #include 41 | 42 | namespace clearpath_hardware_interfaces 43 | { 44 | 45 | class W200HardwareInterface 46 | : public rclcpp::Node 47 | { 48 | public: 49 | explicit W200HardwareInterface(std::string node_name); 50 | void feedback_left_callback(const std_msgs::msg::Float64::SharedPtr msg); 51 | void feedback_right_callback(const std_msgs::msg::Float64::SharedPtr msg); 52 | void drive_command(const float & left_wheel, const float & right_wheel); 53 | bool has_new_feedback(); 54 | std_msgs::msg::Float64 get_left_feedback(); 55 | std_msgs::msg::Float64 get_right_feedback(); 56 | 57 | private: 58 | rclcpp::Publisher::SharedPtr pub_left_cmd; 59 | rclcpp::Publisher::SharedPtr pub_right_cmd; 60 | rclcpp::Subscription::SharedPtr sub_left_feedback_; 61 | rclcpp::Subscription::SharedPtr sub_right_feedback_; 62 | 63 | std::atomic feedback_left_, feedback_right_; 64 | std::atomic_bool has_left_feedback_, has_right_feedback_; 65 | }; 66 | 67 | } // namespace clearpath_hardware_interfaces 68 | 69 | #endif // CLEARPATH_HARDWARE_INTERFACES_W200_HARDWARE_INTERFACE_HPP_ 70 | -------------------------------------------------------------------------------- /clearpath_hardware_interfaces/package.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | clearpath_hardware_interfaces 5 | 2.5.0 6 | Clearpath Platform Drivers. 7 | 8 | Mike Purvis 9 | Paul Bovbel 10 | Roni Kreinin 11 | Tony Baltovski 12 | 13 | Luis Camero 14 | Roni Kreinin 15 | Tony Baltovski 16 | 17 | BSD 18 | 19 | ament_cmake 20 | 21 | controller_interface 22 | controller_manager 23 | controller_manager_msgs 24 | clearpath_motor_msgs 25 | clearpath_platform_msgs 26 | diagnostic_msgs 27 | diagnostic_updater 28 | hardware_interface 29 | geometry_msgs 30 | nav_msgs 31 | pluginlib 32 | rclcpp 33 | sensor_msgs 34 | std_msgs 35 | std_srvs 36 | tf2 37 | tf2_ros 38 | 39 | clearpath_control 40 | clearpath_platform_description 41 | xacro 42 | 43 | 44 | ament_cmake 45 | 46 | 47 | -------------------------------------------------------------------------------- /clearpath_hardware_interfaces/src/a200/hardware.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 6 | 7 | The ros2_control A200Hardware using a system hardware interface-type. 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /clearpath_hardware_interfaces/src/a200/horizon_legacy/Message_request.cpp: -------------------------------------------------------------------------------- 1 | /** 2 | * _____ 3 | * / _ \ 4 | * / _/ \ \ 5 | * / / \_/ \ 6 | * / \_/ _ \ ___ _ ___ ___ ____ ____ ___ _____ _ _ 7 | * \ / \_/ \ / / _\| | | __| / _ \ | ++ \ | ++ \ / _ \ |_ _|| | | | 8 | * \ \_/ \_/ / | | | | | ++ | |_| || ++ / | ++_/| |_| | | | | +-+ | 9 | * \ \_/ / | |_ | |_ | ++ | _ || |\ \ | | | _ | | | | +-+ | 10 | * \_____/ \___/|___||___||_| |_||_| \_\|_| |_| |_| |_| |_| |_| 11 | * ROBOTICS™ 12 | * 13 | * File: Message_request.cpp 14 | * Desc: Implements the Request Message class. 15 | * Auth: Iain Peet 16 | * 17 | * Copyright (c) 2010, Clearpath Robotics, Inc. 18 | * All Rights Reserved 19 | * 20 | * Redistribution and use in source and binary forms, with or without 21 | * modification, are permitted provided that the following conditions are met: 22 | * * Redistributions of source code must retain the above copyright 23 | * notice, this list of conditions and the following disclaimer. 24 | * * Redistributions in binary form must reproduce the above copyright 25 | * notice, this list of conditions and the following disclaimer in the 26 | * documentation and/or other materials provided with the distribution. 27 | * * Neither the name of Clearpath Robotics, Inc. nor the 28 | * names of its contributors may be used to endorse or promote products 29 | * derived from this software without specific prior written permission. 30 | * 31 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 32 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 33 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 34 | * DISCLAIMED. IN NO EVENT SHALL CLEARPATH ROBOTICS, INC. BE LIABLE FOR ANY 35 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 36 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 37 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 38 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 39 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 40 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 41 | * 42 | * Please send comments, questions, or patches to skynet@clearpathrobotics.com 43 | * 44 | */ 45 | 46 | #include "clearpath_hardware_interfaces/a200/horizon_legacy/Message_request.h" 47 | #include "clearpath_hardware_interfaces/a200/horizon_legacy/Number.h" 48 | 49 | namespace clearpath 50 | { 51 | 52 | Request::Request(uint16_t type, uint16_t freq) : Message() 53 | { 54 | setPayloadLength(2); 55 | utob(getPayloadPointer(), 2, freq); 56 | setType(type); 57 | 58 | makeValid(); 59 | } 60 | 61 | Request::Request(const Request &other) : Message(other) 62 | { 63 | } 64 | 65 | } // namespace clearpath 66 | -------------------------------------------------------------------------------- /clearpath_hardware_interfaces/src/a200/horizon_legacy/horizon_legacy_wrapper.cpp: -------------------------------------------------------------------------------- 1 | /** 2 | * 3 | * \author Paul Bovbel 4 | * \copyright Copyright (c) 2014-2015, Clearpath Robotics, Inc. 5 | * 6 | * Redistribution and use in source and binary forms, with or without 7 | * modification, are permitted provided that the following conditions are met: 8 | * * Redistributions of source code must retain the above copyright 9 | * notice, this list of conditions and the following disclaimer. 10 | * * Redistributions in binary form must reproduce the above copyright 11 | * notice, this list of conditions and the following disclaimer in the 12 | * documentation and/or other materials provided with the distribution. 13 | * * Neither the name of Clearpath Robotics, Inc. nor the 14 | * names of its contributors may be used to endorse or promote products 15 | * derived from this software without specific prior written permission. 16 | * 17 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 18 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 19 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 20 | * DISCLAIMED. IN NO EVENT SHALL CLEARPATH ROBOTICS, INC. BE LIABLE FOR ANY 21 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 22 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 23 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 24 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 25 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 26 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 | * 28 | * Please send comments, questions, or patches to code@clearpathrobotics.com 29 | * 30 | */ 31 | 32 | #include "clearpath_hardware_interfaces/a200/horizon_legacy/clearpath.h" 33 | 34 | 35 | namespace 36 | { 37 | std::string port_; 38 | } 39 | 40 | namespace horizon_legacy 41 | { 42 | 43 | void reconnect() 44 | { 45 | if (port_.empty()) 46 | { 47 | throw std::logic_error("Can't reconnect when port is not configured"); 48 | } 49 | std::cout << "Connecting to Husky on port " << port_ << "..."; 50 | clearpath::Transport::instance().configure(port_.c_str(), 3); 51 | std::cout << "Connected"; 52 | } 53 | 54 | void connect(std::string port) 55 | { 56 | port_ = port; 57 | reconnect(); 58 | } 59 | 60 | void configureLimits(double max_speed, double max_accel) 61 | { 62 | 63 | bool success = false; 64 | while (!success) 65 | { 66 | try 67 | { 68 | clearpath::SetMaxAccel(max_accel, max_accel).send(); 69 | clearpath::SetMaxSpeed(max_speed, max_speed).send(); 70 | success = true; 71 | } 72 | catch (clearpath::Exception *ex) 73 | { 74 | std::cout << "Error configuring velocity and accel limits: " << ex->message; 75 | reconnect(); 76 | } 77 | } 78 | } 79 | 80 | void controlSpeed(double speed_left, double speed_right, double accel_left, double accel_right) 81 | { 82 | bool success = false; 83 | while (!success) 84 | { 85 | try 86 | { 87 | clearpath::SetDifferentialSpeed(speed_left, speed_right, accel_left, accel_right).send(); 88 | success = true; 89 | } 90 | catch (clearpath::Exception *ex) 91 | { 92 | std::cout << "Error sending speed and accel command: " << ex->message; 93 | reconnect(); 94 | } 95 | } 96 | } 97 | 98 | } 99 | -------------------------------------------------------------------------------- /clearpath_hardware_interfaces/src/j100/hardware.cpp: -------------------------------------------------------------------------------- 1 | /** 2 | * 3 | * \file 4 | * \brief Class representing J100 hardware 5 | * \author Roni Kreinin 6 | * \author Tony Baltovski 7 | * \copyright Copyright (c) 2023, Clearpath Robotics, Inc. 8 | * 9 | * Redistribution and use in source and binary forms, with or without 10 | * modification, are permitted provided that the following conditions are met: 11 | * * Redistributions of source code must retain the above copyright 12 | * notice, this list of conditions and the following disclaimer. 13 | * * Redistributions in binary form must reproduce the above copyright 14 | * notice, this list of conditions and the following disclaimer in the 15 | * documentation and/or other materials provided with the distribution. 16 | * * Neither the name of Clearpath Robotics, Inc. nor the 17 | * names of its contributors may be used to endorse or promote products 18 | * derived from this software without specific prior written permission. 19 | * 20 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 21 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 22 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 23 | * DISCLAIMED. IN NO EVENT SHALL CLEARPATH ROBOTICS, INC. BE LIABLE FOR ANY 24 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 25 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 26 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 27 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 28 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 29 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30 | * 31 | * Please send comments, questions, or patches to code@clearpathrobotics.com 32 | * 33 | */ 34 | 35 | #include "clearpath_hardware_interfaces/j100/hardware.hpp" 36 | #include "clearpath_platform_msgs/msg/feedback.hpp" 37 | #include "hardware_interface/types/hardware_interface_type_values.hpp" 38 | 39 | namespace clearpath_hardware_interfaces 40 | { 41 | 42 | hardware_interface::CallbackReturn J100Hardware::initHardwareInterface() 43 | { 44 | node_ = std::make_shared("j100_hardware_interface"); 45 | 46 | if (node_ == nullptr) 47 | { 48 | return hardware_interface::CallbackReturn::ERROR; 49 | } 50 | 51 | return hardware_interface::CallbackReturn::SUCCESS; 52 | } 53 | 54 | } // namespace clearpath_hardware_interfaces 55 | 56 | #include "pluginlib/class_list_macros.hpp" 57 | PLUGINLIB_EXPORT_CLASS( 58 | clearpath_hardware_interfaces::J100Hardware, hardware_interface::SystemInterface) 59 | -------------------------------------------------------------------------------- /clearpath_hardware_interfaces/src/j100/hardware.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 6 | 7 | The ros2_control J100Hardware using a system hardware interface-type. 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /clearpath_hardware_interfaces/src/j100/hardware_interface.cpp: -------------------------------------------------------------------------------- 1 | /** 2 | * 3 | * \file 4 | * \brief Class representing J100 hardware interface 5 | * \author Roni Kreinin 6 | * \author Tony Baltovski 7 | * \copyright Copyright (c) 2023, Clearpath Robotics, Inc. 8 | * 9 | * Redistribution and use in source and binary forms, with or without 10 | * modification, are permitted provided that the following conditions are met: 11 | * * Redistributions of source code must retain the above copyright 12 | * notice, this list of conditions and the following disclaimer. 13 | * * Redistributions in binary form must reproduce the above copyright 14 | * notice, this list of conditions and the following disclaimer in the 15 | * documentation and/or other materials provided with the distribution. 16 | * * Neither the name of Clearpath Robotics, Inc. nor the 17 | * names of its contributors may be used to endorse or promote products 18 | * derived from this software without specific prior written permission. 19 | * 20 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 21 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 22 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 23 | * DISCLAIMED. IN NO EVENT SHALL CLEARPATH ROBOTICS, INC. BE LIABLE FOR ANY 24 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 25 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 26 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 27 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 28 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 29 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30 | * 31 | * Please send comments, questions, or patches to code@clearpathrobotics.com 32 | * 33 | */ 34 | 35 | #include "clearpath_hardware_interfaces/j100/hardware_interface.hpp" 36 | 37 | using clearpath_hardware_interfaces::J100HardwareInterface; 38 | 39 | /** 40 | * @brief Construct a new J100HardwareInterface object 41 | * 42 | */ 43 | J100HardwareInterface::J100HardwareInterface(std::string node_name) 44 | : DiffDriveHardwareInterface(node_name) 45 | {} 46 | -------------------------------------------------------------------------------- /clearpath_hardware_interfaces/src/lighting/main.cpp: -------------------------------------------------------------------------------- 1 | /** 2 | * 3 | * \file 4 | * \brief Lighting Main 5 | * \author Roni Kreinin 6 | * \copyright Copyright (c) 2023, Clearpath Robotics, Inc. 7 | * 8 | * Redistribution and use in source and binary forms, with or without 9 | * modification, are permitted provided that the following conditions are met: 10 | * * Redistributions of source code must retain the above copyright 11 | * notice, this list of conditions and the following disclaimer. 12 | * * Redistributions in binary form must reproduce the above copyright 13 | * notice, this list of conditions and the following disclaimer in the 14 | * documentation and/or other materials provided with the distribution. 15 | * * Neither the name of Clearpath Robotics, Inc. nor the 16 | * names of its contributors may be used to endorse or promote products 17 | * derived from this software without specific prior written permission. 18 | * 19 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 20 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 21 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 22 | * DISCLAIMED. IN NO EVENT SHALL CLEARPATH ROBOTICS, INC. BE LIABLE FOR ANY 23 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 24 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 25 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 26 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 27 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 28 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 | * 30 | * Please send comments, questions, or patches to code@clearpathrobotics.com 31 | * 32 | */ 33 | 34 | #include 35 | #include 36 | #include 37 | 38 | #include 39 | 40 | #include "clearpath_hardware_interfaces/lighting/lighting.hpp" 41 | 42 | int main(int argc, char * argv[]) 43 | { 44 | rclcpp::init(argc, argv); 45 | 46 | rclcpp::executors::SingleThreadedExecutor executor; 47 | 48 | auto lighting = std::make_shared(); 49 | 50 | executor.add_node(lighting); 51 | executor.spin(); 52 | 53 | rclcpp::shutdown(); 54 | 55 | return 0; 56 | } 57 | -------------------------------------------------------------------------------- /clearpath_hardware_interfaces/src/lynx/hardware.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 6 | 7 | The ros2_control LynxHardware using a system hardware interface-type. 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /clearpath_hardware_interfaces/src/lynx/hardware_interface.cpp: -------------------------------------------------------------------------------- 1 | /** 2 | Software License Agreement (BSD) 3 | 4 | \file hardware_interface.cpp 5 | \authors Luis Camero 6 | Roni Kreinin 7 | \copyright Copyright (c) 2024, Clearpath Robotics, Inc., All rights reserved. 8 | 9 | Redistribution and use in source and binary forms, with or without 10 | modification, are permitted provided that the following conditions are met: 11 | * Redistributions of source code must retain the above copyright notice, 12 | this list of conditions and the following disclaimer. 13 | * Redistributions in binary form must reproduce the above copyright notice, 14 | this list of conditions and the following disclaimer in the documentation 15 | and/or other materials provided with the distribution. 16 | * Neither the name of Clearpath Robotics nor the names of its contributors 17 | may be used to endorse or promote products derived from this software 18 | without specific prior written permission. 19 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 20 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 21 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 22 | ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE 23 | LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 24 | CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 25 | SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 26 | INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 27 | CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 28 | ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 29 | POSSIBILITY OF SUCH DAMAGE. 30 | */ 31 | #include "clearpath_hardware_interfaces/lynx/hardware_interface.hpp" 32 | 33 | using clearpath_hardware_interfaces::LynxHardwareInterface; 34 | 35 | /** 36 | * @brief Construct a new LynxHardwareInterface object 37 | */ 38 | LynxHardwareInterface::LynxHardwareInterface(std::string node_name) 39 | : Node(node_name) 40 | { 41 | sub_feedback_ = create_subscription( 42 | "platform/motors/feedback", 43 | rclcpp::SensorDataQoS(), 44 | std::bind(&LynxHardwareInterface::feedback_callback, this, std::placeholders::_1)); 45 | 46 | pub_cmd_ = create_publisher( 47 | "platform/motors/cmd", 48 | rclcpp::SensorDataQoS()); 49 | } 50 | 51 | /** 52 | * @brief Callback for feedback 53 | * 54 | * @param msg 55 | */ 56 | void LynxHardwareInterface::feedback_callback(const clearpath_motor_msgs::msg::LynxMultiFeedback::SharedPtr msg) 57 | { 58 | feedback_ = *msg; 59 | has_feedback_ = true; 60 | } 61 | 62 | /** 63 | * @brief Publish drive command 64 | * 65 | * @param 66 | */ 67 | void LynxHardwareInterface::drive_command(const sensor_msgs::msg::JointState msg) 68 | { 69 | pub_cmd_->publish(msg); 70 | return; 71 | } 72 | 73 | /** 74 | * @brief Check if there is new feedback 75 | * 76 | * @return true 77 | * @return false 78 | */ 79 | bool LynxHardwareInterface::has_new_feedback() 80 | { 81 | return has_feedback_; 82 | } 83 | 84 | /** 85 | * @brief Get feedback 86 | * 87 | * @return clearpath_motor_msgs::msg::LynxMultiFeedback 88 | */ 89 | clearpath_motor_msgs::msg::LynxMultiFeedback LynxHardwareInterface::get_feedback() 90 | { 91 | has_feedback_ = false; 92 | return feedback_; 93 | } 94 | -------------------------------------------------------------------------------- /clearpath_hardware_interfaces/src/puma/hardware.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 6 | 7 | The ros2_control PumaHardware using a system hardware interface-type. 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /clearpath_hardware_interfaces/src/puma/hardware_interface.cpp: -------------------------------------------------------------------------------- 1 | /** 2 | Software License Agreement (BSD) 3 | 4 | \file hardware_interface.cpp 5 | \authors Luis Camero 6 | \copyright Copyright (c) 2024, Clearpath Robotics, Inc., All rights reserved. 7 | 8 | Redistribution and use in source and binary forms, with or without 9 | modification, are permitted provided that the following conditions are met: 10 | * Redistributions of source code must retain the above copyright notice, 11 | this list of conditions and the following disclaimer. 12 | * Redistributions in binary form must reproduce the above copyright notice, 13 | this list of conditions and the following disclaimer in the documentation 14 | and/or other materials provided with the distribution. 15 | * Neither the name of Clearpath Robotics nor the names of its contributors 16 | may be used to endorse or promote products derived from this software 17 | without specific prior written permission. 18 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 19 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 20 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 21 | ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE 22 | LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 23 | CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 24 | SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 25 | INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 26 | CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 27 | ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 28 | POSSIBILITY OF SUCH DAMAGE. 29 | */ 30 | #include "clearpath_hardware_interfaces/puma/hardware_interface.hpp" 31 | 32 | using clearpath_hardware_interfaces::PumaHardwareInterface; 33 | 34 | /** 35 | * @brief Construct a new PumaHardwareInterface object 36 | */ 37 | PumaHardwareInterface::PumaHardwareInterface(std::string node_name) 38 | : Node(node_name) 39 | { 40 | sub_feedback_ = create_subscription( 41 | "platform/motors/feedback", 42 | rclcpp::SensorDataQoS(), 43 | std::bind(&PumaHardwareInterface::feedback_callback, this, std::placeholders::_1)); 44 | 45 | pub_cmd_ = create_publisher( 46 | "platform/motors/cmd", 47 | rclcpp::SensorDataQoS()); 48 | } 49 | 50 | /** 51 | * @brief Callback for feedback 52 | * 53 | * @param msg 54 | */ 55 | void PumaHardwareInterface::feedback_callback(const clearpath_motor_msgs::msg::PumaMultiFeedback::SharedPtr msg) 56 | { 57 | feedback_ = *msg; 58 | has_feedback_ = true; 59 | } 60 | 61 | /** 62 | * @brief Publish drive command 63 | * 64 | * @param 65 | */ 66 | void PumaHardwareInterface::drive_command(const sensor_msgs::msg::JointState msg) 67 | { 68 | pub_cmd_->publish(msg); 69 | return; 70 | } 71 | 72 | /** 73 | * @brief Check if there is new feedback 74 | * 75 | * @return true 76 | * @return false 77 | */ 78 | bool PumaHardwareInterface::has_new_feedback() 79 | { 80 | return has_feedback_; 81 | } 82 | 83 | /** 84 | * @brief Get feedback 85 | * 86 | * @return clearpath_motor_msgs::msg::PumaMultiFeedback 87 | */ 88 | clearpath_motor_msgs::msg::PumaMultiFeedback PumaHardwareInterface::get_feedback() 89 | { 90 | has_feedback_ = false; 91 | return feedback_; 92 | } 93 | -------------------------------------------------------------------------------- /clearpath_hardware_interfaces/src/w200/hardware.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 6 | 7 | The ros2_control W200Hardware using a system hardware interface-type. 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /clearpath_motor_drivers/lynx_motor_driver/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | ################################################################################ 2 | # Set minimum required version of cmake, project name and compile options 3 | ################################################################################ 4 | cmake_minimum_required(VERSION 3.5) 5 | project(lynx_motor_driver) 6 | 7 | if (NOT CMAKE_CXX_STANDARD) 8 | set(CMAKE_CXX_STANDARD 14) 9 | endif () 10 | if (CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang") 11 | add_compile_options(-Wall -Wextra -Wpedantic -fPIC) 12 | endif () 13 | 14 | ################################################################################ 15 | # Find ament packages and libraries for ament and system dependencies 16 | ################################################################################ 17 | find_package(ament_cmake REQUIRED) 18 | find_package(ament_index_cpp REQUIRED) 19 | find_package(can_msgs REQUIRED) 20 | find_package(clearpath_motor_msgs REQUIRED) 21 | find_package(clearpath_ros2_socketcan_interface REQUIRED) 22 | find_package(diagnostic_updater REQUIRED) 23 | find_package(rclcpp REQUIRED) 24 | find_package(rclcpp_action REQUIRED) 25 | find_package(sensor_msgs REQUIRED) 26 | find_package(std_msgs REQUIRED) 27 | 28 | ################################################################################ 29 | # Build 30 | ################################################################################ 31 | 32 | include_directories( 33 | include 34 | ) 35 | 36 | ament_export_include_directories(include) 37 | 38 | set(DEPENDENCIES 39 | ament_cmake 40 | ament_index_cpp 41 | can_msgs 42 | clearpath_motor_msgs 43 | clearpath_ros2_socketcan_interface 44 | diagnostic_updater 45 | rclcpp 46 | rclcpp_action 47 | sensor_msgs 48 | std_msgs 49 | ) 50 | 51 | add_executable(lynx_motor_driver src/main.cpp 52 | src/calibrate_action.cpp 53 | src/lynx_motor_driver.cpp 54 | src/lynx_motor_node.cpp 55 | src/system_protection.cpp 56 | src/update_action.cpp 57 | ) 58 | 59 | ament_target_dependencies(lynx_motor_driver ${DEPENDENCIES}) 60 | 61 | ################################################################################ 62 | # Install 63 | ################################################################################ 64 | install(TARGETS lynx_motor_driver 65 | DESTINATION lib/${PROJECT_NAME} 66 | ) 67 | 68 | install( 69 | DIRECTORY bin config launch 70 | DESTINATION share/${PROJECT_NAME} 71 | ) 72 | 73 | ################################################################################ 74 | # Macro for ament package 75 | ################################################################################ 76 | ament_package() 77 | -------------------------------------------------------------------------------- /clearpath_motor_drivers/lynx_motor_driver/LICENSE: -------------------------------------------------------------------------------- 1 | BSD 3-Clause License 2 | 3 | Copyright (c) 2024, Clearpath Robotics Inc. 4 | 5 | Redistribution and use in source and binary forms, with or without 6 | modification, are permitted provided that the following conditions are met: 7 | 8 | 1. Redistributions of source code must retain the above copyright notice, this 9 | list of conditions and the following disclaimer. 10 | 11 | 2. Redistributions in binary form must reproduce the above copyright notice, 12 | this list of conditions and the following disclaimer in the documentation 13 | and/or other materials provided with the distribution. 14 | 15 | 3. Neither the name of the copyright holder nor the names of its 16 | contributors may be used to endorse or promote products derived from 17 | this software without specific prior written permission. 18 | 19 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 20 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 21 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 22 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 23 | FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 24 | DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 25 | SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 26 | CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 27 | OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 28 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 | -------------------------------------------------------------------------------- /clearpath_motor_drivers/lynx_motor_driver/README.md: -------------------------------------------------------------------------------- 1 | # Lynx Motor Driver 2 | 3 | C++ Driver and ROS 2 node for Clearpath's Lynx BLDC motor controller. 4 | 5 | ## Clearpath Platforms using Lynx 6 | 7 | - Husky A300 8 | 9 | ## Usage 10 | 11 | This driver will be automatically launched when using the [Clearpath Config](https://docs.clearpathrobotics.com/docs/ros/config/yaml/overview) system. 12 | 13 | ### Manual launch 14 | 15 | `ros2 launch lynx_motor_driver lynx_motor_driver.launch.py can_bus:=my_can0 namespace:=/my_namespace parameters:=/path/to/my/parameters.yaml` 16 | 17 | ### Launch arguments 18 | 19 | - `can_bus`: CAN bus interface to use. 20 | - Default: `can0` 21 | - `namespace`: Robot namespace. 22 | - Default: `/` 23 | - `parameters`: Node parameters. 24 | - Default: `lynx_motor_driver/config/single_test.yaml` 25 | 26 | ## Node 27 | 28 | The Lynx motor node will create a driver for each specified motor controller. It will subscribe to velocity commands coming from ROS 2 controls, and publish feedback and status data it receives from the Lynx controllers. It also manages the system protection state. 29 | 30 | Additionally, the Lynx motor node can be used to calibrate the motors, and update firmware to the Lynx motor controller. 31 | 32 | ### Subscribers 33 | 34 | - `platform/motors/cmd`: Velocity commands to send to the motor controller. Joint name must match parameters. 35 | - Type: `sensor_msgs/msg/JointState` 36 | 37 | ### Publishers 38 | - `platform/motors/system_protection`: System and individual motor controller protection states. 39 | - Type: `clearpath_motor_msgs/msg/LynxSystemProtection` 40 | 41 | - `platform/motors/feedback`: Motor feedback such as current, voltage, and velocity. 42 | - Type: `clearpath_motor_msgs/msg/LynxMultiFeedback` 43 | 44 | - `platform/motors/status`: Motor statuses such as temperature, and flags. 45 | - Type: `clearpath_motor_msgs/msg/LynxMultiStatus` 46 | 47 | ### Actions 48 | 49 | - `platform/motors/calibrate`: Run the calibration sequence on each motor controller. 50 | - Type: `clearpath_motor_msgs/action/LynxCalibrate` 51 | 52 | 53 | - Usage: 54 | `ros2 action send_goal /platform/motors/calibrate clearpath_motor_msgs/action/LynxCalibrate {} --feedback` 55 | 56 | :warning: 57 | The robot must be placed on a box and off the ground before running this action. The wheels will begin to turn when it is called. 58 | 59 | 60 | - `platform/motors/update`: Update each motor controller with a binary file. 61 | - Type: `clearpath_motor_msgs/action/LynxUpdate` 62 | 63 | 64 | - Usage: 65 | `ros2 action send_goal /platform/motors/update clearpath_motor_msgs/action/LynxUpdate "file: ''" --feedback` 66 | 67 | :warning: 68 | Only use Clearpath verified binary files. Attempting to flash custom files can render the Lynx motor controller non-functional. Leave the file field empty to use the default binary. 69 | -------------------------------------------------------------------------------- /clearpath_motor_drivers/lynx_motor_driver/config/a300.yaml: -------------------------------------------------------------------------------- 1 | /**: 2 | ros__parameters: 3 | feedback_hz: 50 4 | status_hz: 20 5 | debug_hz: 20 6 | can_bus: 'can0' 7 | joint_names: ['rear_left_wheel_joint', 'front_left_wheel_joint', 'front_right_wheel_joint', 'rear_right_wheel_joint'] 8 | joint_can_ids: [101, 102, 103, 104] 9 | joint_directions: [1, 1, -1, -1] 10 | -------------------------------------------------------------------------------- /clearpath_motor_drivers/lynx_motor_driver/config/single_test.yaml: -------------------------------------------------------------------------------- 1 | /**: 2 | ros__parameters: 3 | feedback_hz: 50 4 | status_hz: 20 5 | debug_hz: 20 6 | can_bus: 'can0' 7 | joint_names: ['rear_left_wheel_joint'] 8 | joint_can_ids: [101] 9 | joint_directions: [1] 10 | -------------------------------------------------------------------------------- /clearpath_motor_drivers/lynx_motor_driver/include/lynx_motor_driver/can_api.hpp: -------------------------------------------------------------------------------- 1 | /** 2 | Software License Agreement (BSD) 3 | 4 | \authors Roni Kreinin 5 | \copyright Copyright (c) 2024, Clearpath Robotics, Inc., All rights reserved. 6 | 7 | Redistribution and use in source and binary forms, with or without modification, are permitted provided that 8 | the following conditions are met: 9 | * Redistributions of source code must retain the above copyright notice, this list of conditions and the 10 | following disclaimer. 11 | * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the 12 | following disclaimer in the documentation and/or other materials provided with the distribution. 13 | * Neither the name of Clearpath Robotics nor the names of its contributors may be used to endorse or promote 14 | products derived from this software without specific prior written permission. 15 | 16 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WAR- 17 | RANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 18 | PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, IN- 19 | DIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT 20 | OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 21 | ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 22 | ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 23 | */ 24 | 25 | #ifndef LYNX_MOTOR_DRIVER__CAN_API_H 26 | #define LYNX_MOTOR_DRIVER__CAN_API_H 27 | 28 | 29 | // Masks and bit shifts 30 | #define CAN_MSGID_FULL_MASK 0x1FFFFFFF 31 | #define CAN_MSGID_CANID_MASK 0x0000007F 32 | #define CAN_MSGID_API_MASK (CAN_MSGID_FULL_MASK ^ CAN_MSGID_CANID_MASK) 33 | #define CAN_MSGID_CANID_SHIFT 0 34 | #define CAN_MSGID_API_SHIFT 7 35 | 36 | // Lynx CAN message IDs 37 | #define CAN_MSGID_VELOCITY_DEMAND 0x606B 38 | #define CAN_MSGID_FEEDBACK 0x7000 39 | #define CAN_MSGID_STATUS 0x7001 40 | #define CAN_MSGID_DEBUG 0x7002 41 | #define CAN_MSGID_FLUX_GAINS 0x9000 42 | #define CAN_MSGID_TORQUE_GAINS 0x9001 43 | #define CAN_MSGID_SPEED_GAINS 0x9002 44 | #define CAN_MSGID_FLUX_LIMITS 0xA000 45 | #define CAN_MSGID_TORQUE_LIMITS 0xA001 46 | #define CAN_MSGID_SPEED_LIMITS 0xA002 47 | #define CAN_MSGID_CALIBRATION_REQUEST 0xB000 48 | #define CAN_MSGID_CALIBRATION_ITERATION 0xB001 49 | #define CAN_MSGID_CALIBRATION_OFFSET 0xB002 50 | #define CAN_MSGID_CALIBRATION_CANCEL 0xB003 51 | #define CAN_MSGID_PROTECTION_SYSTEM_STATE 0xC000 52 | #define CAN_MSGID_PROTECTION_MOTOR_STATE 0xC001 53 | #define CAN_MSGID_PROTECTION_ACCUMULATORS 0xC002 54 | #define CAN_MSGID_BOOT_ALIVE 0xF000 55 | #define CAN_MSGID_BOOT_DATA 0xF001 56 | #define CAN_MSGID_BOOT_RESP 0xF002 57 | #define CAN_MSGID_BOOT_REQ 0xF003 58 | 59 | #endif // LYNX_MOTOR_DRIVER__CAN_API_H 60 | -------------------------------------------------------------------------------- /clearpath_motor_drivers/lynx_motor_driver/launch/lynx_motor_driver.launch.py: -------------------------------------------------------------------------------- 1 | from launch import LaunchDescription 2 | from launch.actions import DeclareLaunchArgument, GroupAction, IncludeLaunchDescription 3 | from launch.substitutions import LaunchConfiguration, PathJoinSubstitution 4 | from launch.launch_description_sources import PythonLaunchDescriptionSource 5 | from launch_ros.actions import Node, PushRosNamespace 6 | from launch_ros.substitutions import FindPackageShare 7 | 8 | def generate_launch_description(): 9 | # Packages 10 | pkg_lynx_motor_driver = FindPackageShare('lynx_motor_driver') 11 | pkg_ros2_socketcan = FindPackageShare('ros2_socketcan') 12 | 13 | # Launch Configurations 14 | parameters = LaunchConfiguration('parameters') 15 | can_bus = LaunchConfiguration('can_bus') 16 | namespace = LaunchConfiguration('namespace') 17 | 18 | # Launch Arguments 19 | arg_parameters = DeclareLaunchArgument( 20 | 'parameters', 21 | default_value=PathJoinSubstitution([ 22 | pkg_lynx_motor_driver, 23 | 'config', 24 | 'single_test.yaml' 25 | ])) 26 | 27 | arg_can_bus = DeclareLaunchArgument( 28 | 'can_bus', 29 | default_value='can0' 30 | ) 31 | 32 | arg_namespace = DeclareLaunchArgument( 33 | 'namespace', 34 | default_value='', 35 | description='Robot namespace' 36 | ) 37 | 38 | # Launch files 39 | launch_file_ros2_socketcan_receiver = PathJoinSubstitution([ 40 | pkg_ros2_socketcan, 41 | 'launch', 42 | 'socket_can_receiver.launch.py' 43 | ]) 44 | 45 | launch_file_ros2_socketcan_sender = PathJoinSubstitution([ 46 | pkg_ros2_socketcan, 47 | 'launch', 48 | 'socket_can_sender.launch.py' 49 | ]) 50 | 51 | multi_bldc_group_action = GroupAction( 52 | actions=[ 53 | PushRosNamespace(namespace), 54 | 55 | IncludeLaunchDescription( 56 | PythonLaunchDescriptionSource(launch_file_ros2_socketcan_receiver), 57 | launch_arguments=[ 58 | ('interface', can_bus), 59 | ('from_can_bus_topic', [can_bus, '/rx']), 60 | ] 61 | ), 62 | 63 | IncludeLaunchDescription( 64 | PythonLaunchDescriptionSource(launch_file_ros2_socketcan_sender), 65 | launch_arguments=[ 66 | ('interface', can_bus), 67 | ('to_can_bus_topic', [can_bus, '/tx']) 68 | ] 69 | ), 70 | 71 | Node( 72 | package='lynx_motor_driver', 73 | executable='lynx_motor_driver', 74 | parameters=[ 75 | parameters, 76 | {'can_bus': can_bus} 77 | ], 78 | output='screen' 79 | ) 80 | ] 81 | ) 82 | 83 | ld = LaunchDescription() 84 | ld.add_action(arg_parameters) 85 | ld.add_action(arg_can_bus) 86 | ld.add_action(arg_namespace) 87 | ld.add_action(multi_bldc_group_action) 88 | return ld 89 | -------------------------------------------------------------------------------- /clearpath_motor_drivers/lynx_motor_driver/package.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | lynx_motor_driver 4 | 2.5.0 5 | A ROS driver for Clearpath Lynx motor controllers 6 | 7 | Roni Kreinin 8 | BSD 9 | 10 | ament_cmake 11 | ament_index_cpp 12 | can_msgs 13 | clearpath_motor_msgs 14 | clearpath_ros2_socketcan_interface 15 | diagnostic_updater 16 | rclcpp 17 | rclcpp_action 18 | ros2_socketcan 19 | sensor_msgs 20 | 21 | 22 | ament_cmake 23 | 24 | 25 | -------------------------------------------------------------------------------- /clearpath_motor_drivers/lynx_motor_driver/src/main.cpp: -------------------------------------------------------------------------------- 1 | /** 2 | Software License Agreement (BSD) 3 | 4 | \authors Roni Kreinin 5 | \copyright Copyright (c) 2024, Clearpath Robotics, Inc., All rights reserved. 6 | 7 | Redistribution and use in source and binary forms, with or without modification, are permitted provided that 8 | the following conditions are met: 9 | * Redistributions of source code must retain the above copyright notice, this list of conditions and the 10 | following disclaimer. 11 | * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the 12 | following disclaimer in the documentation and/or other materials provided with the distribution. 13 | * Neither the name of Clearpath Robotics nor the names of its contributors may be used to endorse or promote 14 | products derived from this software without specific prior written permission. 15 | 16 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WAR- 17 | RANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 18 | PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, IN- 19 | DIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT 20 | OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 21 | ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 22 | ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 23 | */ 24 | 25 | #include "lynx_motor_driver/lynx_motor_node.hpp" 26 | 27 | /** 28 | * @brief Main entry point for Lynx Motor Node 29 | * 30 | * @param argc 31 | * @param argv 32 | * @return int 33 | */ 34 | int main(int argc, char * argv[]) 35 | { 36 | rclcpp::init(argc, argv); 37 | 38 | rclcpp::executors::SingleThreadedExecutor exe; 39 | 40 | std::shared_ptr lynx_motor_node = 41 | std::make_shared("lynx_motor_node"); 42 | 43 | exe.add_node(lynx_motor_node); 44 | exe.spin(); 45 | 46 | rclcpp::shutdown(); 47 | return 0; 48 | } 49 | -------------------------------------------------------------------------------- /clearpath_motor_drivers/lynx_motor_driver/src/system_protection.cpp: -------------------------------------------------------------------------------- 1 | /** 2 | Software License Agreement (BSD) 3 | 4 | \authors Roni Kreinin 5 | \copyright Copyright (c) 2024, Clearpath Robotics, Inc., All rights reserved. 6 | 7 | Redistribution and use in source and binary forms, with or without modification, are permitted provided that 8 | the following conditions are met: 9 | * Redistributions of source code must retain the above copyright notice, this list of conditions and the 10 | following disclaimer. 11 | * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the 12 | following disclaimer in the documentation and/or other materials provided with the distribution. 13 | * Neither the name of Clearpath Robotics nor the names of its contributors may be used to endorse or promote 14 | products derived from this software without specific prior written permission. 15 | 16 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WAR- 17 | RANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 18 | PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, IN- 19 | DIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT 20 | OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 21 | ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 22 | ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 23 | */ 24 | 25 | #include "lynx_motor_driver/lynx_motor_node.hpp" 26 | 27 | using namespace lynx_motor_driver; 28 | 29 | 30 | /** 31 | * @brief Update system level proctection state 32 | * 33 | */ 34 | void LynxMotorNode::updateSystemState() 35 | { 36 | uint8_t system_state = clearpath_motor_msgs::msg::LynxSystemProtection::NORMAL; 37 | 38 | // Set system level protection state to max of all driver protection states 39 | for (auto & driver : drivers_) 40 | { 41 | if (driver.getProtectionState() > system_state) 42 | { 43 | system_state = driver.getProtectionState(); 44 | } 45 | } 46 | 47 | // Update system protection state 48 | if (system_state != system_protection_msg_.system_state) 49 | { 50 | system_protection_msg_.system_state = system_state; 51 | sendSystemState(); 52 | } 53 | } 54 | 55 | /** 56 | * @brief Send system protection state to each driver and publish to topic 57 | * 58 | */ 59 | void LynxMotorNode::sendSystemState() 60 | { 61 | int i = 0; 62 | for (auto & driver : drivers_) 63 | { 64 | system_protection_msg_.motor_states.at(i++) = driver.getProtectionState(); 65 | if (!updating_) 66 | { 67 | driver.sendProtectionState(system_protection_msg_.system_state); 68 | } 69 | } 70 | 71 | publishSystemState(); 72 | } 73 | 74 | /** 75 | * @brief Stamp and publish system protection state 76 | * 77 | */ 78 | void LynxMotorNode::publishSystemState() 79 | { 80 | system_protection_msg_.header.stamp = this->get_clock()->now(); 81 | system_protection_pub_->publish(system_protection_msg_); 82 | } 83 | -------------------------------------------------------------------------------- /clearpath_motor_drivers/puma_motor_driver/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.8) 2 | project(puma_motor_driver) 3 | 4 | if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang") 5 | add_compile_options(-Wall -Wextra -Wpedantic) 6 | endif() 7 | 8 | # find dependencies 9 | find_package(ament_cmake REQUIRED) 10 | find_package(can_msgs REQUIRED) 11 | find_package(clearpath_motor_msgs REQUIRED) 12 | find_package(clearpath_ros2_socketcan_interface REQUIRED) 13 | find_package(rclcpp REQUIRED) 14 | find_package(std_msgs REQUIRED) 15 | find_package(sensor_msgs REQUIRED) 16 | 17 | 18 | set(DEPENDENCIES 19 | ament_cmake 20 | can_msgs 21 | clearpath_motor_msgs 22 | clearpath_ros2_socketcan_interface 23 | rclcpp 24 | std_msgs 25 | sensor_msgs 26 | ) 27 | 28 | add_executable(multi_puma_node 29 | src/multi_puma_node.cpp 30 | src/driver.cpp 31 | ) 32 | target_include_directories(multi_puma_node PUBLIC 33 | $ 34 | $) 35 | target_compile_features(multi_puma_node PUBLIC c_std_99 cxx_std_17) # Require C99 and C++17 36 | 37 | ament_target_dependencies(multi_puma_node ${DEPENDENCIES}) 38 | target_link_libraries(multi_puma_node) 39 | 40 | install(TARGETS multi_puma_node 41 | DESTINATION lib/${PROJECT_NAME}) 42 | 43 | if(BUILD_TESTING) 44 | find_package(ament_lint_auto REQUIRED) 45 | # the following line skips the linter which checks for copyrights 46 | # comment the line when a copyright and license is added to all source files 47 | set(ament_cmake_copyright_FOUND TRUE) 48 | # the following line skips cpplint (only works in a git repo) 49 | # comment the line when this package is in a git repo and when 50 | # a copyright and license is added to all source files 51 | set(ament_cmake_cpplint_FOUND TRUE) 52 | ament_lint_auto_find_test_dependencies() 53 | endif() 54 | 55 | ament_package() 56 | -------------------------------------------------------------------------------- /clearpath_motor_drivers/puma_motor_driver/package.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | puma_motor_driver 5 | 2.5.0 6 | Motor driver for Puma motor control board that utilizes ROS 2 Socketcan Gateway 7 | Luis Camero 8 | BSD-3-Clause 9 | Mike Purvis 10 | 11 | ament_cmake 12 | 13 | can_msgs 14 | clearpath_motor_msgs 15 | clearpath_ros2_socketcan_interface 16 | rclcpp 17 | sensor_msgs 18 | std_msgs 19 | 20 | ament_lint_auto 21 | ament_lint_common 22 | 23 | 24 | ament_cmake 25 | 26 | 27 | -------------------------------------------------------------------------------- /clearpath_robot/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.8) 2 | project(clearpath_robot) 3 | 4 | if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang") 5 | add_compile_options(-Wall -Wextra -Wpedantic) 6 | endif() 7 | 8 | # find dependencies 9 | find_package(ament_cmake REQUIRED) 10 | 11 | 12 | install( 13 | DIRECTORY scripts services 14 | DESTINATION share/${PROJECT_NAME} 15 | ) 16 | 17 | install( 18 | PROGRAMS 19 | scripts/install 20 | scripts/grab-diagnostics 21 | DESTINATION lib/${PROJECT_NAME} 22 | ) 23 | 24 | if(BUILD_TESTING) 25 | find_package(ament_lint_auto REQUIRED) 26 | # the following line skips the linter which checks for copyrights 27 | # comment the line when a copyright and license is added to all source files 28 | set(ament_cmake_copyright_FOUND TRUE) 29 | # the following line skips cpplint (only works in a git repo) 30 | # comment the line when this package is in a git repo and when 31 | # a copyright and license is added to all source files 32 | set(ament_cmake_cpplint_FOUND TRUE) 33 | ament_lint_auto_find_test_dependencies() 34 | endif() 35 | 36 | ament_package() 37 | -------------------------------------------------------------------------------- /clearpath_robot/debian/install: -------------------------------------------------------------------------------- 1 | install_config/logind/70-clearpath-standard-logind.conf /usr/lib/systemd/logind.conf.d/ -------------------------------------------------------------------------------- /clearpath_robot/debian/postinst: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | get_user() { 4 | python3 -c ' 5 | try: 6 | from clearpath_config.clearpath_config import ClearpathConfig 7 | from clearpath_config.common.utils.yaml import read_yaml 8 | config = read_yaml("/etc/clearpath/robot.yaml") 9 | clearpath_config = ClearpathConfig(config) 10 | print(clearpath_config.system.username) 11 | except: 12 | print("robot") 13 | ' 14 | } 15 | 16 | . /opt/ros/jazzy/setup.bash 17 | if [ -f /etc/clearpath/setup.bash ]; 18 | then 19 | . /etc/clearpath/setup.bash 20 | fi 21 | 22 | # if clearpath-robot.service already exists, reinstall it on an update 23 | if [ -f /lib/systemd/system/clearpath-robot.service ]; 24 | then 25 | echo "Detected previous installation of clearpath-robot.service. Updating services..." 26 | setpriv --reuid $(get_user) --regid $(get_user) --keep-groups ros2 run clearpath_robot install & 27 | 28 | 29 | # Fix the user in all clearpath-*-start and clearpath-*-stop scripts 30 | for script in $(ls /usr/sbin/clearpath-*-start); 31 | do 32 | sed -i "s/setpriv --reuid root/setpriv --reuid $(get_user)/" $script 33 | done 34 | for script in $(ls /usr/sbin/clearpath-*-stop); 35 | do 36 | sed -i "s/setpriv --reuid root/setpriv --reuid $(get_user)/" $script 37 | done 38 | 39 | echo "Reloading systemd configuration..." 40 | systemctl daemon-reload > /dev/null 41 | 42 | if ! [ -z "$(systemctl status clearpath-robot.service|grep running)" ]; 43 | then 44 | echo "Restarting clearpath-robot.service..." 45 | systemctl restart clearpath-robot.service > /dev/null 46 | fi 47 | fi 48 | -------------------------------------------------------------------------------- /clearpath_robot/debian/udev: -------------------------------------------------------------------------------- 1 | # Udev rule for the Prolific Serial-to-USB adapter shipped standard with Clearpath Husky A200 2 | SUBSYSTEMS=="usb", ATTRS{manufacturer}=="Prolific*", SYMLINK+="clearpath/prolific clearpath/prolific_$attr{devpath}", MODE="0666" 3 | 4 | # World-writeable permissions for the STM32 ROM bootloader. 5 | SUBSYSTEM=="usb", ATTRS{idVendor}=="0483", ATTRS{idProduct}=="df11", MODE="0666" 6 | 7 | # World-writeable permissions and a symlink for the Jackal J100 MCU. 8 | SUBSYSTEM=="tty", ATTRS{idProduct}=="5740", ATTRS{idVendor}=="0483", ATTRS{manufacturer}!="Lord Microstrain", MODE="0666", SYMLINK="clearpath/j100" 9 | 10 | # Recognize Clearpath flavoured FTDI cables. 11 | SUBSYSTEM=="tty", ATTRS{idProduct}=="6001", ATTRS{idVendor}=="0403", ATTRS{product}=="Clearpath Robotics /*", MODE="0666", PROGRAM="/bin/echo '%s{product}'", SYMLINK+="clearpath%c{3}" 12 | 13 | # Rule to enable low latency mode for FTDI adaptors, regardless if flavoured or not. 14 | SUBSYSTEM=="tty", KERNEL=="ttyUSB[0-9]*", ATTRS{idProduct}=="6001", ATTRS{idVendor}=="0403", MODE="0666", RUN+="/bin/bash -c 'echo 1 > /sys$devpath/device/latency_timer'", SYMLINK+="ftdi_%s{serial}" 15 | 16 | # CAN rule for PCI CANBUS card 17 | SUBSYSTEM=="net", KERNEL == "can0", RUN+="/bin/sh -c 'ip link set can0 type can bitrate 1000000; ip link set can0 up'" 18 | SUBSYSTEM=="net", KERNEL == "can1", RUN+="/bin/sh -c 'ip link set can1 type can bitrate 500000; ip link set can1 up'" 19 | 20 | # Rule to catch FTDI CANUSB adapters 21 | SUBSYSTEM=="tty", ATTRS{idVendor}=="0403", ATTRS{idProduct}=="6001", ATTRS{product}=="CANUSB", SYMLINK="usbcan", MODE="0666" 22 | 23 | SUBSYSTEM=="tty", ATTRS{idVendor}=="0403", ATTRS{idProduct}=="6001", ATTRS{product}=="CANUSB", PROGRAM="/bin/sh -c 'echo %s{serial} | sed s/^0000.*/main/g | sed s/^2-00.*/aux/g | sed -e s/[[:space:]]/_/g | tr -s _'", SYMLINK+="usbcan_%c", MODE="0666" 24 | -------------------------------------------------------------------------------- /clearpath_robot/install_config/logind/70-clearpath-standard-logind.conf: -------------------------------------------------------------------------------- 1 | # Disable the clearing of SHM links when all user sessions are ended so that running 2 | # ROS 2 services are not impacted when SSH sessions are closed. 3 | [Login] 4 | RemoveIPC=no -------------------------------------------------------------------------------- /clearpath_robot/package.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | clearpath_robot 5 | 2.5.0 6 | Clearpath Robot Metapackage 7 | Luis Camero 8 | Roni Kreinin 9 | Tony Baltovski 10 | 11 | BSD 12 | 13 | Roni Kreinin 14 | 15 | ament_cmake 16 | 17 | can-utils 18 | socat 19 | 20 | 21 | clearpath_generator_robot 22 | clearpath_hardware_interfaces 23 | clearpath_sensors 24 | lynx_motor_driver 25 | puma_motor_driver 26 | 27 | 28 | clearpath_config 29 | clearpath_common 30 | clearpath_tests 31 | robot_upstart 32 | 33 | 34 | 35 | robotiq_controllers 36 | ur_robot_driver 37 | 38 | ament_lint_auto 39 | ament_lint_common 40 | 41 | 42 | ament_cmake 43 | 44 | 45 | -------------------------------------------------------------------------------- /clearpath_robot/scripts/check: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Software License Agreement (BSD) 3 | # 4 | # Author Luis Camero 5 | # Copyright (c) 2024, Clearpath Robotics, Inc., All rights reserved. 6 | # 7 | # Redistribution and use in source and binary forms, with or without 8 | # modification, are permitted provided that the following conditions are met: 9 | # * Redistributions of source code must retain the above copyright notice, 10 | # this list of conditions and the following disclaimer. 11 | # * Redistributions in binary form must reproduce the above copyright notice, 12 | # this list of conditions and the following disclaimer in the documentation 13 | # and/or other materials provided with the distribution. 14 | # * Neither the name of Clearpath Robotics nor the names of its contributors 15 | # may be used to endorse or promote products derived from this software 16 | # without specific prior written permission. 17 | # 18 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 19 | # AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 20 | # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 21 | # ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE 22 | # LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 23 | # CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 24 | # SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 25 | # INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 26 | # CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 27 | # ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 28 | # POSSIBILITY OF SUCH DAMAGE. 29 | 30 | filename="/etc/clearpath/robot.yaml" 31 | 32 | m1=$(md5sum "$filename") 33 | 34 | while true; do 35 | sleep 1 36 | 37 | m2=$(md5sum "$filename") 38 | 39 | if [ "$m1" != "$m2" ] ; then 40 | echo "robot.yaml has changed." >&2 41 | exit 1 42 | fi 43 | done 44 | -------------------------------------------------------------------------------- /clearpath_robot/scripts/generate: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Software License Agreement (BSD) 3 | # 4 | # Author Luis Camero 5 | # Copyright (c) 2024, Clearpath Robotics, Inc., All rights reserved. 6 | # 7 | # Redistribution and use in source and binary forms, with or without 8 | # modification, are permitted provided that the following conditions are met: 9 | # * Redistributions of source code must retain the above copyright notice, 10 | # this list of conditions and the following disclaimer. 11 | # * Redistributions in binary form must reproduce the above copyright notice, 12 | # this list of conditions and the following disclaimer in the documentation 13 | # and/or other materials provided with the distribution. 14 | # * Neither the name of Clearpath Robotics nor the names of its contributors 15 | # may be used to endorse or promote products derived from this software 16 | # without specific prior written permission. 17 | # 18 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 19 | # AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 20 | # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 21 | # ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE 22 | # LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 23 | # CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 24 | # SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 25 | # INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 26 | # CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 27 | # ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 28 | # POSSIBILITY OF SUCH DAMAGE. 29 | 30 | source /opt/ros/jazzy/setup.bash 31 | 32 | # Check if clearpath_generator_common package exists, if not look for it from a workspace 33 | if [ ! -d "/opt/ros/jazzy/share/clearpath_generator_common" ]; then 34 | echo "/opt/ros/jazzy/share/clearpath_generator_common does not exist" 35 | echo "Expecting a workspace with clearpath_generator_common package" 36 | source /home/$USER/colcon_ws/install/setup.bash 37 | fi 38 | 39 | # Generate and source setup.bash 40 | ros2 run clearpath_generator_common generate_bash 41 | source /etc/clearpath/setup.bash 42 | 43 | # Generate discovery server start file 44 | ros2 run clearpath_generator_common generate_discovery_server 45 | 46 | # Generate Zenoh router start file 47 | ros2 run clearpath_generator_common generate_zenoh_router 48 | 49 | # Generate vcan bridge start file 50 | ros2 run clearpath_generator_common generate_vcan 51 | 52 | # Generate description 53 | ros2 run clearpath_generator_common generate_description 54 | 55 | # Generate semantic description 56 | ros2 run clearpath_generator_common generate_semantic_description 57 | 58 | # Generate parameters 59 | ros2 run clearpath_generator_robot generate_param 60 | 61 | # Generate launch files 62 | ros2 run clearpath_generator_robot generate_launch 63 | -------------------------------------------------------------------------------- /clearpath_robot/scripts/grab-diagnostics: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Software License Agreement (BSD) 3 | # 4 | # Author Tony Baltovski 5 | # Copyright (c) 2024, Clearpath Robotics, Inc., All rights reserved. 6 | # 7 | # Redistribution and use in source and binary forms, with or without 8 | # modification, are permitted provided that the following conditions are met: 9 | # * Redistributions of source code must retain the above copyright notice, 10 | # this list of conditions and the following disclaimer. 11 | # * Redistributions in binary form must reproduce the above copyright notice, 12 | # this list of conditions and the following disclaimer in the documentation 13 | # and/or other materials provided with the distribution. 14 | # * Neither the name of Clearpath Robotics nor the names of its contributors 15 | # may be used to endorse or promote products derived from this software 16 | # without specific prior written permission. 17 | # 18 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 19 | # AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 20 | # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 21 | # ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE 22 | # LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 23 | # CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 24 | # SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 25 | # INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 26 | # CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 27 | # ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 28 | # POSSIBILITY OF SUCH DAMAGE. 29 | 30 | # Create a temporary folder 31 | temp_folder=$(mktemp -d) 32 | 33 | # Run journalctl command and save output to log file 34 | sudo journalctl -b 0 -u clearpath-platform >> $temp_folder/platform.log 35 | sudo journalctl -b 0 -u clearpath-sensors >> $temp_folder/sensors.log 36 | sudo journalctl -b 0 -u clearpath-robot >> $temp_folder/robot.log 37 | 38 | sudo dmesg -T >> $temp_folder/dmesg.log 39 | lsusb -t -v >> $temp_folder/usb.log 40 | ls -lisah /dev/ >> $temp_folder/dev.log 41 | env | grep 'ROS\|RMW' >> $temp_folder/env.log 42 | ip a >> $temp_folder/ip.log 43 | 44 | mkdir -p $temp_folder/netplan 45 | cp -r /etc/netplan/ "$temp_folder/netplan/" 46 | 47 | # Get hostname 48 | hostname=$(hostname) 49 | 50 | # Get current date 51 | current_date=$(date +"%Y-%m-%d") 52 | 53 | # Compress log file into an archive 54 | archive_name="${hostname}_${current_date}.tar.gz" 55 | tar -czvf "$archive_name" -C "$temp_folder" . 56 | 57 | # Move the archive to the home directory of the current user 58 | mv "$archive_name" "$HOME/" 59 | 60 | # Remove temporary folder 61 | rm -r "$temp_folder" 62 | 63 | echo "Log archived as: $HOME/$archive_name" -------------------------------------------------------------------------------- /clearpath_robot/scripts/shutdown.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | 3 | # # Software License Agreement (BSD) 4 | # 5 | # Author Roni Kreinin 6 | # Copyright (c) 2025, Clearpath Robotics, Inc., All rights reserved. 7 | # 8 | # Redistribution and use in source and binary forms, with or without 9 | # modification, are permitted provided that the following conditions are met: 10 | # * Redistributions of source code must retain the above copyright notice, 11 | # this list of conditions and the following disclaimer. 12 | # * Redistributions in binary form must reproduce the above copyright notice, 13 | # this list of conditions and the following disclaimer in the documentation 14 | # and/or other materials provided with the distribution. 15 | # * Neither the name of Clearpath Robotics nor the names of its contributors 16 | # may be used to endorse or promote products derived from this software 17 | # without specific prior written permission. 18 | # 19 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 20 | # AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 21 | # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 22 | # ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE 23 | # LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 24 | # CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 25 | # SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 26 | # INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 27 | # CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 28 | # ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 29 | # POSSIBILITY OF SUCH DAMAGE. 30 | 31 | import socket 32 | import subprocess 33 | import time 34 | 35 | shutdown_port = 11415 36 | 37 | # Create UDP socket 38 | s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM) 39 | s.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1) 40 | s.setblocking(0) 41 | s.settimeout(0.5) 42 | 43 | # Attempt to bind socket 44 | while True: 45 | try: 46 | s.bind(('192.168.131.1', shutdown_port)) 47 | print('Socket 192.168.131.1:11415 bound') 48 | break 49 | except OSError: 50 | time.sleep(1) 51 | 52 | # Wait for shutdown signal 53 | while True: 54 | try: 55 | (data, addr) = s.recvfrom(64) 56 | if 'SHUTDOWN' in str(data): 57 | print('Shutting down.') 58 | subprocess.run(['shutdown', '-h', 'now']) 59 | except socket.timeout: 60 | pass 61 | -------------------------------------------------------------------------------- /clearpath_robot/services/clearpath-discovery.service: -------------------------------------------------------------------------------- 1 | [Unit] 2 | Description="Clearpath FastDDS discovery server" 3 | PartOf=clearpath-robot.service 4 | After=clearpath-robot.service 5 | 6 | [Service] 7 | User=administrator 8 | Type=simple 9 | Restart=on-failure 10 | RestartSec=1 11 | ExecStart=/bin/bash -e /etc/clearpath/discovery-server-start 12 | 13 | [Install] 14 | WantedBy=clearpath-robot.service 15 | -------------------------------------------------------------------------------- /clearpath_robot/services/clearpath-manipulators.service: -------------------------------------------------------------------------------- 1 | [Unit] 2 | Description="Clearpath robot sub-service, launch all manipulators nodes" 3 | PartOf=clearpath-robot.service 4 | After=clearpath-robot.service 5 | 6 | [Service] 7 | User=administrator 8 | Type=simple 9 | ExecStart=/usr/sbin/clearpath-manipulators-start 10 | 11 | [Install] 12 | WantedBy=clearpath-robot.service 13 | -------------------------------------------------------------------------------- /clearpath_robot/services/clearpath-platform-extras.service: -------------------------------------------------------------------------------- 1 | [Unit] 2 | Description="Clearpath robot sub-service, launch all user-defined extra platform nodes" 3 | PartOf=clearpath-robot.service 4 | After=clearpath-robot.service 5 | 6 | [Service] 7 | User=administrator 8 | Type=simple 9 | ExecStart=/usr/sbin/clearpath-platform-extras-start 10 | 11 | [Install] 12 | WantedBy=clearpath-robot.service 13 | -------------------------------------------------------------------------------- /clearpath_robot/services/clearpath-platform.service: -------------------------------------------------------------------------------- 1 | [Unit] 2 | Description="Clearpath robot sub-service, launch all platform nodes" 3 | PartOf=clearpath-robot.service 4 | After=clearpath-robot.service 5 | 6 | [Service] 7 | User=administrator 8 | Type=simple 9 | ExecStart=/usr/sbin/clearpath-platform-start 10 | 11 | [Install] 12 | WantedBy=clearpath-robot.service 13 | -------------------------------------------------------------------------------- /clearpath_robot/services/clearpath-robot.service: -------------------------------------------------------------------------------- 1 | [Unit] 2 | Description="Clearpath robot main generation and bringup service" 3 | After=network-online.target 4 | 5 | [Service] 6 | User=administrator 7 | Type=simple 8 | ExecStartPre=/usr/sbin/clearpath-robot-generate 9 | ExecStart=/usr/sbin/clearpath-robot-check 10 | RemainAfterExit=yes 11 | Restart=on-failure 12 | RestartSec=1 13 | 14 | [Install] 15 | WantedBy=multi-user.target 16 | -------------------------------------------------------------------------------- /clearpath_robot/services/clearpath-sensors.service: -------------------------------------------------------------------------------- 1 | [Unit] 2 | Description="Clearpath robot sub-service, launch all sensor nodes" 3 | PartOf=clearpath-robot.service 4 | After=clearpath-robot.service 5 | 6 | [Service] 7 | User=administrator 8 | Type=simple 9 | ExecStart=/usr/sbin/clearpath-sensors-start 10 | 11 | [Install] 12 | WantedBy=clearpath-robot.service 13 | -------------------------------------------------------------------------------- /clearpath_robot/services/clearpath-shutdown.service: -------------------------------------------------------------------------------- 1 | [Unit] 2 | Description="Clearpath graceful shutdown service" 3 | PartOf=clearpath-robot.service 4 | After=clearpath-robot.service 5 | 6 | [Service] 7 | Restart=on-failure 8 | User=root 9 | Type=idle 10 | ExecStart=/bin/bash -c 'python3 /usr/sbin/clearpath-shutdown' 11 | 12 | [Install] 13 | WantedBy=clearpath-robot.service 14 | -------------------------------------------------------------------------------- /clearpath_robot/services/clearpath-vcan.service: -------------------------------------------------------------------------------- 1 | [Unit] 2 | Description="Clearpath Virtual CAN over UDP Bridge" 3 | PartOf=clearpath-robot.service 4 | After=clearpath-robot.service 5 | 6 | [Service] 7 | Restart=on-failure 8 | User=root 9 | Type=forking 10 | ExecStart=/bin/bash -e /etc/clearpath/vcan-start 11 | 12 | [Install] 13 | WantedBy=clearpath-robot.service 14 | -------------------------------------------------------------------------------- /clearpath_robot/services/clearpath-zenoh-router.service: -------------------------------------------------------------------------------- 1 | [Unit] 2 | Description="Clearpath Zenoh router service" 3 | PartOf=clearpath-robot.service 4 | After=clearpath-robot.service 5 | 6 | [Service] 7 | User=administrator 8 | Type=simple 9 | Restart=on-failure 10 | RestartSec=1 11 | ExecStart=/bin/bash -e /etc/clearpath/zenoh-router-start 12 | 13 | [Install] 14 | WantedBy=clearpath-robot.service 15 | -------------------------------------------------------------------------------- /clearpath_sensors/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.8) 2 | project(clearpath_sensors) 3 | 4 | if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang") 5 | add_compile_options(-Wall -Wextra -Wpedantic) 6 | endif() 7 | 8 | # find dependencies 9 | find_package(ament_cmake REQUIRED) 10 | 11 | install(DIRECTORY config launch 12 | DESTINATION share/${PROJECT_NAME} 13 | ) 14 | 15 | if(BUILD_TESTING) 16 | find_package(ament_lint_auto REQUIRED) 17 | # the following line skips the linter which checks for copyrights 18 | # comment the line when a copyright and license is added to all source files 19 | set(ament_cmake_copyright_FOUND TRUE) 20 | # the following line skips cpplint (only works in a git repo) 21 | # comment the line when this package is in a git repo and when 22 | # a copyright and license is added to all source files 23 | set(ament_cmake_cpplint_FOUND TRUE) 24 | ament_lint_auto_find_test_dependencies() 25 | endif() 26 | 27 | ament_package() 28 | -------------------------------------------------------------------------------- /clearpath_sensors/config/axis_camera.yaml: -------------------------------------------------------------------------------- 1 | axis_camera: 2 | # By default we assume were dealing with a PTZ dome camera so load those parameters 3 | ros__parameters: 4 | hostname: "192.168.0.90" 5 | http_port: 80 6 | username: "root" 7 | password: "" 8 | width: 640 9 | height: 480 10 | fps: 20 11 | tf_prefix: "axis" 12 | camera_info_url: "" 13 | use_encrypted_password : False 14 | camera : 1 15 | ir: False 16 | defog: False 17 | wiper: False 18 | 19 | # PTZ limits 20 | ptz: True 21 | min_pan: -3.141592653589793 22 | max_pan: 3.141592653589793 23 | min_tilt: 0.0 24 | max_tilt: 1.5707963267948966 25 | min_zoom: 1 26 | max_zoom: 24 27 | max_pan_speed: 2.61 28 | max_tilt_speed: 2.61 29 | 30 | # PTZ Teleop 31 | ptz_teleop: True 32 | button_enable_pan_tilt : -1 33 | button_enable_zoom : -1 34 | axis_pan : 3 35 | axis_tilt : 4 36 | invert_tilt : False 37 | axis_zoom_in: 5 38 | axis_zoom_out: 2 39 | zoom_in_offset: -1.0 40 | zoom_out_offset: -1.0 41 | zoom_in_scale: -0.5 42 | zoom_out_scale: 0.5 43 | scale_pan : 2.61 44 | scale_tilt : 2.61 45 | scale_zoom : 100.0 46 | -------------------------------------------------------------------------------- /clearpath_sensors/config/chrobotics_um6.yaml: -------------------------------------------------------------------------------- 1 | um6_driver: 2 | ros__parameters: 3 | port: /dev/clearpath/imu 4 | baud: 115200 5 | update_rate: 20 6 | mag_updates: true 7 | accel_updates: true 8 | zero_gyros: true 9 | frame_id: imu_0_link 10 | linear_acceleration_stdev: 0.0392266 11 | angular_velocity_stdev: 0.001047 12 | orientation_x_stdev: 0.052360 13 | orientation_y_stdev: 0.052360 14 | orientation_z_stdev: 0.052360 15 | tf_ned_to_enu: true 16 | orientation_in_robot_frame: false -------------------------------------------------------------------------------- /clearpath_sensors/config/fixposition.yaml: -------------------------------------------------------------------------------- 1 | fixposition_driver: 2 | ros__parameters: 3 | fp_output: 4 | formats: 5 | - ODOMETRY 6 | - LLH 7 | - RAWIMU 8 | - CORRIMU 9 | port: "21001" 10 | ip: 192.168.131.35 11 | rate: 200 12 | type: tcp 13 | reconnect: 5 14 | customer_input: 15 | speed_topic: "xvn/speed" 16 | rtcm_topic: "xvn/rtcm" 17 | -------------------------------------------------------------------------------- /clearpath_sensors/config/flir_blackfly.yaml: -------------------------------------------------------------------------------- 1 | flir_blackfly: 2 | ros__parameters: 3 | serial_number: '' 4 | debug: false 5 | compute_brightness: false 6 | adjust_timestamp: true 7 | dump_node_map: false 8 | gain_auto: Continuous 9 | pixel_format: BayerRG8 10 | exposure_auto: Continuous 11 | # These are useful for GigE cameras 12 | # device_link_throughput_limit: 380000000 13 | # gev_scps_packet_size: 9000 14 | # ---- to reduce the sensor width and shift the crop 15 | # image_width: 1408 16 | # image_height: 1080 17 | # offset_x: 16 18 | # offset_y: 0 19 | binning_x: 2 20 | binning_y: 2 21 | frame_rate_auto: Off 22 | frame_rate: 30 23 | frame_rate_enable: true 24 | buffer_queue_size: 1 25 | trigger_mode: Off 26 | chunk_mode_active: true 27 | chunk_selector_frame_id: FrameID 28 | chunk_enable_frame_id: true 29 | chunk_selector_exposure_time: ExposureTime 30 | chunk_enable_exposure_time: true 31 | chunk_selector_gain: Gain 32 | chunk_enable_gain: true 33 | chunk_selector_timestamp: Timestamp 34 | chunk_enable_timestamp: true 35 | flir_blackfly: 36 | image_raw: 37 | enable_pub_plugins: 38 | - image_transport/raw 39 | image_debayer: 40 | ros__parameters: 41 | ffmpeg_image_transport: 42 | qmax: 40 43 | preset: superfast 44 | tune: zerolatency 45 | bit_rate: 1000000 46 | gop_size: 15 47 | image_mono: 48 | enable_pub_plugins: 49 | - image_transport/compressed 50 | - image_transport/ffmpeg 51 | - image_transport/raw 52 | image_color: 53 | enable_pub_plugins: 54 | - image_transport/compressed 55 | - image_transport/ffmpeg 56 | - image_transport/raw 57 | -------------------------------------------------------------------------------- /clearpath_sensors/config/garmin_18x.yaml: -------------------------------------------------------------------------------- 1 | nmea_navsat_driver: 2 | ros__parameters: 3 | port: "/dev/clearpath/gps" 4 | baud: 115200 5 | frame_id: "gps_0_link" 6 | useRMC: False -------------------------------------------------------------------------------- /clearpath_sensors/config/hokuyo_ust.yaml: -------------------------------------------------------------------------------- 1 | urg_node: 2 | ros__parameters: 3 | angle_max: 3.14 4 | angle_min: -3.14 5 | ip_address: "192.168.131.20" 6 | ip_port: 10940 7 | serial_port: "/dev/ttyACM0" 8 | serial_baud: 115200 9 | laser_frame_id: "lidar2d_0_laser" 10 | calibrate_time: false 11 | default_user_latency: 0.0 12 | diagnostics_tolerance: 0.05 13 | diagnostics_window_time: 5.0 14 | error_limit: 4 15 | get_detailed_status: false 16 | publish_intensity: false 17 | publish_multiecho: false 18 | cluster: 1 19 | skip: 0 -------------------------------------------------------------------------------- /clearpath_sensors/config/image_rectify.yaml: -------------------------------------------------------------------------------- 1 | image_rectify: 2 | ros__parameters: 3 | image_transport: raw 4 | interpolation: 1 5 | queue_size: 5 6 | -------------------------------------------------------------------------------- /clearpath_sensors/config/image_resize.yaml: -------------------------------------------------------------------------------- 1 | image_resize: 2 | ros__parameters: 3 | image_transport: raw 4 | interpolation: 1 5 | use_scale: True 6 | scale_height: 1.0 7 | scale_width: 1.0 8 | height: -1 9 | width: -1 10 | -------------------------------------------------------------------------------- /clearpath_sensors/config/imu_filter.yaml: -------------------------------------------------------------------------------- 1 | imu_filter_madgwick: 2 | ros__parameters: 3 | use_sim_time: False 4 | stateless: false 5 | use_mag: false 6 | publish_tf: false 7 | reverse_tf: false 8 | fixed_frame: "odom" 9 | constant_dt: 0.0 10 | publish_debug_topics: false 11 | world_frame: "enu" 12 | gain: 0.1 13 | zeta: 0.0 14 | mag_bias_x: 0.0 15 | mag_bias_y: 0.0 16 | mag_bias_z: 0.0 17 | orientation_stddev: 0.0 18 | -------------------------------------------------------------------------------- /clearpath_sensors/config/intel_realsense.yaml: -------------------------------------------------------------------------------- 1 | intel_realsense: 2 | ros__parameters: 3 | camera_name: camera 4 | camera_namespace: camera 5 | serial_no: '' 6 | usb_port_id: '' 7 | device_type: '' 8 | config_file: '' 9 | json_file_path: '' 10 | initial_reset: false 11 | accelerate_gpu_with_glsl: false 12 | rosbag_filename: '' 13 | log_level: info 14 | output: screen 15 | enable_color: true 16 | rgb_camera.color_profile: 0,0,0 17 | rgb_camera.color_format: RGB8 18 | rgb_camera.enable_auto_exposure: true 19 | enable_depth: true 20 | enable_infra: false 21 | enable_infra1: false 22 | enable_infra2: false 23 | depth_module.depth_profile: 0,0,0 24 | depth_module.depth_format: Z16 25 | depth_module.infra_profile: 0,0,0 26 | depth_module.infra_format: RGB8 27 | depth_module.infra1_format: Y8 28 | depth_module.infra2_format: Y8 29 | depth_module.exposure: 8500 30 | depth_module.gain: 16 31 | depth_module.hdr_enabled: false 32 | depth_module.enable_auto_exposure: true 33 | depth_module.exposure.1: 7500 34 | depth_module.gain.1: 16 35 | depth_module.exposure.2: 1 36 | depth_module.gain.2: 16 37 | enable_sync: false 38 | enable_rgbd: false 39 | enable_gyro: false 40 | enable_accel: false 41 | gyro_fps: 0 42 | accel_fps: 0 43 | unite_imu_method: 0 44 | clip_distance: -2. 45 | angular_velocity_cov: 0.01 46 | linear_accel_cov: 0.01 47 | diagnostics_period: 0.0 48 | publish_tf: true 49 | tf_publish_rate: 0.0 50 | pointcloud.enable: false 51 | pointcloud.stream_filter: 2 52 | pointcloud.stream_index_filter: 0 53 | pointcloud.ordered_pc: false 54 | pointcloud.allow_no_texture_points: false 55 | align_depth.enable: false 56 | colorizer.enable: false 57 | decimation_filter.enable: false 58 | spatial_filter.enable: false 59 | temporal_filter.enable: false 60 | disparity_filter.enable: false 61 | hole_filling_filter.enable: false 62 | hdr_merge.enable: false 63 | wait_for_device_timeout: -1. 64 | reconnect_timeout: 6. 65 | -------------------------------------------------------------------------------- /clearpath_sensors/config/luxonis_oakd.yaml: -------------------------------------------------------------------------------- 1 | luxonis_oakd: 2 | ros__parameters: 3 | camera: 4 | i_enable_imu: false 5 | i_enable_ir: false 6 | i_floodlight_brightness: 0 7 | i_ip: '' 8 | i_laser_dot_brightness: 100 9 | i_mx_id: '' 10 | i_nn_type: none 11 | i_pipeline_type: RGBD 12 | i_usb_speed: SUPER_PLUS 13 | i_usb_port_id: '' 14 | rgb: 15 | i_board_socket_id: 0 16 | i_fps: 30.0 17 | i_height: 720 18 | i_width: 1280 19 | i_max_q_size: 10 20 | stereo: 21 | i_fps: 30.0 22 | i_height: 720 23 | i_width: 1280 24 | use_sim_time: false 25 | -------------------------------------------------------------------------------- /clearpath_sensors/config/novatel_smart6.yaml: -------------------------------------------------------------------------------- 1 | nmea_navsat_driver: 2 | ros__parameters: 3 | port: "/dev/clearpath/gps" 4 | baud: 115200 5 | frame_id: "gps_0_link" 6 | useRMC: False -------------------------------------------------------------------------------- /clearpath_sensors/config/novatel_smart7.yaml: -------------------------------------------------------------------------------- 1 | nmea_navsat_driver: 2 | ros__parameters: 3 | port: "/dev/clearpath/gps" 4 | baud: 115200 5 | frame_id: "gps_0_link" 6 | useRMC: False -------------------------------------------------------------------------------- /clearpath_sensors/config/phidgets_spatial.yaml: -------------------------------------------------------------------------------- 1 | phidgets_spatial: 2 | ros__parameters: 3 | # Communication 4 | serial: -1 5 | hub_port: 0 6 | # ROS Message 7 | frame_id: imu_link 8 | publish_rate: 0.0 9 | # Timing 10 | time_resynchronization_interval_ms: 5000 11 | data_interval_ms: 20 12 | callback_delta_epsilon_ms: 1 13 | # Algorithm 14 | use_orientation: False 15 | spatial_algorithm: ahrs 16 | ahrs_angular_velocity_threshold: 1.0 17 | ahrs_angular_velocity_delta_threshold: 0.1 18 | ahrs_acceleration_threshold: 0.1 19 | ahrs_mag_time: 10.0 20 | ahrs_accel_time: 10.0 21 | ahrs_bias_time: 1.25 22 | 23 | -------------------------------------------------------------------------------- /clearpath_sensors/config/redshift_um7.yaml: -------------------------------------------------------------------------------- 1 | um7_driver: 2 | ros__parameters: 3 | port: /dev/clearpath/um7 4 | baud: 115200 5 | update_rate: 20 6 | mag_updates: true 7 | accel_updates: true 8 | zero_gyros: true 9 | frame_id: imu_0_link 10 | linear_acceleration_stdev: 0.0392266 11 | angular_velocity_stdev: 0.001047 12 | orientation_x_stdev: 0.052360 13 | orientation_y_stdev: 0.052360 14 | orientation_z_stdev: 0.052360 15 | tf_ned_to_enu: true 16 | orientation_in_robot_frame: false -------------------------------------------------------------------------------- /clearpath_sensors/config/sick_lms1xx.yaml: -------------------------------------------------------------------------------- 1 | lms1xx: 2 | ros__parameters: 3 | frame_id: laser_link 4 | host: 192.168.131.20 5 | port: 2111 6 | publish_min_range_as_inf: false -------------------------------------------------------------------------------- /clearpath_sensors/config/swiftnav_duro.yaml: -------------------------------------------------------------------------------- 1 | duro_node: 2 | ros__parameters: 3 | ip_address: "192.168.1.10" 4 | port: 55555 5 | gps_receiver_frame_id: "duro" 6 | imu_frame_id: "duro" 7 | utm_frame_id: "map" 8 | orientation_source: "gps" 9 | z_coord_ref_switch: "zero" 10 | z_coord_exact_height: 0.2 11 | euler_based_orientation: true -------------------------------------------------------------------------------- /clearpath_sensors/config/velodyne_lidar.yaml: -------------------------------------------------------------------------------- 1 | velodyne_transform_node: 2 | ros__parameters: 3 | calibration: /opt/ros/jazzy/share/velodyne_pointcloud/params/VLP16db.yaml 4 | max_range: 130.0 5 | min_range: 0.9 6 | organize_cloud: true 7 | view_direction: 0.0 8 | model: VLP16 9 | fixed_frame: velodyne 10 | target_frame: velodyne 11 | velodyne_driver_node: 12 | ros__parameters: 13 | device_ip: 192.168.131.25 14 | enabled: true 15 | frame_id: velodyne 16 | gps_time: false 17 | model: VLP16 18 | port: 2368 19 | read_fast: false 20 | read_once: false 21 | repeat_delay: 0.0 22 | rpm: 600.0 23 | time_offset: 0.0 24 | velodyne_laserscan_node: 25 | ros__parameters: 26 | resolution: 0.007 27 | ring: -1 28 | -------------------------------------------------------------------------------- /clearpath_sensors/config/wiferion.yaml: -------------------------------------------------------------------------------- 1 | wiferion: 2 | ros__parameters: 3 | canbus_dev: can0 4 | -------------------------------------------------------------------------------- /clearpath_sensors/debian/udev: -------------------------------------------------------------------------------- 1 | # Movidius Rules for Luxonis OAK-D Cameras 2 | SUBSYSTEM=="usb", ATTRS{idVendor}=="03e7", MODE="0666" 3 | -------------------------------------------------------------------------------- /clearpath_sensors/launch/axis_camera.launch.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | # 3 | # Software License Agreement (BSD) 4 | # 5 | # @author Chris Iverach-Brereton 6 | # @copyright (c) 2024, Clearpath Robotics, Inc., All rights reserved. 7 | # 8 | # Redistribution and use in source and binary forms, with or without 9 | # modification, are permitted provided that the following conditions are met: 10 | # * Redistributions of source code must retain the above copyright notice, 11 | # this list of conditions and the following disclaimer. 12 | # * Redistributions in binary form must reproduce the above copyright notice, 13 | # this list of conditions and the following disclaimer in the documentation 14 | # and/or other materials provided with the distribution. 15 | # * Neither the name of Clearpath Robotics nor the names of its contributors 16 | # may be used to endorse or promote products derived from this software 17 | # without specific prior written permission. 18 | # 19 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 20 | # AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 21 | # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 22 | # ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE 23 | # LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 24 | # CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 25 | # SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 26 | # INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 27 | # CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 28 | # ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 29 | # POSSIBILITY OF SUCH DAMAGE. 30 | from launch import LaunchDescription 31 | from launch.actions import DeclareLaunchArgument 32 | from launch.substitutions import LaunchConfiguration, PathJoinSubstitution 33 | 34 | from launch_ros.actions import Node 35 | from launch_ros.substitutions import FindPackageShare 36 | 37 | 38 | def generate_launch_description(): 39 | parameters = LaunchConfiguration('parameters') 40 | namespace = LaunchConfiguration('namespace') 41 | robot_namespace = LaunchConfiguration('robot_namespace') 42 | 43 | arg_namespace = DeclareLaunchArgument( 44 | 'namespace', 45 | default_value='') 46 | 47 | arg_robot_namespace = DeclareLaunchArgument( 48 | 'robot_namespace', 49 | default_value='') 50 | 51 | arg_parameters = DeclareLaunchArgument( 52 | 'parameters', 53 | default_value=PathJoinSubstitution([ 54 | FindPackageShare('clearpath_sensors'), 55 | 'config', 56 | 'axis_camera.yaml' 57 | ])) 58 | 59 | axis_node = Node( 60 | package='axis_camera', 61 | executable='axis_camera_node', 62 | name='axis_camera', 63 | namespace=namespace, 64 | parameters=[parameters], 65 | output='screen', 66 | remappings=[ 67 | ('image_raw/compressed', 'color/image/compressed'), 68 | ('camera_info', 'color/camera_info'), 69 | ('joint_states', 70 | PathJoinSubstitution(['/', robot_namespace, 'platform', 'joint_states'])), 71 | ] 72 | ) 73 | 74 | ld = LaunchDescription() 75 | ld.add_action(arg_namespace) 76 | ld.add_action(arg_parameters) 77 | ld.add_action(arg_robot_namespace) 78 | ld.add_action(axis_node) 79 | return ld 80 | -------------------------------------------------------------------------------- /clearpath_sensors/launch/chrobotics_um6.launch.py: -------------------------------------------------------------------------------- 1 | # Software License Agreement (BSD) 2 | # 3 | # @author Roni Kreinin 4 | # @copyright (c) 2023, Clearpath Robotics, Inc., All rights reserved. 5 | # 6 | # Redistribution and use in source and binary forms, with or without 7 | # modification, are permitted provided that the following conditions are met: 8 | # * Redistributions of source code must retain the above copyright notice, 9 | # this list of conditions and the following disclaimer. 10 | # * Redistributions in binary form must reproduce the above copyright notice, 11 | # this list of conditions and the following disclaimer in the documentation 12 | # and/or other materials provided with the distribution. 13 | # * Neither the name of Clearpath Robotics nor the names of its contributors 14 | # may be used to endorse or promote products derived from this software 15 | # without specific prior written permission. 16 | # 17 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 18 | # AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 19 | # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 20 | # ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE 21 | # LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 22 | # CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 23 | # SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 24 | # INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 25 | # CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 26 | # ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 27 | # POSSIBILITY OF SUCH DAMAGE. 28 | from launch import LaunchDescription 29 | from launch.actions import DeclareLaunchArgument 30 | from launch.substitutions import LaunchConfiguration, PathJoinSubstitution 31 | 32 | from launch_ros.actions import Node 33 | from launch_ros.substitutions import FindPackageShare 34 | 35 | 36 | def generate_launch_description(): 37 | parameters = LaunchConfiguration('parameters') 38 | namespace = LaunchConfiguration('namespace') 39 | 40 | arg_namespace = DeclareLaunchArgument( 41 | 'namespace', 42 | default_value='') 43 | 44 | arg_parameters = DeclareLaunchArgument( 45 | 'parameters', 46 | default_value=PathJoinSubstitution([ 47 | FindPackageShare('clearpath_sensors'), 48 | 'config', 49 | 'swiftnav_duro.yaml' 50 | ])) 51 | 52 | umx_driver_node = Node( 53 | package='umx_driver', 54 | namespace=namespace, 55 | executable='um6_driver', 56 | parameters=[parameters], 57 | output='screen', 58 | remappings=[ 59 | ('imu/data', 'data'), 60 | ('imu/mag', 'mag'), 61 | ('imu/rpy', 'rpy'), 62 | ('imu/temperature', 'temperature'), 63 | ] 64 | ) 65 | 66 | ld = LaunchDescription() 67 | ld.add_action(arg_namespace) 68 | ld.add_action(arg_parameters) 69 | ld.add_action(umx_driver_node) 70 | return ld 71 | -------------------------------------------------------------------------------- /clearpath_sensors/launch/garmin_18x.launch.py: -------------------------------------------------------------------------------- 1 | # Software License Agreement (BSD) 2 | # 3 | # @author Roni Kreinin 4 | # @copyright (c) 2023, Clearpath Robotics, Inc., All rights reserved. 5 | # 6 | # Redistribution and use in source and binary forms, with or without 7 | # modification, are permitted provided that the following conditions are met: 8 | # * Redistributions of source code must retain the above copyright notice, 9 | # this list of conditions and the following disclaimer. 10 | # * Redistributions in binary form must reproduce the above copyright notice, 11 | # this list of conditions and the following disclaimer in the documentation 12 | # and/or other materials provided with the distribution. 13 | # * Neither the name of Clearpath Robotics nor the names of its contributors 14 | # may be used to endorse or promote products derived from this software 15 | # without specific prior written permission. 16 | # 17 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 18 | # AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 19 | # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 20 | # ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE 21 | # LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 22 | # CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 23 | # SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 24 | # INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 25 | # CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 26 | # ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 27 | # POSSIBILITY OF SUCH DAMAGE. 28 | from launch import LaunchDescription 29 | from launch.actions import DeclareLaunchArgument 30 | from launch.substitutions import LaunchConfiguration, PathJoinSubstitution 31 | 32 | from launch_ros.actions import Node 33 | from launch_ros.substitutions import FindPackageShare 34 | 35 | 36 | def generate_launch_description(): 37 | parameters = LaunchConfiguration('parameters') 38 | namespace = LaunchConfiguration('namespace') 39 | 40 | arg_namespace = DeclareLaunchArgument( 41 | 'namespace', 42 | default_value='') 43 | 44 | arg_parameters = DeclareLaunchArgument( 45 | 'parameters', 46 | default_value=PathJoinSubstitution([ 47 | FindPackageShare('clearpath_sensors'), 48 | 'config', 49 | 'garmin_18x.yaml' 50 | ])) 51 | 52 | nmea_node = Node( 53 | package='nmea_navsat_driver', 54 | namespace=namespace, 55 | executable='nmea_serial_driver', 56 | parameters=[parameters], 57 | output='screen', 58 | ) 59 | 60 | ld = LaunchDescription() 61 | ld.add_action(arg_namespace) 62 | ld.add_action(arg_parameters) 63 | ld.add_action(nmea_node) 64 | return ld 65 | -------------------------------------------------------------------------------- /clearpath_sensors/launch/hokuyo_ust.launch.py: -------------------------------------------------------------------------------- 1 | # Software License Agreement (BSD) 2 | # 3 | # @author Roni Kreinin 4 | # @copyright (c) 2023, Clearpath Robotics, Inc., All rights reserved. 5 | # 6 | # Redistribution and use in source and binary forms, with or without 7 | # modification, are permitted provided that the following conditions are met: 8 | # * Redistributions of source code must retain the above copyright notice, 9 | # this list of conditions and the following disclaimer. 10 | # * Redistributions in binary form must reproduce the above copyright notice, 11 | # this list of conditions and the following disclaimer in the documentation 12 | # and/or other materials provided with the distribution. 13 | # * Neither the name of Clearpath Robotics nor the names of its contributors 14 | # may be used to endorse or promote products derived from this software 15 | # without specific prior written permission. 16 | # 17 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 18 | # AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 19 | # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 20 | # ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE 21 | # LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 22 | # CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 23 | # SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 24 | # INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 25 | # CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 26 | # ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 27 | # POSSIBILITY OF SUCH DAMAGE. 28 | from launch import LaunchDescription 29 | from launch.actions import DeclareLaunchArgument 30 | from launch.substitutions import LaunchConfiguration, PathJoinSubstitution 31 | 32 | from launch_ros.actions import Node 33 | from launch_ros.substitutions import FindPackageShare 34 | 35 | 36 | def generate_launch_description(): 37 | parameters = LaunchConfiguration('parameters') 38 | namespace = LaunchConfiguration('namespace') 39 | 40 | arg_namespace = DeclareLaunchArgument( 41 | 'namespace', 42 | default_value='') 43 | 44 | arg_parameters = DeclareLaunchArgument( 45 | 'parameters', 46 | default_value=PathJoinSubstitution([ 47 | FindPackageShare('clearpath_sensors'), 48 | 'config', 49 | 'hokuyo_ust.yaml' 50 | ])) 51 | 52 | urg_node = Node( 53 | package='urg_node', 54 | namespace=namespace, 55 | executable='urg_node_driver', 56 | parameters=[parameters], 57 | output='screen', 58 | remappings=[ 59 | ('/diagnostics', 'diagnostics') 60 | ], 61 | ) 62 | 63 | ld = LaunchDescription() 64 | ld.add_action(arg_namespace) 65 | ld.add_action(arg_parameters) 66 | ld.add_action(urg_node) 67 | return ld 68 | -------------------------------------------------------------------------------- /clearpath_sensors/launch/image_ffmpeg_to_raw.launch.py: -------------------------------------------------------------------------------- 1 | # Software License Agreement (BSD) 2 | # 3 | # @author Hilary Luo 4 | # @copyright (c) 2024, Clearpath Robotics, Inc., All rights reserved. 5 | # 6 | # Redistribution and use in source and binary forms, with or without 7 | # modification, are permitted provided that the following conditions are met: 8 | # * Redistributions of source code must retain the above copyright notice, 9 | # this list of conditions and the following disclaimer. 10 | # * Redistributions in binary form must reproduce the above copyright notice, 11 | # this list of conditions and the following disclaimer in the documentation 12 | # and/or other materials provided with the distribution. 13 | # * Neither the name of Clearpath Robotics nor the names of its contributors 14 | # may be used to endorse or promote products derived from this software 15 | # without specific prior written permission. 16 | # 17 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 18 | # AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 19 | # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 20 | # ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE 21 | # LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 22 | # CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 23 | # SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 24 | # INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 25 | # CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 26 | # ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 27 | # POSSIBILITY OF SUCH DAMAGE. 28 | 29 | from launch import LaunchDescription 30 | from launch.actions import DeclareLaunchArgument 31 | from launch.substitutions import LaunchConfiguration 32 | from launch_ros.actions import Node 33 | 34 | 35 | def generate_launch_description(): 36 | namespace = LaunchConfiguration('namespace') 37 | in_ffmpeg = LaunchConfiguration('in_ffmpeg') 38 | out_raw = LaunchConfiguration('out_raw') 39 | 40 | arg_namespace = DeclareLaunchArgument( 41 | 'namespace', 42 | default_value='' 43 | ) 44 | 45 | arg_in_ffmpeg = DeclareLaunchArgument( 46 | 'in_ffmpeg', 47 | default_value='ffmpeg' 48 | ) 49 | 50 | arg_out_raw = DeclareLaunchArgument( 51 | 'out_raw', 52 | default_value='image' 53 | ) 54 | 55 | ffmpeg_transport_node = Node( 56 | name='image_ffmpeg_to_raw', 57 | namespace=namespace, 58 | package='image_transport', 59 | executable='republish', 60 | remappings=[ 61 | ('in/ffmpeg', in_ffmpeg), 62 | ('out', out_raw), 63 | ], 64 | arguments=['ffmpeg', 'raw'], 65 | ) 66 | 67 | ld = LaunchDescription() 68 | ld.add_action(arg_namespace) 69 | ld.add_action(arg_in_ffmpeg) 70 | ld.add_action(arg_out_raw) 71 | ld.add_action(ffmpeg_transport_node) 72 | return ld 73 | -------------------------------------------------------------------------------- /clearpath_sensors/launch/image_raw_to_ffmpeg.launch.py: -------------------------------------------------------------------------------- 1 | # Software License Agreement (BSD) 2 | # 3 | # @author Hilary Luo 4 | # @copyright (c) 2024, Clearpath Robotics, Inc., All rights reserved. 5 | # 6 | # Redistribution and use in source and binary forms, with or without 7 | # modification, are permitted provided that the following conditions are met: 8 | # * Redistributions of source code must retain the above copyright notice, 9 | # this list of conditions and the following disclaimer. 10 | # * Redistributions in binary form must reproduce the above copyright notice, 11 | # this list of conditions and the following disclaimer in the documentation 12 | # and/or other materials provided with the distribution. 13 | # * Neither the name of Clearpath Robotics nor the names of its contributors 14 | # may be used to endorse or promote products derived from this software 15 | # without specific prior written permission. 16 | # 17 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 18 | # AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 19 | # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 20 | # ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE 21 | # LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 22 | # CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 23 | # SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 24 | # INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 25 | # CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 26 | # ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 27 | # POSSIBILITY OF SUCH DAMAGE. 28 | 29 | from launch import LaunchDescription 30 | from launch.actions import DeclareLaunchArgument 31 | from launch.substitutions import LaunchConfiguration 32 | from launch_ros.actions import Node 33 | 34 | 35 | ARGUMENTS = [ 36 | DeclareLaunchArgument('namespace', default_value=''), 37 | DeclareLaunchArgument('in_raw', default_value='image'), 38 | DeclareLaunchArgument('out_ffmpeg', default_value='ffmpeg'), 39 | DeclareLaunchArgument('encoding', default_value='libx264'), 40 | DeclareLaunchArgument('qmax', default_value='40'), 41 | DeclareLaunchArgument('preset', default_value='superfast'), 42 | DeclareLaunchArgument('tune', default_value='zerolatency'), 43 | DeclareLaunchArgument('bit_rate', default_value='1000000'), 44 | DeclareLaunchArgument('gop_size', default_value='15'), 45 | ] 46 | 47 | 48 | def generate_launch_description(): 49 | namespace = LaunchConfiguration('namespace') 50 | in_raw = LaunchConfiguration('in_raw') 51 | out_ffmpeg = LaunchConfiguration('out_ffmpeg') 52 | 53 | ffmpeg_transport_node = Node( 54 | name='image_raw_to_ffmpeg', 55 | namespace=namespace, 56 | package='image_transport', 57 | executable='republish', 58 | remappings=[ 59 | ('in', in_raw), 60 | ('out/ffmpeg', out_ffmpeg), 61 | ], 62 | arguments=['raw', 'ffmpeg'], 63 | parameters=[ 64 | {'ffmpeg_image_transport.encoding': LaunchConfiguration('encoding')}, 65 | {'ffmpeg_image_transport.qmax': LaunchConfiguration('qmax')}, 66 | {'ffmpeg_image_transport.preset': LaunchConfiguration('preset')}, 67 | {'ffmpeg_image_transport.tune': LaunchConfiguration('tune')}, 68 | {'ffmpeg_image_transport.bit_rate': LaunchConfiguration('bit_rate')}, 69 | {'ffmpeg_image_transport.gop_size': LaunchConfiguration('gop_size')}], 70 | ) 71 | 72 | ld = LaunchDescription(ARGUMENTS) 73 | ld.add_action(ffmpeg_transport_node) 74 | return ld 75 | -------------------------------------------------------------------------------- /clearpath_sensors/launch/microstrain_gq7.launch.py: -------------------------------------------------------------------------------- 1 | # Software License Agreement (BSD) 2 | # 3 | # @author Roni Kreinin 4 | # @copyright (c) 2023, Clearpath Robotics, Inc., All rights reserved. 5 | # 6 | # Redistribution and use in source and binary forms, with or without 7 | # modification, are permitted provided that the following conditions are met: 8 | # * Redistributions of source code must retain the above copyright notice, 9 | # this list of conditions and the following disclaimer. 10 | # * Redistributions in binary form must reproduce the above copyright notice, 11 | # this list of conditions and the following disclaimer in the documentation 12 | # and/or other materials provided with the distribution. 13 | # * Neither the name of Clearpath Robotics nor the names of its contributors 14 | # may be used to endorse or promote products derived from this software 15 | # without specific prior written permission. 16 | # 17 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 18 | # AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 19 | # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 20 | # ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE 21 | # LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 22 | # CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 23 | # SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 24 | # INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 25 | # CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 26 | # ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 27 | # POSSIBILITY OF SUCH DAMAGE. 28 | from launch import LaunchDescription 29 | from launch.actions import DeclareLaunchArgument, GroupAction, IncludeLaunchDescription 30 | from launch.launch_description_sources import PythonLaunchDescriptionSource 31 | from launch.substitutions import LaunchConfiguration, PathJoinSubstitution 32 | 33 | from launch_ros.actions import SetRemap 34 | from launch_ros.substitutions import FindPackageShare 35 | 36 | 37 | def generate_launch_description(): 38 | pkg_microstrain_inertial_driver = FindPackageShare('microstrain_inertial_driver') 39 | 40 | parameters = LaunchConfiguration('parameters') 41 | namespace = LaunchConfiguration('namespace') 42 | robot_namespace = LaunchConfiguration('robot_namespace') 43 | 44 | launch_microstrain_imu = PathJoinSubstitution([ 45 | pkg_microstrain_inertial_driver, 'launch', 'microstrain_launch.py']) 46 | 47 | arg_namespace = DeclareLaunchArgument( 48 | 'namespace', 49 | default_value='') 50 | 51 | arg_robot_namespace = DeclareLaunchArgument( 52 | 'robot_namespace', 53 | default_value='') 54 | 55 | arg_parameters = DeclareLaunchArgument( 56 | 'parameters', 57 | default_value=PathJoinSubstitution([ 58 | FindPackageShare('clearpath_sensors'), 59 | 'config', 60 | 'microstrain_gq7.yaml' 61 | ])) 62 | 63 | launch_microstrain_imu = GroupAction([ 64 | SetRemap('/tf', 'tf'), 65 | SetRemap('/tf_static', PathJoinSubstitution(['/', robot_namespace, 'tf_static'])), 66 | 67 | IncludeLaunchDescription( 68 | PythonLaunchDescriptionSource([launch_microstrain_imu]), 69 | launch_arguments=[ 70 | ('namespace', namespace), 71 | ('params_file', parameters), 72 | ('configure', 'true'), 73 | ('activate', 'true') 74 | ] 75 | ) 76 | ]) 77 | 78 | ld = LaunchDescription() 79 | ld.add_action(arg_namespace) 80 | ld.add_action(arg_robot_namespace) 81 | ld.add_action(arg_parameters) 82 | ld.add_action(launch_microstrain_imu) 83 | return ld 84 | -------------------------------------------------------------------------------- /clearpath_sensors/launch/novatel_smart6.launch.py: -------------------------------------------------------------------------------- 1 | # Software License Agreement (BSD) 2 | # 3 | # @author Roni Kreinin 4 | # @copyright (c) 2023, Clearpath Robotics, Inc., All rights reserved. 5 | # 6 | # Redistribution and use in source and binary forms, with or without 7 | # modification, are permitted provided that the following conditions are met: 8 | # * Redistributions of source code must retain the above copyright notice, 9 | # this list of conditions and the following disclaimer. 10 | # * Redistributions in binary form must reproduce the above copyright notice, 11 | # this list of conditions and the following disclaimer in the documentation 12 | # and/or other materials provided with the distribution. 13 | # * Neither the name of Clearpath Robotics nor the names of its contributors 14 | # may be used to endorse or promote products derived from this software 15 | # without specific prior written permission. 16 | # 17 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 18 | # AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 19 | # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 20 | # ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE 21 | # LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 22 | # CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 23 | # SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 24 | # INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 25 | # CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 26 | # ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 27 | # POSSIBILITY OF SUCH DAMAGE. 28 | from launch import LaunchDescription 29 | from launch.actions import DeclareLaunchArgument 30 | from launch.substitutions import LaunchConfiguration, PathJoinSubstitution 31 | 32 | from launch_ros.actions import Node 33 | from launch_ros.substitutions import FindPackageShare 34 | 35 | 36 | def generate_launch_description(): 37 | parameters = LaunchConfiguration('parameters') 38 | namespace = LaunchConfiguration('namespace') 39 | 40 | arg_namespace = DeclareLaunchArgument( 41 | 'namespace', 42 | default_value='') 43 | 44 | arg_parameters = DeclareLaunchArgument( 45 | 'parameters', 46 | default_value=PathJoinSubstitution([ 47 | FindPackageShare('clearpath_sensors'), 48 | 'config', 49 | 'novatel_smart6.yaml' 50 | ])) 51 | 52 | nmea_node = Node( 53 | package='nmea_navsat_driver', 54 | namespace=namespace, 55 | executable='nmea_serial_driver', 56 | parameters=[parameters], 57 | output='screen', 58 | ) 59 | 60 | ld = LaunchDescription() 61 | ld.add_action(arg_namespace) 62 | ld.add_action(arg_parameters) 63 | ld.add_action(nmea_node) 64 | return ld 65 | -------------------------------------------------------------------------------- /clearpath_sensors/launch/novatel_smart7.launch.py: -------------------------------------------------------------------------------- 1 | # Software License Agreement (BSD) 2 | # 3 | # @author Roni Kreinin 4 | # @copyright (c) 2023, Clearpath Robotics, Inc., All rights reserved. 5 | # 6 | # Redistribution and use in source and binary forms, with or without 7 | # modification, are permitted provided that the following conditions are met: 8 | # * Redistributions of source code must retain the above copyright notice, 9 | # this list of conditions and the following disclaimer. 10 | # * Redistributions in binary form must reproduce the above copyright notice, 11 | # this list of conditions and the following disclaimer in the documentation 12 | # and/or other materials provided with the distribution. 13 | # * Neither the name of Clearpath Robotics nor the names of its contributors 14 | # may be used to endorse or promote products derived from this software 15 | # without specific prior written permission. 16 | # 17 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 18 | # AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 19 | # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 20 | # ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE 21 | # LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 22 | # CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 23 | # SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 24 | # INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 25 | # CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 26 | # ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 27 | # POSSIBILITY OF SUCH DAMAGE. 28 | from launch import LaunchDescription 29 | from launch.actions import DeclareLaunchArgument 30 | from launch.substitutions import LaunchConfiguration, PathJoinSubstitution 31 | 32 | from launch_ros.actions import Node 33 | from launch_ros.substitutions import FindPackageShare 34 | 35 | 36 | def generate_launch_description(): 37 | parameters = LaunchConfiguration('parameters') 38 | namespace = LaunchConfiguration('namespace') 39 | 40 | arg_namespace = DeclareLaunchArgument( 41 | 'namespace', 42 | default_value='') 43 | 44 | arg_parameters = DeclareLaunchArgument( 45 | 'parameters', 46 | default_value=PathJoinSubstitution([ 47 | FindPackageShare('clearpath_sensors'), 48 | 'config', 49 | 'novatel_smart7.yaml' 50 | ])) 51 | 52 | nmea_node = Node( 53 | package='nmea_navsat_driver', 54 | namespace=namespace, 55 | executable='nmea_serial_driver', 56 | parameters=[parameters], 57 | output='screen', 58 | ) 59 | 60 | ld = LaunchDescription() 61 | ld.add_action(arg_namespace) 62 | ld.add_action(arg_parameters) 63 | ld.add_action(nmea_node) 64 | return ld 65 | -------------------------------------------------------------------------------- /clearpath_sensors/launch/phidgets_spatial.launch.py: -------------------------------------------------------------------------------- 1 | # Software License Agreement (BSD) 2 | # 3 | # @author Luis Camero 4 | # @copyright (c) 2024, Clearpath Robotics, Inc., All rights reserved. 5 | # 6 | # Redistribution and use in source and binary forms, with or without 7 | # modification, are permitted provided that the following conditions are met: 8 | # * Redistributions of source code must retain the above copyright notice, 9 | # this list of conditions and the following disclaimer. 10 | # * Redistributions in binary form must reproduce the above copyright notice, 11 | # this list of conditions and the following disclaimer in the documentation 12 | # and/or other materials provided with the distribution. 13 | # * Neither the name of Clearpath Robotics nor the names of its contributors 14 | # may be used to endorse or promote products derived from this software 15 | # without specific prior written permission. 16 | # 17 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 18 | # AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 19 | # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 20 | # ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE 21 | # LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 22 | # CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 23 | # SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 24 | # INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 25 | # CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 26 | # ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 27 | # POSSIBILITY OF SUCH DAMAGE. 28 | from launch import LaunchDescription 29 | from launch.actions import DeclareLaunchArgument 30 | from launch.substitutions import LaunchConfiguration, PathJoinSubstitution 31 | 32 | from launch_ros.actions import ComposableNodeContainer 33 | from launch_ros.descriptions import ComposableNode 34 | from launch_ros.substitutions import FindPackageShare 35 | 36 | 37 | def generate_launch_description(): 38 | parameters = LaunchConfiguration('parameters') 39 | namespace = LaunchConfiguration('namespace') 40 | 41 | arg_namespace = DeclareLaunchArgument( 42 | 'namespace', 43 | default_value='') 44 | 45 | arg_parameters = DeclareLaunchArgument( 46 | 'parameters', 47 | default_value=PathJoinSubstitution([ 48 | FindPackageShare('clearpath_sensors'), 49 | 'config', 50 | 'phidgets_spatial.yaml' 51 | ])) 52 | 53 | phidgets_node = ComposableNode( 54 | package='phidgets_spatial', 55 | plugin='phidgets::SpatialRosI', 56 | name='phidgets_spatial', 57 | namespace=namespace, 58 | parameters=[parameters], 59 | remappings=[ 60 | ('imu/data_raw', 'data_raw'), 61 | ('imu/mag', 'mag'), 62 | ('imu/is_calibrated', 'is_calibrated') 63 | ] 64 | ) 65 | 66 | imu_filter_container = ComposableNodeContainer( 67 | name='imu_filter_container', 68 | namespace=namespace, 69 | package='rclcpp_components', 70 | executable='component_container', 71 | composable_node_descriptions=[ 72 | phidgets_node, 73 | ], 74 | output='screen', 75 | ) 76 | 77 | ld = LaunchDescription() 78 | ld.add_action(arg_namespace) 79 | ld.add_action(arg_parameters) 80 | ld.add_action(imu_filter_container) 81 | return ld 82 | -------------------------------------------------------------------------------- /clearpath_sensors/launch/redshift_um7.launch.py: -------------------------------------------------------------------------------- 1 | # Software License Agreement (BSD) 2 | # 3 | # @author Roni Kreinin 4 | # @copyright (c) 2023, Clearpath Robotics, Inc., All rights reserved. 5 | # 6 | # Redistribution and use in source and binary forms, with or without 7 | # modification, are permitted provided that the following conditions are met: 8 | # * Redistributions of source code must retain the above copyright notice, 9 | # this list of conditions and the following disclaimer. 10 | # * Redistributions in binary form must reproduce the above copyright notice, 11 | # this list of conditions and the following disclaimer in the documentation 12 | # and/or other materials provided with the distribution. 13 | # * Neither the name of Clearpath Robotics nor the names of its contributors 14 | # may be used to endorse or promote products derived from this software 15 | # without specific prior written permission. 16 | # 17 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 18 | # AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 19 | # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 20 | # ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE 21 | # LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 22 | # CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 23 | # SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 24 | # INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 25 | # CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 26 | # ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 27 | # POSSIBILITY OF SUCH DAMAGE. 28 | from launch import LaunchDescription 29 | from launch.actions import DeclareLaunchArgument 30 | from launch.substitutions import LaunchConfiguration, PathJoinSubstitution 31 | 32 | from launch_ros.actions import Node 33 | from launch_ros.substitutions import FindPackageShare 34 | 35 | 36 | def generate_launch_description(): 37 | parameters = LaunchConfiguration('parameters') 38 | namespace = LaunchConfiguration('namespace') 39 | 40 | arg_namespace = DeclareLaunchArgument( 41 | 'namespace', 42 | default_value='') 43 | 44 | arg_parameters = DeclareLaunchArgument( 45 | 'parameters', 46 | default_value=PathJoinSubstitution([ 47 | FindPackageShare('clearpath_sensors'), 48 | 'config', 49 | 'swiftnav_duro.yaml' 50 | ])) 51 | 52 | umx_driver_node = Node( 53 | package='umx_driver', 54 | namespace=namespace, 55 | executable='um7_driver', 56 | parameters=[parameters], 57 | output='screen', 58 | remappings=[ 59 | ('imu/data', 'data'), 60 | ('imu/mag', 'mag'), 61 | ('imu/rpy', 'rpy'), 62 | ('imu/temperature', 'temperature'), 63 | ] 64 | ) 65 | 66 | ld = LaunchDescription() 67 | ld.add_action(arg_namespace) 68 | ld.add_action(arg_parameters) 69 | ld.add_action(umx_driver_node) 70 | return ld 71 | -------------------------------------------------------------------------------- /clearpath_sensors/launch/sick_lms1xx.launch.py: -------------------------------------------------------------------------------- 1 | # Software License Agreement (BSD) 2 | # 3 | # @author Roni Kreinin 4 | # @copyright (c) 2023, Clearpath Robotics, Inc., All rights reserved. 5 | # 6 | # Redistribution and use in source and binary forms, with or without 7 | # modification, are permitted provided that the following conditions are met: 8 | # * Redistributions of source code must retain the above copyright notice, 9 | # this list of conditions and the following disclaimer. 10 | # * Redistributions in binary form must reproduce the above copyright notice, 11 | # this list of conditions and the following disclaimer in the documentation 12 | # and/or other materials provided with the distribution. 13 | # * Neither the name of Clearpath Robotics nor the names of its contributors 14 | # may be used to endorse or promote products derived from this software 15 | # without specific prior written permission. 16 | # 17 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 18 | # AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 19 | # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 20 | # ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE 21 | # LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 22 | # CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 23 | # SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 24 | # INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 25 | # CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 26 | # ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 27 | # POSSIBILITY OF SUCH DAMAGE. 28 | from launch import LaunchDescription 29 | from launch.actions import DeclareLaunchArgument 30 | from launch.substitutions import LaunchConfiguration, PathJoinSubstitution 31 | 32 | from launch_ros.actions import Node 33 | from launch_ros.substitutions import FindPackageShare 34 | 35 | 36 | def generate_launch_description(): 37 | parameters = LaunchConfiguration('parameters') 38 | namespace = LaunchConfiguration('namespace') 39 | 40 | arg_namespace = DeclareLaunchArgument( 41 | 'namespace', 42 | default_value='') 43 | 44 | arg_parameters = DeclareLaunchArgument( 45 | 'parameters', 46 | default_value=PathJoinSubstitution([ 47 | FindPackageShare('clearpath_sensors'), 48 | 'config', 49 | 'sick_lms1xx.yaml' 50 | ])) 51 | 52 | sick_scan_node = Node( 53 | package='lms1xx', 54 | name='lms1xx', 55 | namespace=namespace, 56 | executable='lms1xx', 57 | parameters=[parameters], 58 | output='screen', 59 | ) 60 | 61 | ld = LaunchDescription() 62 | ld.add_action(arg_namespace) 63 | ld.add_action(arg_parameters) 64 | ld.add_action(sick_scan_node) 65 | return ld 66 | -------------------------------------------------------------------------------- /clearpath_sensors/launch/swiftnav_duro.launch.py: -------------------------------------------------------------------------------- 1 | # Software License Agreement (BSD) 2 | # 3 | # @author Roni Kreinin 4 | # @copyright (c) 2023, Clearpath Robotics, Inc., All rights reserved. 5 | # 6 | # Redistribution and use in source and binary forms, with or without 7 | # modification, are permitted provided that the following conditions are met: 8 | # * Redistributions of source code must retain the above copyright notice, 9 | # this list of conditions and the following disclaimer. 10 | # * Redistributions in binary form must reproduce the above copyright notice, 11 | # this list of conditions and the following disclaimer in the documentation 12 | # and/or other materials provided with the distribution. 13 | # * Neither the name of Clearpath Robotics nor the names of its contributors 14 | # may be used to endorse or promote products derived from this software 15 | # without specific prior written permission. 16 | # 17 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 18 | # AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 19 | # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 20 | # ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE 21 | # LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 22 | # CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 23 | # SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 24 | # INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 25 | # CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 26 | # ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 27 | # POSSIBILITY OF SUCH DAMAGE. 28 | from launch import LaunchDescription 29 | from launch.actions import DeclareLaunchArgument 30 | from launch.substitutions import LaunchConfiguration, PathJoinSubstitution 31 | 32 | from launch_ros.actions import Node 33 | from launch_ros.substitutions import FindPackageShare 34 | 35 | 36 | def generate_launch_description(): 37 | parameters = LaunchConfiguration('parameters') 38 | namespace = LaunchConfiguration('namespace') 39 | 40 | arg_namespace = DeclareLaunchArgument( 41 | 'namespace', 42 | default_value='') 43 | 44 | arg_parameters = DeclareLaunchArgument( 45 | 'parameters', 46 | default_value=PathJoinSubstitution([ 47 | FindPackageShare('clearpath_sensors'), 48 | 'config', 49 | 'swiftnav_duro.yaml' 50 | ])) 51 | 52 | duro_node = Node( 53 | package='duro_gps_driver', 54 | namespace=namespace, 55 | executable='duro_node', 56 | parameters=[parameters], 57 | output='screen', 58 | remappings=[ 59 | ('/tf', 'tf'), 60 | ('/tf_static', 'tf_static'), 61 | ('navsatfix', 'fix'), 62 | ] 63 | ) 64 | 65 | ld = LaunchDescription() 66 | ld.add_action(arg_namespace) 67 | ld.add_action(arg_parameters) 68 | ld.add_action(duro_node) 69 | return ld 70 | -------------------------------------------------------------------------------- /clearpath_sensors/launch/wiferion.launch.py: -------------------------------------------------------------------------------- 1 | # Software License Agreement (BSD) 2 | # 3 | # @author Luis Camero 4 | # @copyright (c) 2025, Clearpath Robotics, Inc., All rights reserved. 5 | # 6 | # Redistribution and use in source and binary forms, with or without 7 | # modification, are permitted provided that the following conditions are met: 8 | # * Redistributions of source code must retain the above copyright notice, 9 | # this list of conditions and the following disclaimer. 10 | # * Redistributions in binary form must reproduce the above copyright notice, 11 | # this list of conditions and the following disclaimer in the documentation 12 | # and/or other materials provided with the distribution. 13 | # * Neither the name of Clearpath Robotics nor the names of its contributors 14 | # may be used to endorse or promote products derived from this software 15 | # without specific prior written permission. 16 | # 17 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 18 | # AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 19 | # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 20 | # ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE 21 | # LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 22 | # CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 23 | # SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 24 | # INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 25 | # CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 26 | # ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 27 | # POSSIBILITY OF SUCH DAMAGE. 28 | from launch import LaunchDescription 29 | from launch.actions import DeclareLaunchArgument 30 | from launch.substitutions import LaunchConfiguration, PathJoinSubstitution 31 | 32 | from launch_ros.actions import Node 33 | from launch_ros.substitutions import FindPackageShare 34 | 35 | 36 | def generate_launch_description(): 37 | parameters = LaunchConfiguration('parameters') 38 | namespace = LaunchConfiguration('namespace') 39 | 40 | arg_namespace = DeclareLaunchArgument( 41 | 'namespace', 42 | default_value='') 43 | 44 | arg_parameters = DeclareLaunchArgument( 45 | 'parameters', 46 | default_value=PathJoinSubstitution([ 47 | FindPackageShare('clearpath_sensors'), 48 | 'config', 49 | 'wiferion.yaml' 50 | ])) 51 | 52 | wiferion_node = Node( 53 | name='wiferion', 54 | package='wiferion_charger', 55 | namespace=namespace, 56 | executable='wiferion_node', 57 | parameters=[parameters], 58 | output='screen', 59 | ) 60 | 61 | ld = LaunchDescription() 62 | ld.add_action(arg_namespace) 63 | ld.add_action(arg_parameters) 64 | ld.add_action(wiferion_node) 65 | return ld 66 | -------------------------------------------------------------------------------- /clearpath_sensors/package.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | clearpath_sensors 5 | 2.5.0 6 | Clearpath sensor default launch files and configurations 7 | 8 | Luis Camero 9 | Roni Kreinin 10 | Tony Baltovski 11 | 12 | BSD 13 | 14 | Roni Kreinin 15 | 16 | ament_cmake 17 | 18 | depthai_ros_driver 19 | ffmpeg_image_transport 20 | flir_camera_description 21 | flir_camera_msgs 22 | image_proc 23 | image_transport_plugins 24 | microstrain_inertial_driver 25 | nmea_navsat_driver 26 | ouster_ros 27 | phidgets_spatial 28 | realsense2_camera 29 | spinnaker_camera_driver 30 | umx_driver 31 | urg_node 32 | velodyne_driver 33 | velodyne_pointcloud 34 | velodyne_laserscan 35 | wiferion_charger 36 | 37 | 44 | 45 | ament_lint_auto 46 | ament_lint_common 47 | 48 | 49 | ament_cmake 50 | 51 | 52 | -------------------------------------------------------------------------------- /clearpath_tests/README.md: -------------------------------------------------------------------------------- 1 | # Clearpath Tests 2 | 3 | This package contains tests for validating hardware & software performance of supported 4 | Clearpath Robotics' platforms. 5 | 6 | ## Usage 7 | 8 | To run the tests, SSH into the robot and run 9 | 10 | ```bash 11 | ros2 run clearpath_tests all_tests 12 | ``` 13 | 14 | If your `setup_path` is _not_ `/etc/clearpath`, specify the correct path with 15 | 16 | ```bash 17 | ros2 run clearpath_tests all_tests --ros-args -p setup_path:=/path/to/setup_dir 18 | ``` 19 | 20 | ## Pre-test preparation 21 | 22 | Tests require that the robot be mobile; ensure that the robot can travel 5m in a straight line 23 | and perform two complete on-the-spot rotations without colliding with anything, pulling cables, 24 | etc.... 25 | 26 | ## Output 27 | 28 | The summary of test results is printed to `stdout`, but the full test report will be saved to 29 | `/tmp/clearpath_test_results.YYYYMMDDhhmm.md`. 30 | 31 | Markdown (`.md`) files can be opened in any normal text editor, or can be renders with a 32 | [markdown viewer plugin](https://github.com/simov/markdown-viewer) for Chrome or Firefox. -------------------------------------------------------------------------------- /clearpath_tests/clearpath_tests/__init__.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | # Software License Agreement (BSD) 3 | # 4 | # @author Chris Iverach-Brereton 5 | # @copyright (c) 2025, Clearpath Robotics, Inc., All rights reserved. 6 | # 7 | # Redistribution and use in source and binary forms, with or without 8 | # modification, are permitted provided that the following conditions are met: 9 | # * Redistributions of source code must retain the above copyright notice, 10 | # this list of conditions and the following disclaimer. 11 | # * Redistributions in binary form must reproduce the above copyright notice, 12 | # this list of conditions and the following disclaimer in the documentation 13 | # and/or other materials provided with the distribution. 14 | # * Neither the name of Clearpath Robotics nor the names of its contributors 15 | # may be used to endorse or promote products derived from this software 16 | # without specific prior written permission. 17 | # 18 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 19 | # AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 20 | # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 21 | # ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE 22 | # LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 23 | # CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 24 | # SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 25 | # INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 26 | # CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 27 | # ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 28 | # POSSIBILITY OF SUCH DAMAGE. 29 | -------------------------------------------------------------------------------- /clearpath_tests/launch/production_tests.launch.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | # Software License Agreement (BSD) 3 | # 4 | # @author Chris Iverach-Brereton 5 | # @copyright (c) 2025, Clearpath Robotics, Inc., All rights reserved. 6 | # 7 | # Redistribution and use in source and binary forms, with or without 8 | # modification, are permitted provided that the following conditions are met: 9 | # * Redistributions of source code must retain the above copyright notice, 10 | # this list of conditions and the following disclaimer. 11 | # * Redistributions in binary form must reproduce the above copyright notice, 12 | # this list of conditions and the following disclaimer in the documentation 13 | # and/or other materials provided with the distribution. 14 | # * Neither the name of Clearpath Robotics nor the names of its contributors 15 | # may be used to endorse or promote products derived from this software 16 | # without specific prior written permission. 17 | # 18 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 19 | # AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 20 | # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 21 | # ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE 22 | # LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 23 | # CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 24 | # SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 25 | # INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 26 | # CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 27 | # ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 28 | # POSSIBILITY OF SUCH DAMAGE. 29 | 30 | from clearpath_config.clearpath_config import ClearpathConfig 31 | from clearpath_config.common.utils.yaml import read_yaml 32 | 33 | from launch import LaunchDescription 34 | from launch.actions import ( 35 | DeclareLaunchArgument, 36 | OpaqueFunction, 37 | ) 38 | from launch.substitutions import LaunchConfiguration, PathJoinSubstitution 39 | 40 | from launch_ros.actions import Node 41 | 42 | ARGUMENTS = [ 43 | DeclareLaunchArgument( 44 | 'setup_path', 45 | default_value='/etc/clearpath/', 46 | description='Clearpath setup path', 47 | ) 48 | ] 49 | 50 | 51 | def launch_setup(context, *args, **kwargs): 52 | setup_path = LaunchConfiguration('setup_path') 53 | 54 | robot_yaml = PathJoinSubstitution( 55 | [setup_path, 'robot.yaml'] 56 | ) 57 | 58 | # Read robot YAML 59 | config = read_yaml(robot_yaml.perform(context)) 60 | # Parse robot YAML into config 61 | clearpath_config = ClearpathConfig(config) 62 | 63 | namespace = clearpath_config.system.namespace 64 | test_node = Node( 65 | namespace=namespace, 66 | package='clearpath_tests', 67 | executable='all_tests', 68 | output='screen', 69 | emulate_tty=True, 70 | ) 71 | 72 | return [test_node] 73 | 74 | 75 | def generate_launch_description(): 76 | ld = LaunchDescription(ARGUMENTS) 77 | ld.add_action(OpaqueFunction(function=launch_setup)) 78 | return ld 79 | -------------------------------------------------------------------------------- /clearpath_tests/package.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | clearpath_tests 5 | 2.5.0 6 | Clearpath Tests 7 | Tony Baltovski 8 | BSD 9 | 10 | can-utils 11 | clearpath_config 12 | clearpath_generator_common 13 | clearpath_motor_msgs 14 | clearpath_platform_msgs 15 | diagnostic_msgs 16 | geometry_msgs 17 | nav_msgs 18 | rclpy 19 | sensor_msgs 20 | simple_term_menu_vendor 21 | std_msgs 22 | stress 23 | tf2_geometry_msgs 24 | tf2_msgs 25 | tf_transformations 26 | wireless_msgs 27 | 28 | ament_lint_auto 29 | ament_lint_common 30 | 31 | 32 | ament_python 33 | 34 | 35 | -------------------------------------------------------------------------------- /clearpath_tests/resource/clearpath_tests: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/clearpathrobotics/clearpath_robot/0ba339e643a8e1d86902dc01249bdc2132dbbc71/clearpath_tests/resource/clearpath_tests -------------------------------------------------------------------------------- /clearpath_tests/setup.cfg: -------------------------------------------------------------------------------- 1 | [develop] 2 | script_dir=$base/lib/clearpath_tests 3 | [install] 4 | install_scripts=$base/lib/clearpath_tests 5 | -------------------------------------------------------------------------------- /clearpath_tests/setup.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | # Software License Agreement (BSD) 3 | # 4 | # @author Chris Iverach-Brereton 5 | # @copyright (c) 2025, Clearpath Robotics, Inc., All rights reserved. 6 | # 7 | # Redistribution and use in source and binary forms, with or without 8 | # modification, are permitted provided that the following conditions are met: 9 | # * Redistributions of source code must retain the above copyright notice, 10 | # this list of conditions and the following disclaimer. 11 | # * Redistributions in binary form must reproduce the above copyright notice, 12 | # this list of conditions and the following disclaimer in the documentation 13 | # and/or other materials provided with the distribution. 14 | # * Neither the name of Clearpath Robotics nor the names of its contributors 15 | # may be used to endorse or promote products derived from this software 16 | # without specific prior written permission. 17 | # 18 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 19 | # AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 20 | # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 21 | # ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE 22 | # LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 23 | # CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 24 | # SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 25 | # INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 26 | # CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 27 | # ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 28 | # POSSIBILITY OF SUCH DAMAGE. 29 | from glob import glob 30 | import os 31 | 32 | from setuptools import find_packages, setup 33 | 34 | package_name = 'clearpath_tests' 35 | 36 | setup( 37 | name=package_name, 38 | version='2.5.0', 39 | packages=find_packages(exclude=['test']), 40 | data_files=[ 41 | ('share/ament_index/resource_index/packages', 42 | ['resource/' + package_name]), 43 | (os.path.join('share', package_name), ['package.xml']), 44 | (os.path.join('share', package_name, 'launch'), glob( 45 | os.path.join('launch', '*.launch.py'))), 46 | (os.path.join('share', package_name, 'config'), glob(os.path.join('config', '*.yaml'))), 47 | ], 48 | install_requires=['setuptools'], 49 | zip_safe=True, 50 | maintainer='Chris Iverach-Brereton', 51 | maintainer_email='civerachb@clearpathrobotics.com', 52 | description='Testing scripts for Clearpath robots', 53 | license='BSD', 54 | tests_require=['pytest'], 55 | entry_points={ 56 | 'console_scripts': [ 57 | 'all_tests = clearpath_tests.all_tests:main', 58 | ], 59 | }, 60 | ) 61 | -------------------------------------------------------------------------------- /clearpath_tests/test/test_copyright.py: -------------------------------------------------------------------------------- 1 | # Copyright 2015 Open Source Robotics Foundation, Inc. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | from ament_copyright.main import main 16 | import pytest 17 | 18 | 19 | # Remove the `skip` decorator once the source file(s) have a copyright header 20 | @pytest.mark.skip(reason='No copyright header has been placed in the generated source file.') 21 | @pytest.mark.copyright 22 | @pytest.mark.linter 23 | def test_copyright(): 24 | rc = main(argv=['.', 'test']) 25 | assert rc == 0, 'Found errors' 26 | -------------------------------------------------------------------------------- /clearpath_tests/test/test_flake8.py: -------------------------------------------------------------------------------- 1 | # Copyright 2017 Open Source Robotics Foundation, Inc. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | from ament_flake8.main import main_with_errors 16 | import pytest 17 | 18 | 19 | @pytest.mark.flake8 20 | @pytest.mark.linter 21 | def test_flake8(): 22 | rc, errors = main_with_errors(argv=[]) 23 | assert rc == 0, \ 24 | 'Found %d code style errors / warnings:\n' % len(errors) + \ 25 | '\n'.join(errors) 26 | -------------------------------------------------------------------------------- /clearpath_tests/test/test_pep257.py: -------------------------------------------------------------------------------- 1 | # Copyright 2015 Open Source Robotics Foundation, Inc. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | from ament_pep257.main import main 16 | import pytest 17 | 18 | 19 | @pytest.mark.linter 20 | @pytest.mark.pep257 21 | def test_pep257(): 22 | rc = main(argv=['.', 'test']) 23 | assert rc == 0, 'Found code style errors / warnings' 24 | -------------------------------------------------------------------------------- /dependencies.repos: -------------------------------------------------------------------------------- 1 | repositories: 2 | clearpath_config: 3 | type: git 4 | url: https://github.com/clearpathrobotics/clearpath_config.git 5 | version: jazzy 6 | clearpath_common: 7 | type: git 8 | url: https://github.com/clearpathrobotics/clearpath_common.git 9 | version: jazzy 10 | clearpath_msgs: 11 | type: git 12 | url: https://github.com/clearpathrobotics/clearpath_msgs.git 13 | version: jazzy 14 | clearpath_ros2_socketcan_interface: 15 | type: git 16 | url: https://github.com/clearpathrobotics/clearpath_ros2_socketcan_interface.git 17 | version: jazzy 18 | --------------------------------------------------------------------------------