open-rmf / rmf

Root repository for the RMF software
Apache License 2.0
223 stars 57 forks source link

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

Open liugehaizaixue opened 11 months ago

liugehaizaixue commented 11 months ago

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