• Tidak ada hasil yang ditemukan

Mathematical Formulation

Chapter IV: Directive-response Assume-guarantee Contracts for an Auto-

4.3 Mathematical Formulation

Definition 4.3.1(Path). Apathis a continuous map 𝑝: [0,1] β†’ R2. 𝑝(0)is called the start point of 𝑝 and 𝑝(1) is called the end point of 𝑝. For each path 𝑝, let π‘β„Ž : [0,1] β†’ (βˆ’180,180] be such that π‘β„Ž(𝑠) is the heading angle measured in degrees from the abscissa to 𝑝0(𝑠), the derivative vector of 𝑝with respect to𝑠. For 𝑑 ∈ [0,1], let Λœπ‘(𝑑) denote the element 𝑝(𝑑) Γ— π‘β„Ž(𝑑)ofR3.

We will denote the set of all paths byPand, by abuse of notation, we will also use 𝑝to denote 𝑝( [0,1]), the image of [0,1]under 𝑝.

Definition 4.3.2 (Curvature feasibility). Given πœ… > 0 and a path 𝑝, πœ…-feasible(𝑝) is set to True if and only if 𝑝 is twice differentiable on [0,1], and its curvature

|det(𝑝0(𝑠), 𝑝00(𝑠)) |

k𝑝0(𝑠) k3 < πœ… for𝑠 ∈ [0,1].

Definition 4.3.3 (𝛿-corridor). Let B B {True,False}. If 𝑝 ∈ P, and 𝛿 : P Γ— [0,1] Γ—R3β†’Bis such that the corresponding subset:

Γ𝛿(𝑝) B Ø

π‘ βˆˆ[0,1]

Γ𝛿(𝑝, 𝑠),

whereΓ𝛿(𝑝, 𝑠) B {(π‘₯ , 𝑦, πœƒ) ∈ R3 | 𝛿(𝑝, 𝑠,(π‘₯ , 𝑦, πœƒ)) = True} such thatΓ𝛿(𝑝, 𝑠) is open and contains Λœπ‘(𝑠), then we say thatΓ𝛿(𝑝) is a𝛿-corridorfor 𝑝.

AVP World Building Blocks

In this section, we will introduce naming symbols for objects that exist in the AVP world.

Definition 4.3.4(AVP World). TheAVP worldconsists of the following:

1. A distinguished set of indexing symbolsT:={𝑑 , 𝑑0, 𝑑00, ...} denoting time.

2. A set of typed variablesUto denote actions, states, channels, etc.

3. The following set of constants: C,Gwhere

a) C, a set of symbols, is called the customer set.

b) G, a set of symbols, is called the garage set containing the following constant values:

i. G.π‘‘π‘Ÿ 𝑖 𝑣 π‘Ž 𝑏𝑙 𝑒_π‘Žπ‘Ÿ 𝑒 π‘Ž βŠ† R3, the set of configurations that vehicles are allowed to be in;

ii. G.𝑀 π‘Žπ‘™ π‘˜ π‘Ž 𝑏𝑙 𝑒_π‘Žπ‘Ÿ 𝑒 π‘Ž βŠ† R2, the area that pedestrians are allowed to walk on;

iii. G.π‘’π‘›π‘‘π‘Ÿ 𝑦_π‘π‘œπ‘› 𝑓 π‘–π‘”π‘’π‘Ÿ π‘Žπ‘‘π‘– π‘œπ‘›π‘  βŠ† R3, a set of configurations that the customers can deposit their car in;

iv. G.π‘Ÿ 𝑒𝑑 π‘’π‘Ÿ 𝑛_π‘π‘œπ‘› 𝑓 π‘–π‘”π‘’π‘Ÿ π‘Žπ‘‘π‘– π‘œπ‘›π‘  βŠ† R3, a set of configurations that the car should be returned in;

v. G. 𝑝 π‘Žπ‘Ÿ π‘˜ 𝑖𝑛𝑔_𝑠 𝑝 π‘œπ‘‘ 𝑠 ∈ N, the number of parking spots available in the parking lot;

vi. G.𝑖𝑛𝑑 π‘’π‘Ÿ 𝑖 π‘œπ‘Ÿ βŠ† R2, the area inside the parking garage.

Directive-Response Message Types

Each channel in the system is associated with a unique message type. The following are all the message types in our AVP system.

1. A(Β·), directive types:

