Aufgrund einer Wartung wird GitLab am 25.01 zwischen 8:00 und 9:00 Uhr kurzzeitig nicht zur Verfügung stehen. / Due to maintenance, GitLab will be temporarily unavailable on 25.01 between 8:00 and 9:00 am.

MainController.emam 1.93 KB
Newer Older
Bernhard Rumpe's avatar
BR-sy    
Bernhard Rumpe committed
1
/* (c) https://github.com/MontiCore/monticore */
Jean-Marc Ronck's avatar
Jean-Marc Ronck committed
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
package controller03;

import VelocityController;
import SearchParkingPlaceController;
import ParkingController;

component MainController{
    ports 
        in Q(-200m:200m) frontLeftSensor,
        in Q(-200m:200m) frontRightSensor,
        in Q(-200m:200m) frontLeftSideSensor,
        in Q(-200m:200m) frontRightSideSensor,
        in Q(-200m:200m) backLeftSideSensor,
        in Q(-200m:200m) backRightSideSensor,
        in Q(-200m:200m) backLeftSensor,
        in Q(-200m:200m) backRightSensor,

        in Q time,
        in Q(0km/h:250km/h) velocity,

        in Q(-200m:200m) x,
        in Q(-200m:200m) y,

        out Q(-2m/s^2:2m/s^2) acceleration,
        out Q(-180:180) steering,
        out B status;


    instance VelocityController velocityController;

    connect velocity->velocityController.velocity;
    connect velocityController.acceleration->acceleration;

    instance SearchParkingPlaceController searchParkingPlaceController;

    connect frontLeftSideSensor->searchParkingPlaceController.frontLeftSideSensor;
    connect backLeftSideSensor->searchParkingPlaceController.backLeftSideSensor;
    
    instance ParkingController parkingController;
    
    connect backLeftSensor->parkingController.backLeftSensor;
    connect backRightSensor->parkingController.backRightSensor;
    connect frontRightSensor->parkingController.frontRightSensor;
    connect frontLeftSensor->parkingController.frontLeftSensor;
    connect frontLeftSideSensor->parkingController.frontLeftSideSensor;
    connect backLeftSideSensor->parkingController.backLeftSideSensor;
    connect searchParkingPlaceController.foundPlace->velocityController.reverseMove;
    connect searchParkingPlaceController.foundPlace->parkingController.reverseMove;
    connect parkingController.steeringAngle->steering;
    connect parkingController.status->status;
    
    connect parkingController.moveForward->velocityController.moveForward;
Bernhard Rumpe's avatar
BR-sy    
Bernhard Rumpe committed
54
}