open-rmf / open-rmf/rmf_task

[Feature request]: Add idle robot preferred option in Task Planning

Open
#127 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement
Dominant language
C++
Stars
27
Forks
30
PR merge metrics
No merged PRs in 30d

Description

Before proceeding, is there an existing issue or discussion for this?
Description

In some deployments, users prefer to see all robots moving rather than just a handful handling all tasks. What user asked is that: why i have 5 robots, and I always see 1 of it working? Then the rest (idle robots) just sits in charger will full battery charged.

Example Scenario:

  • Multiple tasks have end waypoints close to each other.
  • The planner repeatedly assigns all these tasks to the same “fastest” robot because it minimizes finish time.
  • This robot ends up handling the majority of the work, draining its battery quickly, while other robots remain idle with full battery for extended periods.
Implementation Considerations

I’ve implemented an Idle Robot Preferred option, which allows the task planner to prioritize idle robots during node expansion.
Currently, node expansion selects the best candidate purely based on the shortest estimated finish time. With this new option enabled, the planner will first look for idle robots (robots with no task on hand before entering task planning) when assigning unassigned tasks during node expansion.

This behavior is configurable at the fleet level (a parameter in fleet config), since not every deployment requires this strategy — most still prefer the default shortest-finish-time approach.

Core changes:

  • The main changes is in TaskPlanner.cpp, inside expand().
  • If the idle robot preferred flag is enabled, the planner will:
    • While looping over unassigned tasks, choose an idle robot if possible.
    • The idle status is determined in TaskManager.cpp and passed into the planner as part of each robot’s initial state.
    • If no idle robot, or all robots are idle, or all robots are busy, the planner falls back to the default strategy — selecting the best candidate based on shortest estimated finish time.
Alternatives

No response

Additional information

Initially, I considered adding a LoadBalancingCostCalculator on top of the idle robot preferred layer to adjust cost calculations, or possibly introduce a penalty when task assignments are unbalanced (e.g., one robot got assigned multiple tasks while others got none).

However, I realized that RMF already has a built-in task reassignment mechanism, controlled by reassign_task_interval. With idle robot preferred enabled, every time this interval elapses, RMF will replan task assignments and allocate available tasks to idle robots. This means the system already self-corrects imbalances over time, and this additional load-balancing mechanism is unnecessary.

So, solely with the idle robot preferred option in task planning will b good enough.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with TaskPlanner.cpp and its expand() function, then trace how TaskManager.cpp determines each robot’s initial idle status. Follow the fleet configuration path for the new option and verify the documented fallback to shortest estimated finish time when the preference cannot select a suitable robot. Done means the behavior is configurable and idle robots are preferred as described.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
robotics
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.