a) A(CustomerInterface) B {Park,Retrieve}, b) A(Supervisor) BR6,

c) A(Planner) B P,

d) A(Tracker) BI βŠ† R2, the set of all control inputs.

2. B(Β·), response types:

a) B(CustomerInterface) B {Failed},

b) B(Supervisor) B {Rejected,Accepted,Returned},

c) B(Planner) =B(Tracker) B {Blocked,Failed,Completed}.

For each typeT, we will denote by ˜Tthe product typeTΓ—Cwhich will be used to associate a message of type Twith a specific customer inC. In addition, we will useIdto denote the set of message IDs.

Behavior

For each variable 𝑒 ∈ U, we denote by type(𝑒) thetype of 𝑒, namely, the set of values that it can take. The types of elements ofTare taken to beRβ‰₯0.

Definition 4.3.5 (Behavior). Let 𝑍 be an ordered subset of variables in U. A 𝑍-behavior is an element of B (𝑍) B (Î

π‘§βˆˆπ‘ type(𝑧))Rβ‰₯0. Given πœŽπ‘ ∈ B (𝑍) and 𝜏 ∈T, we will callπœŽπ‘(𝜏)thevaluationof𝑍at time𝜏. If𝑧 ∈ 𝑍, we will also denote by𝑧(𝜏)the value of𝑧at time𝜏.

Note that each behavior in𝑍 βŠ† Ucan be β€œlifted” to a set of behaviors inUby letting variables that are not contained in 𝑍 assume all possible values in their domains.

Additionally, the set of behaviorsB (𝑍)can be lifted to a set of behaviors in B (U) in a similar way. To ease notational burden for the reader, we will take the liberty of not explicitly making any reference to the β€œlifting” operation when they are in use unless there is any ambiguity that may result from doing so.

Definition 4.3.6(Constraint). A constraint π‘˜ on a set of variables 𝑍 is a function that maps each behavior of 𝑍 to an element of B, the Boolean domain. In other words,π‘˜ ∈BB (𝑍).

Note that by β€œlifting”, a constraint on a set of variables𝑍 is also a constraint onU. Definition 4.3.7(Channel variables). For each component𝑋and another component π‘Œ, we can define two types ofchannel variables:

β€’ π‘‹β†π‘Œ, denoting an incoming information flow fromπ‘Œ to 𝑋,

β€’ π‘‹β†’π‘Œ, denoting an outcoming information flow from 𝑋 toπ‘Œ.

In this work, we assume thatπ‘‹β†’π‘Œ is always identical toπ‘Œβ†π‘‹. Each channel variable must have a well-defined message type and each message π‘š has an ID denoted by id(π‘š) ∈ Id. If the message has value𝑣, then we will denote it by[𝑣 ,id(π‘š)], but we will often refer to it as[𝑣]whereby we omit the ID part to simplify the presentation.

Intuitively, given a behavior, a channel variableπ‘₯is a function that maps each time step to the message the associated channel is broadcasting at that time step.

Definition 4.3.8(System). Asystem𝑀 consists of a set of each of the following 1. internal variables/constants var𝑀𝑋,

2. output channel variables varπ‘Œπ‘€, 3. input channel variables varπ‘ˆπ‘€,

4. constraints con𝑀 on var𝑀𝑋 βˆͺvarπ‘Œπ‘€βˆͺvarπ‘ˆπ‘€.

A behavior of a system 𝑀 is an element of the set of behaviors that correspond to var𝑀𝑋 βˆͺvarπ‘Œπ‘€βˆͺvarπ‘ˆπ‘€ subject to con𝑀. This is denoted byB (𝑀).

Directive-response

Before introducing directive-response systems, for any predicates𝐴and𝐡, we define the following syntax:

