Skip to content

[BUG] Incorrect App IDs in Sensor Diagnostics Demo Scripts #22

@bburda

Description

@bburda

Description

The sensor diagnostics demo scripts were using incorrect app IDs with underscores (_) instead of dashes (-), causing API calls to fail with "entity not found" errors.

Root Cause

Mismatch between ROS 2 node naming convention and Gateway API entity ID format:

  • ROS 2 node names use underscores: /sensors/lidar_sim, /sensors/imu_sim
  • Gateway API app IDs use dashes: lidar-sim, imu-sim, gps-sim, camera-sim, anomaly-detector, diagnostic-bridge

All demo scripts were incorrectly using underscore-based IDs when calling the API.

Steps to Reproduce

  1. Start sensor diagnostics demo:

    cd demos/sensor_diagnostics
    docker compose up -d
  2. Run check-demo.sh or any inject script:

    ./check-demo.sh
  3. Observe errors:

    === 8. Listing LiDAR Configurations ===
    jq: error (at <stdin>:6): Cannot iterate over null (null)
    
  4. Check API response:

    curl http://localhost:8080/api/v1/apps/lidar_sim/configurations
    # Returns: {"error_code": "entity-not-found", "message": "Entity not found"}

Expected vs Actual Behavior

Expected:

  • Scripts should use correct app IDs with dashes
  • API calls should succeed and return data
  • No jq parsing errors

Actual:

  • Scripts used underscore-based IDs
  • API returned "entity not found" errors
  • jq failed to parse null responses

Impact

  • check-demo.sh - Failed at step 8 (configurations) with jq error
  • inject-*.sh - All fault injection scripts failed silently
  • restore-normal.sh - Failed to reset configurations and clear faults
  • Demo appeared non-functional to users

Affected Files

Scripts with incorrect IDs:

  1. check-demo.sh - API demonstration
  2. inject-drift.sh - Fault injection
  3. inject-noise.sh - Fault injection
  4. inject-nan.sh - Fault injection
  5. inject-failure.sh - Fault injection
  6. restore-normal.sh - Parameter reset and fault clearing
  7. README.md - API usage examples

Incorrect app IDs found:

  • lidar_sim → ✅ lidar-sim
  • imu_sim → ✅ imu-sim
  • gps_sim → ✅ gps-sim
  • camera_sim → ✅ camera-sim
  • anomaly_detector → ✅ anomaly-detector
  • diagnostic_bridge → ✅ diagnostic-bridge

Environment

-- OS: ubuntu 24.04 (Docker)

  • Demo: sensor_diagnostics (main branch)
  • ROS 2 Distro: Jazzy

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions