Skip to content
New issue

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

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

Already on GitHub? # to your account

Add api for robot charging tasks #283

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

luca-della-vedova
Copy link
Member

@luca-della-vedova luca-della-vedova commented Jun 15, 2023

New feature implementation

Implemented feature

Closes #261.

Implementation description

This PR adds support for submitting robot charging requests through a charge task.
This task should only be used in direct task requests, since dispatching it to the robot that can charge the fastest doesn't really make a lot of sense. addressed in d87b87b

It can be tested with this rmf_demos branch that adds a dispatch_charge task, with mandatory fleet and robot parameters to make sure it is a direct assignment.

Signed-off-by: Luca Della Vedova <lucadv@intrinsic.ai>
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://raw.githubusercontent.com/open-rmf/rmf_ros2/main/rmf_fleet_adapter/schemas/event_description__charge.json",
"title": "Charge Event",
Copy link
Contributor

Choose a reason for hiding this comment

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

I recommend we add "Battery" everywhere to make this more explicit, e.g. "Charge Battery Event", event_description__charge_battery.json, "Charge the battery of a robot".

If anyone develops a bull robot for a rodeo they might want "charge" to mean something else.

Copy link
Member Author

Choose a reason for hiding this comment

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

Signed-off-by: Luca Della Vedova <lucadv@intrinsic.ai>
Signed-off-by: Luca Della Vedova <lucadv@intrinsic.ai>
@luca-della-vedova
Copy link
Member Author

In d87b87b an unordered_set<std::string> has been added to be checked when bidding for tasks to make sure fleet adapters don't bid on charge_battery tasks. Now charge_battery tasks can only be submitted through direct assignment and bidding will fail.
TODOs have been left in place to expose this as a parameter, for system integrators to choose which tasks they want to accept as direct but don't want to bid on.

@luca-della-vedova luca-della-vedova marked this pull request as ready for review June 15, 2023 08:09
@luca-della-vedova luca-della-vedova changed the title WIP Add api for robot charging tasks Add api for robot charging tasks Jun 20, 2023
@@ -0,0 +1,9 @@
{
Copy link
Member

Choose a reason for hiding this comment

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

I don't think we necessarily need this event_description schema since we don't support any ChargeBattery events in rmf_task.
With this description, users can theoretically submit a composable task with a ChargeBattery event injected between other activities but the fleet adapter will not find the right builder from rmf_task_sequence to generate the Model and Description for this event.

Not a blocker imo but it would be good to test what happens when such a compose task is submitted to make sure any errors are gracefully handled.

"title": "Charge Battery Event",
"description": "Charge a robot's battery",
"type": "object",
"properties": {
Copy link
Member

Choose a reason for hiding this comment

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

I think right now the battery level to which the robot charges up to is statically defined in the fleet config. In the future it would be good to specify this % in the properties here and have the TaskPlanner accept this value in the Options it receives before it plans. Not a blocker.

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

Successfully merging this pull request may close these issues.

Add API for direct robot charging requests
3 participants