𝐴 { 𝐡 Bβˆ€π‘‘ :: 𝐴(𝑑) β‡’ βˆƒπ‘‘0β‰₯ 𝑑 :: 𝐡(𝑑0). (β€œleads to”) 𝐴 𝐡 Bβˆ€π‘‘ :: 𝐡(𝑑) β‡’ βˆƒπ‘‘0 ≀𝑑 :: 𝐴(𝑑0). (β€œprecedes”) β‰₯𝑑𝐴 Bβˆ€π‘‘0β‰₯ 𝑑 :: 𝐴(𝑑0). (β€œalways from𝑑”) starts_at(𝐴, 𝑑) B 𝐴(𝑑) ∧ βˆ€π‘‘0< 𝑑 ::¬𝐴(𝑑0). (4.1) If𝑀 is a set-valued variable, then we define

persistent(𝑀) Bβˆ€π‘‘ ::βˆ€π‘š ::π‘š ∈ 𝑀(𝑑) β‡’ β‰₯𝑑(π‘š ∈ 𝑀). (4.2) Definition 4.3.9 (Directive-response system). A directive-response system 𝑀 is a system such that for each output (resp., input) channel variable 𝑐 β„Žπ‘Žπ‘› there is an internal variablesend𝑐 β„Žπ‘Žπ‘› (resp.,receive𝑐 β„Žπ‘Žπ‘›) whose domain is a collection of sets of messages that are of the type associated with𝑐 β„Žπ‘Žπ‘›. If𝑐 β„Žπ‘Žπ‘›is an output channel variable, there is a causality constraintπ‘˜π‘ β„Žπ‘Žπ‘› ∈con𝑀 defined by

π‘˜π‘ β„Žπ‘Žπ‘› Bπ‘š ∈send𝑐 π‘š =𝑐 β„Žπ‘Žπ‘›. (4.3)

That is, a message must be sent before it shows in the channel. Otherwise if𝑐 β„Žπ‘Žπ‘› is an input channel variable, then

π‘˜π‘ β„Žπ‘Žπ‘› B π‘š =𝑐 β„Žπ‘Žπ‘› π‘š ∈receive𝑐 β„Žπ‘Žπ‘›. (4.4)

Namely, a message cannot be received before it is broadcasted.

Definition 4.3.10(Lossless directive-response system). A lossless directive-response system is a directive-response system such that if𝑐 β„Žπ‘Žπ‘› is an output channel, then

persistent(send𝑐 β„Žπ‘Žπ‘›) ∧ (π‘š ∈send𝑐 β„Žπ‘Žπ‘› {π‘š =𝑐 β„Žπ‘Žπ‘›), (4.5) and if𝑐 β„Žπ‘Žπ‘›is an input channel

persistent(receive𝑐 β„Žπ‘Žπ‘›) ∧ (π‘š=𝑐 β„Žπ‘Žπ‘› { π‘š ∈receive𝑐 β„Žπ‘Žπ‘›). (4.6) Definition 4.3.11(Assume-guarantee contracts for directive-response systems). An assume-guarantee contract C for a directive-response system 𝑀 consists of a pair of behaviors 𝐴, 𝐺 of 𝑀 and denoted byC = (𝐴, 𝐺). An environment forC is any set of all behaviors that are contained in 𝐴while an implementation ofCis any set of behaviors that is contained in 𝐴 ⇒𝐺. Cis said to be saturated if the guarantee part satisfies𝐺 = (¬𝐴∨𝐺) = (𝐴⇒𝐺).

Note that any contract can be converted to the saturated form without changing its sets of environments and implementations. The saturated form is useful in making contract algebra less cumbersome in general. If 𝑀 is a system, then we say 𝑀 satisfies Cif B (𝑀) βŠ† (𝐴 β‡’ 𝐺). Furthermore, the system composition 𝑀1Γ— 𝑀2 of𝑀1and𝑀2is a system whose behavior is equal toB (𝑀1) ∩ B (𝑀2).

Definition 4.3.12 (Customer). A customer is an element of C. Corresponding to each𝑐 ∈ Cis a set ofU variables var(𝑐) that include𝑐 .π‘₯, 𝑐 . 𝑦 (the coordinates of the customer him/herself), 𝑐 .π‘π‘Žπ‘Ÿ .π‘₯, 𝑐 .π‘π‘Žπ‘Ÿ . 𝑦, 𝑐 .π‘π‘Žπ‘Ÿ .πœƒ (the coordinates and heading of the customer’s car), 𝑐 .π‘π‘Žπ‘Ÿ . β„Žπ‘’ π‘Žπ‘™ 𝑑 β„Ž 𝑦, whether the car is healthy, 𝑐 .π‘π‘œπ‘›π‘‘π‘Ÿ π‘œπ‘™ 𝑠.𝑣, 𝑐 .π‘π‘œπ‘›π‘‘π‘Ÿ π‘œπ‘™ 𝑠. πœ‘(the velocity and steering inputs to the vehicle),𝑐 .π‘π‘Žπ‘Ÿ .β„“(the length of the car),𝑐 .π‘π‘Žπ‘Ÿ .𝑑 π‘œπ‘€ 𝑒 𝑑 (whether the car is being towed). We will use the shorthand 𝑐 .π‘π‘Žπ‘Ÿ .𝑠𝑑 π‘Žπ‘‘ 𝑒to mean the 3-tuple (𝑐 .π‘π‘Žπ‘Ÿ .π‘₯ , 𝑐 .π‘π‘Žπ‘Ÿ . 𝑦, 𝑐 .π‘π‘Žπ‘Ÿ .πœƒ).

For each behavior inB (U), we require each𝑐 ∈Cfor which𝑐 .π‘π‘Žπ‘Ÿ .𝑑 π‘œπ‘€ 𝑒 𝑑isFalse to satisfy the following constraints that describe the Dubins car model:

𝑑(𝑐 .π‘π‘Žπ‘Ÿ .π‘₯) 𝑑 𝑑

(𝑑) =𝑐 .π‘π‘œπ‘›π‘‘π‘Ÿ π‘œπ‘™ 𝑠.𝑣(𝑑)cos(𝑐 .π‘π‘Žπ‘Ÿ .πœƒ(𝑑)) 𝑑(𝑐 .π‘π‘Žπ‘Ÿ . 𝑦)

𝑑 𝑑

(𝑑) =𝑐 .π‘π‘œπ‘›π‘‘π‘Ÿ π‘œπ‘™ 𝑠.𝑣(𝑑)sin(𝑐 .π‘π‘Žπ‘Ÿ .πœƒ(𝑑)) 𝑑(𝑐 .π‘π‘Žπ‘Ÿ .πœƒ)

𝑑 𝑑

(𝑑) = 𝑐 .π‘π‘œπ‘›π‘‘π‘Ÿ π‘œπ‘™ 𝑠.𝑣(𝑑) 𝑐 .π‘π‘Žπ‘Ÿ .β„“

tan(𝑐 .π‘π‘œπ‘›π‘‘π‘Ÿ π‘œπ‘™ 𝑠. πœ‘(𝑑)).

(4.7)

Table 4.1: CustomerInterfacedirective-response system.

Internal variables/constantsvar𝑋

C The set of all customers in the AVP world.

Outputsvarπ‘Œ

CustomerInterfaceβ†’Supervisor An output channel of type ˜A(CustomerInterface). Inputsvarπ‘ˆ

CustomerInterface←Supervisor An input channel of type ˜B(Supervisor).

CustomerInterface←Tracker An input channel of type ˜A(Tracker).

Constraintscon𝑀

Vehicle dynamics See (4.7)

Car and pedestrian limits (4.8) and (4.9).

AVP System

By treating theCustomerInterfaceas an external component, the AVP system con- sists of three internal components: Supervisor, Planner, and Tracker. These systems are described below.

CustomerInterface

The environment in which the system shall operate consists of the customers and the pedestrians which we will call a CustomerInterface. A customer drops off the car at the drop-off location and is assumed to make a request for the parked car back from the garage eventually. The pedestrians are also controlled by the environment.

When a pedestrian was generated by the environment, they start walking on the crosswalks. Pedestrians are confined to the pedestrian path, meaning they will not leave the crosswalk and walkway areas and their dynamics are continuous, meaning no sudden jumps. The cars move according to their specified dynamics. This includes a breaking distance depending on their velocity and maximum allowed curvature. For a formal description, refer to Table 4.1. Below are some constraints we impose on this module.

βˆ€π‘ ∈C::(𝑣min ≀ 𝑐 .π‘π‘œπ‘›π‘‘π‘Ÿ π‘œπ‘™ 𝑠.π‘£βˆ§π‘ .π‘π‘œπ‘›π‘‘π‘Ÿ π‘œπ‘™ 𝑠.𝑣 ≀ 𝑣max

βˆ§πœ‘min ≀ 𝑐 .π‘π‘œπ‘›π‘‘π‘Ÿ π‘œπ‘™ 𝑠. πœ‘βˆ§π‘ .π‘π‘œπ‘›π‘‘π‘Ÿ π‘œπ‘™ 𝑠. πœ‘ ≀ πœ‘max) (4.8)

βˆ€π‘βˆˆC::βˆ€π‘ .

𝑑(𝑐 .π‘₯) 𝑑 𝑑

(𝑠),

𝑑(𝑐 . 𝑦) 𝑑 𝑑

(𝑠)

≀ 𝑣𝑝 𝑒 𝑑 ,max. (4.9) Supervisor

A Supervisor component is responsible for the high level decision making in the process. It receives theCustomerInterface: requests and processes them by sending

Table 4.2: Supervisordirective-response system.

Internal variables/constantsvar𝑋

G.βˆ— AllGobjects.

π‘›π‘’π‘š_π‘Ž 𝑐𝑑𝑖 𝑣 𝑒_𝑐𝑒 𝑠𝑑 π‘œπ‘š π‘’π‘Ÿ 𝑠 The number of cars currently being served in the parking lot.

Outputsvarπ‘Œ

Supervisorβ†’CustomerInterface An output channel of type ˜B(Supervisor).

Supervisorβ†’Planner An output channel of type ˜A(Supervisor).

Inputsvarπ‘ˆ

Supervisor←CustomerInterface An input channel of type ˜A(CustomerInterface). Supervisor←Planner An input channel of type ˜B(Planner).

Constraintscon𝑀

Parking lot topology Any specific geometric constraints onG.βˆ—.

Number of active customers π‘›π‘’π‘š_π‘Ž 𝑐𝑑𝑖 𝑣 𝑒_𝑐𝑒 𝑠𝑑 π‘œπ‘š π‘’π‘Ÿ 𝑠must be equal to the num- ber of cars that have been accepted but not yet left the parking lot.

Table 4.3: Plannerdirective-response system.

Interval variables/constantsvar𝑋

G.βˆ— AllGobjects.

{𝑐 .π‘π‘Žπ‘Ÿ .π‘₯ , 𝑐 .π‘π‘Žπ‘Ÿ . 𝑦, 𝑐 .π‘π‘Žπ‘Ÿ .πœƒ|π‘βˆˆC} The configurations of all cars in AVP world.

πœ… Maximum allowable curvature.

Outputsvarπ‘Œ

Plannerβ†’Supervisor An output channel of type ˜B(Planner).

Plannerβ†’Tracker An output channel of type ˜A(Planner).

Inputsvarπ‘ˆ

Planner←Supervisor An input channel of type ˜A(Supervisor).

Planner←Tracker An input channel of type ˜B(Tracker).

Constraintscon𝑀

Parking lot topology Any specific geometric constraints onG.βˆ—.

πœ… Maximum allowable curvature given car dynamics

and input constraints.

the appropriate directives to thePlannerto fulfill a task. ASupervisordetermines whether a car can be accepted into the garage or rejected. It also receives responses from thePlanner. ASupervisoris to be aware of the reachability, the vacancy, and occupied spaces in the lot, as well as the parking lot layout. Formally, aSupervisor is a lossless directive-response system described by Table 4.2.

Planner

A Planner system receives directives from the Supervisor to make a car reach a specific location in the parking lot. APlannersystem may have access to a planning graph determined from the parking lot layout, and thus can generate executable trajectories for the cars to follow. ThePlanneris aware of the locations of the agents and the obstacles in the parking lot from the camera system. APlanneris a lossless directive-response system described by Table 4.3.

Table 4.4: Trackerdirective-response system.

Interval variables/constantsvar𝑋

𝛿 Corridor map.

πœ€min, 𝑐 π‘Žπ‘Ÿ Minimum safety distance to other cars.

πœ€min, 𝑝 π‘’π‘œ 𝑝𝑙 𝑒 Minimum safety distance to pedestrians.

Outputsvarπ‘Œ

Trackerβ†’Planner An output channel of type ˜B(Tracker).

Trackerβ†’CustomerInterface An output channel of type ˜A(Tracker).

Inputsvarπ‘ˆ

Tracker←Planner An input channel of type ˜A(Planner).

Constraintscon𝑀

Corridor constraints In our implementation, we define the𝛿-corridor for any path𝑝to be the open set containing points whose distance to the closest point in𝑝does not exceed 3 meters.

πœ€min, 𝑐 π‘Žπ‘Ÿ,πœ€min, 𝑝 π‘’π‘œ 𝑝𝑙 𝑒 These values are determined based on the dynamics and the uncertaintyΔ𝐢 π‘Žπ‘Ÿ.

l Figure 4.2: Contracts between the components of the AVP system.

Tracker

A Tracker system is responsible for the safe control of cars that are accepted into the garage by a Supervisor. It receives directives from a Planner consisting of executable paths to track and send responses based on the task status to aPlanner.

See Table 4.4.