CommonplaceRobotics / iRC_ROS

ROS2 packages for the igus Robot Control
Apache License 2.0
15 stars 7 forks source link

Only start crpcan specific controllers when the protocol is selected #59

Closed cpr-fer closed 1 year ago

cpr-fer commented 1 year ago

I made the launch conditions depend on multiple parameters and for that needed to write some ugly PythonExpression as the other solutions didn't work:

# Doesn't work as LCE() is not iterable
AndSubstitution(LaunchConfigurationEquals(), LaunchConfigurationEquals())

# Only available in rolling/iron, but we target only humble right now
condition=AndSubstitution(
      EqualsSubstitution(LaunchConfiguration('hardware_protocol'), 'cprcanv2'),
      EqualsSubstitution(LaunchConfiguration('gripper'), 'ext_dio_gripper'),
),

It is currently only done for the rebel launch file, if testing doesn't show any errors I'll add this change to the other launch files as well