Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add missing argument when checking for fleet delivery capability #26

Merged
merged 1 commit into from
Mar 24, 2023

Conversation

RBinsonB
Copy link
Contributor

There is a small bug preventing the MiR fleet adapter to be used with delivery task. This PR aims to solve it.

If setting the delivery task capability to True in the config, the following crash would happen when trying to launch the fleet adapter:

ros2 run fleet_adapter_mir fleet_adapter_mir -c $CONFIG_FILE -n $NAV_GRAPH -d
Starting mir fleet adapter...

== Initialising MiR Robot Command Handles with Config ==
{'node_names': {'fleet_state_publisher': 'rmf_mir_fleet_state_publisher',
                'rmf_fleet_adapter': 'TestDeliveryAdapter',
                'robot_command_handle': 'rmf_mir_fleet_command_handler'},
 'reference_coordinates': {'mir': [[30.65, 6.7],
                                   [23.1, 6.85],
                                   [22.0, 13.0],
                                   [31.3, 9.3]],
                           'rmf': [[3.095, -11.2258],
                                   [10.3341, -9.4423],
                                   [13.5864, -15.0028],
                                   [3.3573, -14.0595]]},
 'rmf_fleet': {'account_for_battery_drain': True,
               'ambient_system': {'power': 20.0},
               'battery_system': {'capacity': 40.0,
                                  'charging_current': 26.4,
                                  'voltage': 24.0},
               'cleaning_system': {'power': 650.0},
               'fleet_state_publish_frequency': 1,
               'fleet_state_topic': 'fleet_states',
               'limits': {'angular': [1.0, 0.45], 'linear': [0.7, 0.3]},
               'mechanical_system': {'friction_coefficient': 0.2,
                                     'mass': 80.0,
                                     'moment_of_inertia': 20.0},
               'name': 'test_fleet',
               'profile': {'footprint': 0.4, 'vicinity': 0.5},
               'publish_fleet_state': True,
               'recharge_soc': 1.0,
               'recharge_threshold': 0.01,
               'reversible': False,
               'task_capabilities': {'action_categories': ['custom_mission_1'],
                                     'clean': False,
                                     'delivery': False,
                                     'finishing_request': 'nothing',
                                     'loop': True}},
 'robots': {'my_test_robot': {'mir_config': {'base_url':   <REMOVED FFROM LOG FOR SECURITY REASONS>,
                                             'dock_and_charge_mission': 'docking_mission_test',
                                             'password': 'Basic '
                                                         <REMOVED FROM LOG FOR SECURITY REASONS>,
                                             'rmf_move_mission': 'rmf_default_move_mission',
                                             'user': 'application/json'},
                              'rmf_config': {'charger': {'waypoint': 'charger_waypoint'},
                                             'robot_state_update_frequency': 1,
                                             'start': {'map_name': 'L1',
                                                       'max_merge_lane_distance': 3.0,
                                                       'max_merge_waypoint_distance': 3.0}}}}}

Fleet [test_fleet] is configured to perform Loop tasks
Fleet [test_fleet] is configured to perform action of category [custom_mission_1]
Traceback (most recent call last):
  File "/rmf_demos_ws/install/fleet_adapter_mir/lib/fleet_adapter_mir/fleet_adapter_mir", line 33, in <module>
    sys.exit(load_entry_point('fleet-adapter-mir==0.1.0', 'console_scripts', 'fleet_adapter_mir')())
  File "/rmf_demos_ws/install/fleet_adapter_mir/lib/python3.10/site-packages/fleet_adapter_mir/fleet_adapter_mir.py", line 351, in main
    robots = create_robot_command_handles(config, handle_data, dry_run=dry_run)
  File "/rmf_demos_ws/install/fleet_adapter_mir/lib/python3.10/site-packages/fleet_adapter_mir/fleet_adapter_mir.py", line 250, in create_robot_command_handles
    assert starts, ("Robot %s can't be placed on the nav graph!"
AssertionError: Robot my_test_robot can't be placed on the nav graph!
[ros2run]: Process exited with failure 1

This is due to this function call : https://github.com/osrf/fleet_adapter_mir/blob/92c457d7713f5c12ccad1208a85d445d937c6635/fleet_adapter_mir/fleet_adapter_mir.py#L160

consider_delivery_request needs a confirmation for both pickup and dropoff. This is fixed in this PR.

This solution was tested successfully on a real MiR100. The fleet adapter is running and able to carry out delivery tasks.

Copy link
Member

@Yadunund Yadunund left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Thanks for the contribution

@Yadunund Yadunund merged commit 23f96d1 into open-rmf:main Mar 24, 2023
@RBinsonB RBinsonB deleted the fix/delivery_capability branch March 31, 2023 13:05
@Vishal24rg
Copy link

Hi Team,

As referenced in Issue #30, I have not been able to get the fleet adapter working. Please let me know if I am missing anything.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants