linorobot / linorobot2

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

changed depth launch to not evaluate dict when and fail when sensor other then oakd is used #95

Closed gitisacatsname closed 7 months ago

gitisacatsname commented 8 months ago

as stated here: https://github.com/linorobot/linorobot2/issues/94

gitisacatsname commented 8 months ago

ah, forgot to state also fixed property name for realsense sensor as this changed since wrapper is out of beta.

grassjelly commented 8 months ago

hi, thanks for the PR. Could we try this instead? It's quite hard to debug that PythonExpression in the future in case it breaks again. I don't have an oak-d so this approach might be less intrusive.

  IncludeLaunchDescription(
      PythonLaunchDescriptionSource(PathJoinSubstitution(
          [FindPackageShare('depthai_examples'), 'launch', 'stereo.launch.py']
      )),
      condition=IfCondition(PythonExpression(['"', LaunchConfiguration('sensor'), '" in "', str(oakd_sensors), '"'])),
      launch_arguments={
          'camera_model': to_oakd_vars.get(LaunchConfiguration('sensor')], "UNKNOWN"),                
      }.items()   
  ),