linorobot / linorobot2

Autonomous mobile robots (2WD, 4WD, Mecanum Drive)
Apache License 2.0
436 stars 148 forks source link

depth.launch.py on humble fails #94

Open gitisacatsname opened 8 months ago

gitisacatsname commented 8 months ago

If e.g. realsense is selected value mapper fails as it is evaluated with realsense value:

to_oakd_vars = {
    "oakd": "OAK-D",
    "oakdlite": "OAK-D-LITE",
    "oakdpro": "OAK-D-PRO"
}

this is evaluated at launch causing it to fail (sensor is realsense):

 launch_arguments={
                'camera_model': to_oakd_vars[LaunchConfiguration('sensor')],  

I would prefer this

IncludeLaunchDescription( PythonLaunchDescriptionSource(PathJoinSubstitution( [FindPackageShare('depthai_examples'), 'launch', 'stereo.launch.py'] )), condition=IfCondition(PythonExpression(['"', LaunchConfiguration('sensor'), '" in "', str(oakd_sensors), '"'])), launch_arguments={ 'camera_model': PythonExpression(["'OAK-D' if 'oakd' in ", LaunchConfiguration('sensor'), " else 'OAK-D-LITE' if 'oakdlite' in ", LaunchConfiguration('sensor'), " else 'OAK-D-PRO' if 'oakdpro' in ", LaunchConfiguration('sensor')," else 'UNKNOWN'"]), }.items() ),

otherwise valuemapper will fail if e.g. realsense is used. this broke launch for me.