Skip to content

Add traffic light adapter template#44

Open
jixiancgh wants to merge 1 commit into
open-rmf:mainfrom
chart-sg:add_traffic_light_adapter_template
Open

Add traffic light adapter template#44
jixiancgh wants to merge 1 commit into
open-rmf:mainfrom
chart-sg:add_traffic_light_adapter_template

Conversation

@jixiancgh

Copy link
Copy Markdown

New feature implementation

Implemented feature

This PR aims to add a traffic_light_adapter_template package for medium compliance robots. It fills a gap for fleets whose robots self-navigate (the robot's own fleet manager plans and drives the path) but still need RMF for traffic deconfliction with other RMF robots.

Implementation description

fleet_adapter.py registers each robot via Adapter.add_easy_traffic_light. The adapter then polls the robot each update cycle and reports its position and movement state to RMF. RMF responds with Resume, WaitAtNextCheckpoint, or PauseImmediately, which the adapter translates into pause / resume / pause_at_checkpoint robot commands.

The main difference is in traffic_light_command_handle.py:

  • wires up the three EasyTrafficLight callbacks (traffic_light_cb, pause_cb, resume_cb),
  • reports state via moving_from() / waiting_at() / waiting_after() each cycle in update_state_locked
  • calls the robot commands at _handle_moving, _handle_waiting_at and _handle_waiting_after logics

GenAI Use

We follow OSRA's policy on GenAI tools

  • I used a GenAI tool in this PR.
  • I did not use GenAI

Generated-by:

Signed-off-by: Loke Ji Xian <loke_ji_xian@cgh.com.sg>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Inbox

Development

Successfully merging this pull request may close these issues.

2 participants