Skip to content

Frontend: Dynamic obstacles with trigger-based movement for sim_control#10

Draft
Copilot wants to merge 2 commits intomainfrom
copilot/extend-sim-control-dynamic-obstacles
Draft

Frontend: Dynamic obstacles with trigger-based movement for sim_control#10
Copilot wants to merge 2 commits intomainfrom
copilot/extend-sim-control-dynamic-obstacles

Conversation

Copy link

Copilot AI commented Feb 26, 2026

Extends the Dreamview frontend to author, visualize, and send dynamic obstacle configurations to the sim_control backend — including per-obstacle trajectory paths, trigger zones, and lifecycle state tracking.

New abstractions

  • src/utils/dynamic_obstacle_constants.js — Shared ObstacleState / TriggerType / ObstacleType enums, isolated to break the store↔renderer circular dependency.
  • src/store/dynamic_obstacle_manager.js — MobX store owning obstacle state machine (IDLE → MOVING → FINISHED), CRUD, trigger config, and path editing delegation to the renderer.
  • src/renderer/dynamic_obstacles.js — Three.js renderer drawing:
    • Polygon boundary and trajectory path (color keyed to state)
    • Trigger zone: filled circle (reach_position) or ring (distance_to_ego)
    • Yellow "wire" line connecting trigger zone to the first trajectory waypoint
    • Interactive pin meshes during path editing
  • src/components/DynamicObstacleEditor/ — React panel with per-obstacle cards; supports trigger type + parameter config, map-click path editing (Edit Path → click waypoints → Confirm Path / Undo), and a Send Config button.

Integration hooks

  • renderer/index.jsenableDynamicObstacleEditing / disableDynamicObstacleEditing / updateDynamicObstacles wired into the existing render loop.
  • websocket_realtime.jssendDynamicObstacleConfig(obstacles) sends JSON to the backend; incoming SimWorldUpdate.dynamicObstacle[] syncs lifecycle states.
  • store/index.jsdynamicObstacleManager added; editing auto-stopped when panel closes.
  • Sidebar + ToolView — New "Dynamic Obstacles" button (showDynamicObstacleEditor) follows existing sidebar/option patterns.

Utilities

  • utils/misc.jsIsPointInPolygon via ray-casting (consistent naming with existing IsPointInRectangle), enabling arbitrary polygon trigger zone checks.

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • registry.npmmirror.com
    • Triggering command: /home/REDACTED/work/_temp/ghcca-node/node/bin/node node /usr/local/bin/yarn install (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

Original prompt

This section details on the original issue you should resolve

<issue_title>Task: Extend Apollo sim_control to support dynamic obstacles with trigger-based movement.</issue_title>
<issue_description>Task: Extend Apollo sim_control to support dynamic obstacles with trigger-based movement.

1. Data Structure (Protobuf):

  • Define a DynamicObstacle message including:
  • id, type, polygon_vertices.
  • trajectory: A list of (x, y, v, t) points.
  • trigger: OneOf {reach_position, distance_to_ego, time_delay}.

2. Trigger Manager Logic (C++):

  • Implement a TriggerEvaluator class that runs in the sim_control loop.
  • Function: bool IsTriggered(const EgoState& ego, const TriggerConfig& config).
  • If spatial_trigger is used, implement a Point-in-Polygon check to see if the ego vehicle has entered the activation zone.

3. Frontend Interaction (React/Three.js):

  • Path Editor: Reuse the Routing Editor logic to create a smooth path for the obstacle.
  • Trigger Linkage: Visual representation of a "wire" connecting a trigger zone to an obstacle in the UI.
  • State Management: Handle the obstacle's lifecycle: IDLE (waiting for trigger) -> MOVING (following path) -> FINISHED.</issue_description>

<agent_instructions>Task: Extend Apollo sim_control to support dynamic obstacles with trigger-based movement.

1. Data Structure (Protobuf):

  • Define a DynamicObstacle message including:
  • id, type, polygon_vertices.
  • trajectory: A list of (x, y, v, t) points.
  • trigger: OneOf {reach_position, distance_to_ego, time_delay}.

2. Trigger Manager Logic (C++):

  • Implement a TriggerEvaluator class that runs in the sim_control loop.
  • Function: bool IsTriggered(const EgoState& ego, const TriggerConfig& config).
  • If spatial_trigger is used, implement a Point-in-Polygon check to see if the ego vehicle has entered the activation zone.

3. Frontend Interaction (React/Three.js):

  • Path Editor: Reuse the Routing Editor logic to create a smooth path for the obstacle.
  • Trigger Linkage: Visual representation of a "wire" connecting a trigger zone to an obstacle in the UI.
  • State Management: Handle the obstacle's lifecycle: IDLE (waiting for trigger) -> MOVING (following path) -> FINISHED.</agent_instructions>

Comments on the Issue (you are @copilot in this section)


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

… visualization

Co-authored-by: daohu527 <10419854+daohu527@users.noreply.github.com>
Copilot AI changed the title [WIP] Extend Apollo sim_control for dynamic obstacles with triggers Frontend: Dynamic obstacles with trigger-based movement for sim_control Feb 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Task: Extend Apollo sim_control to support dynamic obstacles with trigger-based movement.

2 participants