Skip to content

Commit

Permalink
Add extra launch file to sensor service
Browse files Browse the repository at this point in the history
  • Loading branch information
luis-camero committed Mar 13, 2024
1 parent c22596f commit 269f84a
Showing 1 changed file with 13 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ def __init__(self, setup_path: str = '/etc/clearpath/') -> None:

# Valence BMS
self.bms_launch_file = None
if (self.clearpath_config.platform.battery.model in
if (self.clearpath_config.platform.battery.model in
[BatteryConfig.VALENCE_U24_12XP, BatteryConfig.VALENCE_U27_12XP]):

can_dev = 'can1'
Expand All @@ -161,9 +161,9 @@ def __init__(self, setup_path: str = '/etc/clearpath/') -> None:
launch_args = self.clearpath_config.platform.battery.launch_args

if launch_args:
if 'can_device' in launch_args:
if 'can_device' in launch_args:
can_dev = launch_args['can_device']
if 'bms_id' in launch_args:
if 'bms_id' in launch_args:
bms_id = launch_args['bms_id']

bms_launch_args = [
Expand Down Expand Up @@ -267,6 +267,16 @@ def generate_sensors(self) -> None:
# Include sensor launch in top level sensors launch file
sensors_service_launch_writer.add(sensor_launch.launch_file)

if self.clearpath_config.platform.launch:
extra_launch = LaunchFile(
name=(os.path.basename(
self.clearpath_config.platform.extras.launch['path']
)).split('.')[0],
path=os.path.dirname(self.clearpath_config.platform.extras.launch['path']),
package=Package(self.clearpath_config.platform.extras.launch['package']),
)
sensors_service_launch_writer.add(extra_launch)

sensors_service_launch_writer.generate_file()

def generate_platform(self) -> None:
Expand Down

0 comments on commit 269f84a

Please sign in to comment.