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

Reservations #36

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

Reservations #36

wants to merge 73 commits into from

Conversation

arjo129
Copy link
Member

@arjo129 arjo129 commented Jun 22, 2021

Implemented feature

This PR implements reservations.

⚠️ The quality of the code in this feature is pretty low. There are many unnecessary copies of objects made along the way and the PR can definitely be subject to a lot of clean ups. As this is a pretty big feature, I'm using the PR as an Minimal Viable Product.

Implementation description

OptimizationPlan
The overall idea of this is to have an intelligent reservation protocol. This would allow robots to reserve items like parking spots, chargers and lifts intelligently. The initial discussion for this PR can be seen at osrf/rmf_core#297. Essentially, robots make reservations with a set of given constraints that can be defined by the ReservationRequest class. A robot may place a Request consisting of multiple alternatives of ReservationRequest. When the Reservation System (ResSys (for short)) receives the request it sets out to optimize the given constraints. Once it finds a satisfactory set of constraints it then asks the participants for approvals. If one of the robots disagrees, then the optimizer will find the next best solution. If all the participants agree, then we rollout the reservation.

The key files of interest if you wish to review the API are the following:

An example of how the reservation may be used can be found in rmf_traffic/test/unit/reservations/test_Database.cpp

Internally, the planner performs a best-first-search. Honestly, theres a lot of work to do here but the critical files for this are all stored here:

  • src/rmf_traffic/reservations/internal/State.hpp - Keeps track of the State. Is used to explore the search space.
  • src/rmf_traffic/reservations/internal/StateDiff.hpp - Calculates patches between the states.
  • src/rmf_traffic/reservations/internal/Heuristic.hpp - Abstract class and naive implementation of a greedy heuristic.
  • src/rmf_traffic/reservations/internal/Optimizer.hpp - Actual implementation of Greedy Best-First-Search. Short and simple not much to see...

There are also some classes to help with synchronization and general book keeping.

  • ParticipantStore - stores the participants and provides general book-keeping for participants.
  • RequestStore - stores the requests.
  • Protocol - The actual implementation of the protocol.

arjo129 added 30 commits May 6, 2021 14:05
Signed-off-by: Arjo Chakravarty <[email protected]>
Signed-off-by: Arjo Chakravarty <[email protected]>
Signed-off-by: Arjo Chakravarty <[email protected]>
Signed-off-by: Arjo Chakravarty <[email protected]>
Signed-off-by: Arjo Chakravarty <[email protected]>
Signed-off-by: Arjo Chakravarty <[email protected]>
Signed-off-by: Arjo Chakravarty <[email protected]>
Signed-off-by: Arjo Chakravarty <[email protected]>
NextStateGenerator provides the basics for iterating in the planner.

Signed-off-by: Arjo Chakravarty <[email protected]>
Signed-off-by: Arjo Chakravarty <[email protected]>
Signed-off-by: Arjo Chakravarty <[email protected]>
Signed-off-by: Arjo Chakravarty <[email protected]>
Signed-off-by: Arjo Chakravarty <[email protected]>
Signed-off-by: Arjo Chakravarty <[email protected]>
Signed-off-by: Arjo Chakravarty <[email protected]>
Signed-off-by: Arjo Chakravarty <[email protected]>
Signed-off-by: Arjo Chakravarty <[email protected]>
Signed-off-by: Arjo Chakravarty <[email protected]>
Signed-off-by: Arjo Chakravarty <[email protected]>
Signed-off-by: Arjo Chakravarty <[email protected]>
Signed-off-by: Arjo Chakravarty <[email protected]>
Signed-off-by: Arjo Chakravarty <[email protected]>
Signed-off-by: Arjo Chakravarty <[email protected]>
Signed-off-by: Arjo Chakravarty <[email protected]>
Signed-off-by: Arjo Chakravarty <[email protected]>
Signed-off-by: Arjo Chakravarty <[email protected]>
arjo129 added 24 commits July 20, 2021 11:53
Signed-off-by: Arjo Chakravarty <[email protected]>
Signed-off-by: Arjo Chakravarty <[email protected]>
Signed-off-by: Arjo Chakravarty <[email protected]>
Signed-off-by: Arjo Chakravarty <[email protected]>
Signed-off-by: Arjo Chakravarty <[email protected]>
Signed-off-by: Arjo Chakravarty <[email protected]>
Signed-off-by: Arjo Chakravarty <[email protected]>
Signed-off-by: Arjo Chakravarty <[email protected]>
Signed-off-by: Arjo Chakravarty <[email protected]>
Signed-off-by: Arjo Chakravarty <[email protected]>
Signed-off-by: Arjo Chakravarty <[email protected]>
Signed-off-by: Arjo Chakravarty <[email protected]>
Signed-off-by: Arjo Chakravarty <[email protected]>
Signed-off-by: Arjo Chakravarty <[email protected]>
Signed-off-by: Arjo Chakravarty <[email protected]>
Signed-off-by: Arjo Chakravarty <[email protected]>
Signed-off-by: Arjo Chakravarty <[email protected]>
Signed-off-by: Arjo Chakravarty <[email protected]>
Signed-off-by: Arjo Chakravarty <[email protected]>
Signed-off-by: Arjo Chakravarty <[email protected]>
Signed-off-by: Arjo Chakravarty <[email protected]>
Signed-off-by: Arjo Chakravarty <[email protected]>
Signed-off-by: Arjo Chakravarty <[email protected]>
@arjo129 arjo129 marked this pull request as ready for review July 23, 2021 03:59
@arjo129 arjo129 changed the title [WIP] Reservations Reservations Jul 23, 2021
@arjo129 arjo129 requested a review from mxgrey July 23, 2021 04:00
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.

1 participant