Skip to content

Commit

Permalink
Add config and launch for inventus
Browse files Browse the repository at this point in the history
  • Loading branch information
luis-camero committed Jan 22, 2025
1 parent de9fd65 commit a920aac
Show file tree
Hide file tree
Showing 3 changed files with 85 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -187,10 +187,11 @@ def __init__(self, setup_path: str = '/etc/clearpath/') -> None:
elif (self.clearpath_config.platform.battery.model in
[BatteryConfig.S_24V20_U1]):

pkg_inventus_bmu = Package('inventus_bmu')
launch_args = self.clearpath_config.platform.battery.launch_args

inventus_bmu_params_file = ParamFile('default', package=pkg_inventus_bmu)
inventus_bmu_params_file = ParamFile(
'inventus_bmu',
package=self.pkg_clearpath_sensors)
inventus_bmu_params = inventus_bmu_params_file.full_path

module_ids = []
Expand Down
12 changes: 12 additions & 0 deletions clearpath_sensors/config/inventus_bmu.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
inventus_bmu_node:
ros__parameters:
can_device: can0
eds_file: Enhanced_7623-301-Inventus-Power-Battery-ATSAMC21J18A-RevB2-02-02092022.eds
module_ids: [49, 50]

# List of module IDs that are connected in series in string format
# Each series is in parallel with each other
# Top level list is parallel, nested lists are series
# This is used to calculate the total output voltage & current
module_series: '[[49, 50]]'

70 changes: 70 additions & 0 deletions clearpath_sensors/launch/inventus_bmu.launch.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
# Software License Agreement (BSD)
#
# @author Luis Camero <[email protected]>
# @copyright (c) 2025, 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 Node
from launch_ros.substitutions import FindPackageShare

ARGUMENTS = [
DeclareLaunchArgument('namespace', default_value='',
description='Robot namespace')
]


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',
'inventus_bmu.yaml'
]))

inventus_node = Node(
package='inventus_bmu',
namespace=namespace,
executable='inventus_bmu_driver',
name='inventus_bmu_node',
parameters=[parameters],
output='screen',
)

ld = LaunchDescription()
ld.add_action(arg_namespace)
ld.add_action(arg_parameters)
ld.add_action(inventus_node)
return ld

0 comments on commit a920aac

Please sign in to comment.