diff --git a/clearpath_sensors/config/phidgets_spatial.yaml b/clearpath_sensors/config/phidgets_spatial.yaml new file mode 100644 index 0000000..4132b89 --- /dev/null +++ b/clearpath_sensors/config/phidgets_spatial.yaml @@ -0,0 +1,22 @@ +phidgets_spatial: + ros__parameters: + # Communication + serial: -1 + hub_port: 0 + # ROS Message + frame_id: imu_link + publish_rate: 0.0 + # Timing + time_resynchronization_interval_ms: 5000 + data_interval_ms: 20 + callback_delta_epsilon_ms: 1 + # Algorithm + use_orientation: False + spatial_algorithm: ahrs + ahrs_angular_velocity_threshold: 1.0 + ahrs_angular_velocity_delta_threshold: 0.1 + ahrs_acceleration_threshold: 0.1 + ahrs_mag_time: 10.0 + ahrs_accel_time: 10.0 + ahrs_bias_time: 1.25 + diff --git a/clearpath_sensors/launch/phidgets_spatial.launch.py b/clearpath_sensors/launch/phidgets_spatial.launch.py new file mode 100644 index 0000000..9342876 --- /dev/null +++ b/clearpath_sensors/launch/phidgets_spatial.launch.py @@ -0,0 +1,76 @@ +# Software License Agreement (BSD) +# +# @author Luis Camero +# @copyright (c) 2024, Clearpath Robotics, Inc., All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions are met: +# * Redistributions of source code must retain the above copyright notice, +# this list of conditions and the following disclaimer. +# * Redistributions in binary form must reproduce the above copyright notice, +# this list of conditions and the following disclaimer in the documentation +# and/or other materials provided with the distribution. +# * Neither the name of Clearpath Robotics nor the names of its contributors +# may be used to endorse or promote products derived from this software +# without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE +# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +# POSSIBILITY OF SUCH DAMAGE. +from launch import LaunchDescription +from launch.actions import DeclareLaunchArgument +from launch.substitutions import LaunchConfiguration, PathJoinSubstitution + +from launch_ros.actions import ComposableNodeContainer +from launch_ros.descriptions import ComposableNode +from launch_ros.substitutions import FindPackageShare + + +def generate_launch_description(): + parameters = LaunchConfiguration('parameters') + namespace = LaunchConfiguration('namespace') + + arg_namespace = DeclareLaunchArgument( + 'namespace', + default_value='') + + arg_parameters = DeclareLaunchArgument( + 'parameters', + default_value=PathJoinSubstitution([ + FindPackageShare('clearpath_sensors'), + 'config', + 'phidgets_spatial.yaml' + ])) + + phidgets_node = ComposableNode( + package='phidgets_spatial', + plugin='phidgets::SpatialRosI', + name='phidgets_spatial', + namespace=namespace, + parameters=[parameters] + ) + + imu_processing_container = ComposableNodeContainer( + name='imu_processing_container', + namespace=namespace, + package='rclcpp_components', + executable='component_container', + composable_node_descriptions=[ + phidgets_node, + ], + output='screen', + ) + + ld = LaunchDescription() + ld.add_action(arg_namespace) + ld.add_action(arg_parameters) + ld.add_action(imu_processing_container) + return ld diff --git a/clearpath_sensors/package.xml b/clearpath_sensors/package.xml index ceae9ef..2657e38 100644 --- a/clearpath_sensors/package.xml +++ b/clearpath_sensors/package.xml @@ -21,6 +21,7 @@ image_transport_plugins microstrain_inertial_driver nmea_navsat_driver + phidgets_spatial realsense2_camera spinnaker_camera_driver umx_driver