open-rmf / open-rmf/rmf

[Bug]: An error occurred when I called the skip interface

Open Beginner friendly
#374 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
Python
Stars
439
Forks
90
PR merge metrics
No merged PRs in 30d

Description

Before proceeding, is there an existing issue or discussion for this?
OS and version

Ubuntu22.04

Open-RMF installation type

Source build

Other Open-RMF installation methods

No response

Open-RMF version or commit hash

2.3.0

ROS distribution

Rolling

ROS installation type

Source build

Other ROS installation methods

No response

Package or library, if applicable

No response

Description of the bug

The following error occurred when I called the skip interface.

terminate called after throwing an instance of 'nlohmann::detail::type_error'
[fleet_adapter-14]   what():  [json.exception.type_error.305] cannot use operator[] with a numeric argument with object

After debugging, I have located the point where the error occurred.

Then I made some simple modifications.

    for (const auto &[phase, skip_info] : _skip_info_map)
    {
      auto &skip_requests = phases[std::to_string(phase)]["skip_requests"];
      for (const auto &s : {&skip_info.active_skips, &skip_info.removed_skips})
      {
        for (const auto &[token, msg] : *s)
          skip_requests[token] = msg;
      }
    }
Steps to reproduce the bug
  1. Launch RMF using ros2 launch rmf_demos office.demo.launch
  2. Launch RMF-WEB
  3. Send a compose task with multiple phases
  4. Calling the skip interface
Expected behavior

No response

Actual behavior

No response

Additional information or screenshots

No response

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 at rmf_fleet_adapter/src/rmf_fleet_adapter/TaskManager.cpp around line 555, where the reported nlohmann::json exception occurs. Reproduce with ros2 launch rmf_demos office.demo.launch, RMF-WEB, and a compose task with multiple phases, then call the skip interface. Done means the multi-phase skip request completes without the numeric-index JSON exception.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.