This repository has been archived by the owner on Oct 14, 2023. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtypes.go
89 lines (75 loc) · 2.76 KB
/
types.go
1
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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
package main
// General purpose structures
// the "__,string" nomer is necessary due to MP endpoint returning numbers as strings, will remove when thats updated
type AircraftStatus struct { // not stored in the database! maintained in memory, live,
Velocity float64 `json:"velocity"`
Longitude float64 `json:"longitude"`
Latitude float64 `json:"latitude"`
Altitude float64 `json:"altitude"`
Heading float64 `json:"heading"`
BatteryVoltage float64 `json:"voltage"`
}
type Waypoint struct {
ID int `json:"id"`
Name string `json:"name"`
Longitude float64 `json:"longitude"`
Latitude float64 `json:"latitude"`
Altitude float64 `json:"altitude"`
}
// type Queue []Waypoint
// wraps a []Waypoint for easier MP compatibility
type Queue struct {
Queue []Waypoint `json:"queue"`
}
//pathfinding structures
//reduced struct for pathfinding-necessary info
type PFRoute struct {
ID int `json:"routeID"`
WaypointIDs []int `json:"waypointIds"`
Value float64 `json:"dollarValue"`
}
type PathfindingInput struct {
NumWaypoints int `json:"numWaypoints"`
NumRoutes int `json:"numRoutes"`
WPQueue []Waypoint `json:"waypoints"`
RouteQueue []PFRoute `json:"routes"`
RouteFinder RouteFinder `json:"RouteFinder"`
ReRouter ReRouter `json:"ReRouter"`
AEACRoutes []AEACRoutes `json:"aeacRoutes"` //to easily fetch the correct route struct after pf is done
}
type RouteFinder struct {
// RouteIDs []int `json:"routeIds"`
// MaxFlyingDistance float64 `json:"maxFlyingDistance"`
Speed float64 `json:"speed"`
Altitude float64 `json:"altitude"`
ClimbRate float64 `json:"climbRate"`
StartingWaypointID int `json:"startingWaypointId"`
}
type ReRouter struct {
CurrentLong float64 `json:"currentLong"`
CurrentLat float64 `json:"currentLat"`
WaypointObstacleIDs []int `json:"waypointObstacleIds"`
ReRouteWaypointID int `json:"reRouteWaypointId"`
}
// AEAC specific structures
type AEACRoutes struct {
ID int `json:"id"`
Number int `json:"number"`
StartWaypoint string `json:"start_waypoint"` // Name of the waypoint
EndWaypoint string `json:"end_waypoint"` // Name of the waypoint
Passengers int `json:"passengers"`
MaxVehicleWeight float64 `json:"max_vehicle_weight"`
Value float64 `json:"value"`
Remarks string `json:"remarks"`
Order int `json:"order"`
}
// SUAS specific structures
type RestrictedArea struct {
ID int `json:"id"`
Bounds []Waypoint `json:"bounds"`
RejoinPoint Waypoint `json:"rejoin_at"`
}
type JSONResponse struct {
Type string `json:"type"`
Message string `json:"message"`
}