Skip to content

Commit

Permalink
Add phidgets spatial (#91)
Browse files Browse the repository at this point in the history
* Add phidget spatial config and launch files

* Add dependency

* Double to single quotes
  • Loading branch information
luis-camero authored Oct 4, 2024
1 parent f0c2af2 commit ed1f659
Show file tree
Hide file tree
Showing 3 changed files with 99 additions and 0 deletions.
22 changes: 22 additions & 0 deletions clearpath_sensors/config/phidgets_spatial.yaml
Original file line number Diff line number Diff line change
@@ -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

76 changes: 76 additions & 0 deletions clearpath_sensors/launch/phidgets_spatial.launch.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
# Software License Agreement (BSD)
#
# @author Luis Camero <lcamero@clearpathrobotics.com>
# @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
1 change: 1 addition & 0 deletions clearpath_sensors/package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
<exec_depend>image_transport_plugins</exec_depend>
<exec_depend>microstrain_inertial_driver</exec_depend>
<exec_depend>nmea_navsat_driver</exec_depend>
<exec_depend>phidgets_spatial</exec_depend>
<exec_depend>realsense2_camera</exec_depend>
<exec_depend>spinnaker_camera_driver</exec_depend>
<exec_depend>umx_driver</exec_depend>
Expand Down

0 comments on commit ed1f659

Please sign in to comment.