Skip to content

[Bug]: Dock method is called twice when planned from one lane away on bi-directional lane #479

@cwrx777

Description

@cwrx777

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

OS and version

Ubuntu 22.04

Open-RMF installation type

Source build

Other Open-RMF installation methods

No response

Open-RMF version or commit hash

5dc339c

ROS distribution

Humble

ROS installation type

Source build

Other ROS installation methods

No response

Package or library, if applicable

No response

Description of the bug

Dock method is called twice when planned from one lane away on bi-directional lane.
Could it be due to this open-rmf#111?

Steps to reproduce the bug

rmf_ros2, rmf_traffic: main branch
rmf_demos: humble

  1. Edit source to log planned path:
  const auto& graph = _context->navigation_graph();
  std::stringstream ss;
  auto waypoints = plan.get_waypoints();
  const auto t0 = waypoints.front().time();
  for (const auto& wp : waypoints)
  {
    ss << "\n -- " << agv::print_plan_waypoint(wp, graph, t0);
  }

  RCLCPP_INFO(
    _context->node()->get_logger(),
    "[%s]: "
    "Details:\n%s",
    _context->requester_id().c_str(),
    ss.str().c_str());
  1. Edit office map and add dock_name to tinyRobot1_charger
Image
  1. Create mock docker config file, e.g.

    tinyRobot:
      tinyRobot1_charger:
        level_name: "L1"
          path: 
            - [10.0824,-6.9756, 1.50 ]
            - [10.4295,-5.5703, 1.50 ]
        finish_waypoint: "tinyRobot1_charger"
  2. Edit office.launch.xml in rmf_demos package and add launch configuration for mock_docker

     <!-- Mock Docker Node, to provide Fleet Adapter paths for docking -->
     <group>
        <let name="docking_config_file" 
    value="/path/to/office_docker_config.yaml"/>
       <node pkg="rmf_demos_tasks" exec="mock_docker" args="-c $(var docking_config_file)">
         <param name="use_sim_time" value="$(var use_sim_time)"/>
       </node>
     </group>
  3. Launch office sim.

  4. Send task to 'patrol_A1' and 'tinyRobot1_charger':

    ros2 run rmf_demos_tasks dispatch_patrol -F tinyRobot -R tinyRobot1 -p patrol_A1 tinyRobot1_charger --use_sim_time

    output:

    [fleet_adapter-17] [tinyRobot_fleet_adapter]: [tinyRobot/tinyRobot1]: Details:
    [fleet_adapter-17] 
    [fleet_adapter-17]  -- t=0 < 10.1136 -6.86811  1.32862> yaw=76.1245 approach lanes:
    [fleet_adapter-17]  -- t=5 < 10.1136 -6.86811  1.32862> yaw=76.1245 event [Dock tinyRobot1_charger] approach lanes:
    [fleet_adapter-17]  -- t=10.536 < 10.1136 -6.86811 -1.81297> yaw=-103.876 event [Dock tinyRobot1_charger] approach lanes:
    [fleet_adapter-17]  -- t=13.8664 #16 < 10.4331  -5.5751 -1.81297> yaw=-103.876 approach lanes: 26
    
  5. As a comparison, send another task, to 'patrol_D2' and 'tinyRobot1_charger':

    ros2 run rmf_demos_tasks dispatch_patrol -F tinyRobot -R tinyRobot1 -p patrol_D2 tinyRobot1_charger --use_sim_time

    output:

    [fleet_adapter-17] [tinyRobot_fleet_adapter]: [tinyRobot/tinyRobot1]: Details:
    [fleet_adapter-17] 
    [fleet_adapter-17]  -- t=0 < 10.2185 -3.16058  1.16615> yaw=66.8156 approach lanes:
    [fleet_adapter-17]  -- t=0 < 10.2185 -3.16058  1.16254> yaw=66.6088 approach lanes:
    [fleet_adapter-17]  -- t=7.2492 #6 < 8.91186 -6.18135  1.16254> yaw=66.6088 approach lanes: 8
    [fleet_adapter-17]  -- t=9.85274 #6 < 8.91186 -6.18135  2.54467> yaw=145.799 approach lanes:
    [fleet_adapter-17]  -- t=13.3591 #7 < 10.0861 -6.97944  2.54467> yaw=145.799 approach lanes: 10
    [fleet_adapter-17]  -- t=15.6858 #7 < 10.0861 -6.97944  1.32862> yaw=76.1243 event [Dock tinyRobot1_charger] approach lanes:
    [fleet_adapter-17]  -- t=24.2456 #16 <10.4331 -5.5751 1.32862> yaw=76.1243 approach lanes: 26
    

Expected behavior

There should only be one dock event

Actual behavior

There are two dock events.

Additional information or screenshots

No response

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

Status

In Progress

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions