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

Feature: Modes - Delivery #787

Draft
wants to merge 26 commits into
base: dev
Choose a base branch
from
Draft
Changes from 1 commit
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
dcb12c5
Create delivery.md
tristan-charreton Jun 15, 2022
e83fab8
adding robot files
alesantiago98 Jun 16, 2022
7010880
Merge branch 'feature-modes-deliverybot' of https://github.com/kiwibo…
JuanCarlos-TiqueRangel Jun 16, 2022
2ef64d8
upload readme
JuanCarlos-TiqueRangel Jun 21, 2022
23a0ccd
Update delivery.md
tristan-charreton Jun 21, 2022
13e2e25
Update delivery.md
tristan-charreton Jun 21, 2022
bf5145f
Update delivery-robots.md
tristan-charreton Jun 21, 2022
735415a
Update and rename delivery-robots.md to delivery.md
tristan-charreton Jun 22, 2022
3323e89
Update delivery.md
tristan-charreton Jun 30, 2022
c8224ba
Update delivery.md
tristan-charreton Jul 11, 2022
2d4f5f0
Update event_types.md
tristan-charreton Jul 13, 2022
beb5d3e
Update delivery.md
tristan-charreton Jul 13, 2022
68fce9b
Update delivery.md
tristan-charreton Jul 13, 2022
3bb87e8
Update delivery.md
tristan-charreton Jul 13, 2022
394e910
Update README.md
tristan-charreton Jul 19, 2022
274fbbf
Update event_types.md
tristan-charreton Jul 19, 2022
06dccd9
Update delivery.md
tristan-charreton Jul 19, 2022
4ff3453
Update event_types.md
tristan-charreton Jul 19, 2022
2f0e0f9
Update delivery.md
tristan-charreton Jul 19, 2022
ae56309
Merge branch 'delivery' into feature-modes-delivery
tristan-charreton Sep 13, 2022
7080f69
Merge pull request #2 from kiwibot-data/feature-modes-delivery
tristan-charreton Sep 13, 2022
1e07790
Update README.md
tristan-charreton Sep 14, 2022
501c01d
Update delivery.md
tristan-charreton Sep 14, 2022
6d55c84
Update delivery.md
tristan-charreton Sep 15, 2022
0a719f3
Update vehicle_states.md
tristan-charreton Sep 15, 2022
34cbc6a
Update README.md
tristan-charreton Sep 15, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Update delivery.md
  • Loading branch information
tristan-charreton authored Jul 13, 2022
commit 3bb87e8c813122084d71f56af7cd2d0b02646a33
25 changes: 16 additions & 9 deletions modes/delivery.md
Original file line number Diff line number Diff line change
@@ -35,7 +35,7 @@ Additionally, `trip_id` is required if `event_types` contains a `enter_jurisdict

### Trip Type

The `trip_type` field is used to describe the trip itself. It can be 'delivery', 'roaming', 'return' or 'advertising'
The `trip_type` field is used to describe the trip itself. It can be `delivery`, `roaming`, `return` or `advertising`

### Trip Attributes

@@ -129,8 +129,9 @@ Valid delivery vehicle event types are
- `off_hours`
- `on_hours`
- `driver_cancellation`
- 'order_delivery'(this or trip end ?)
- 'order_pick_up' (this or trip stop ?)
- `order_delivery`
- `order_pick_up`
- `order_receipt`
- `decommission`
- `maintenance_end`
- `maintenance_start`
@@ -203,32 +204,38 @@ This is the list of `vehicle_state` and `event_type` pairings that constitute th
| `unknown` | `removed` | N/A | `comms_restored` | The vehicle has come back into comms while removed |
| `unknown` | `reserved` | `reserved` | `comms_restored` | The vehicle has come back into comms while reserved by a customer |
| `unknown` | `stopped` | `stopped` | `comms_restored` | The vehicle has come back into comms while stopped |
| `on_trip` | `stopped` | `stopped` | `order_pick_up` | The vehicle has come to pick up the order at the restaurant |
| `on_trip` | `stopped` | `stopped` | `order_delivery` | The vehicle is at the customer's place and is waiting for them |
| `on_trip` | `stopped` | `stopped` | `order_pick_up` | The vehicle has come to pick up the order at the restaurant |
| `stopped` | `available` | `N/A` | `order_receipt` | The customer received their order |
| `on_trip` | `available` | `N/A` | `order_receipt` | The customer received their order |




### State Machine Diagram

The *Delivery Diagram* shows how the `vehicle_state` and `event_type` relate to each other and how delivery vehicles can transition between states. See this [text-editable EPS](https://drive.google.com/file/d/1WusVpFK1Vm7HSJgNcA_10T74TEzuCpTB/view?usp=sharing) for the source file.

![Passenger Services State Machine Diagram](passenger-services-state-machine-diagram.svg)
The *Delivery Diagram* shows how the `vehicle_state` and `event_type` relate to each other and how delivery vehicles can transition between states.

#### Delivery State Notes

When there is only one trip ongoing, `trip_state == vehicle_state`

In cases where there are multiple trips ongoing, please follow the trip state model pseudocode for determining what the vehicle state should be:
```
t = all on-going trips for vehicle
t = for the one vehicle, all on-going trips which are 'delivey' or undefined trips (we do not take into account 'roaming', 'return' or 'advertising' trips)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Here a choice was made : even if we want to track all the movements as trips, we do not consider as a roaming robot as being 'on trip'. Can be debated

v = vehicle state
if t.any(state == ‘stopped’):
v = ‘stopped’
v = ‘stopped’
else:
if t.any(state == ‘on_trip’):
v = ‘on_trip’
v = ‘on_trip’
else:
if t.any(state == ‘reserved’):
v = ‘reserved’
else:
if t=[]:
v = ‘available’
```
`trip_state` mappings should be the same as in the table above.