1// =============================================================================
2// PROJECT CHRONO - http://projectchrono.org
3//
4// Copyright (c) 2020 projectchrono.org
5// All rights reserved.
6//
7// Use of this source code is governed by a BSD-style license that can be found
8// in the LICENSE file at the top level of the distribution and at
9// http://projectchrono.org/license-chrono.txt.
10//
11// =============================================================================
12// Authors: Aaron Young
13// =============================================================================
14//
15// Schema file that defines state synchronization and initial information for an
16// agent.
17//    - State data should allow a zombie agent to be re-created in other worlds
18//    - Description data allows an initial zombie agent to be created
19//
20// =============================================================================
21
22include "SPAT.fbs";
23include "MAP.fbs";
24include "Utils.fbs";
25
26// Derived "class" of Agent
27// Creates a vehicle agent message
28namespace SynFlatBuffers.Agent.WheeledVehicle;
29
30table State {
31  time:double;
32
33  chassis:Pose;
34
35  wheels:[Pose];
36}
37
38table Description {
39  chassis_vis_file:string;
40  wheel_vis_file:string;
41  tire_vis_file:string;
42
43  num_wheels:int;
44}
45
46root_type State;
47
48// Derived "class" of Agent
49// Creates a vehicle agent message
50namespace SynFlatBuffers.Agent.TrackedVehicle;
51
52table State {
53  time:double;
54
55  chassis:Pose;
56
57  track_shoes:[Pose];
58  sprockets:[Pose];
59  idlers:[Pose];
60  road_wheels:[Pose];
61}
62
63table Description {
64  chassis_vis_file:string;
65  track_shoe_vis_file:string;
66  left_sprocket_vis_file:string;
67  right_sprocket_vis_file:string;
68  left_idler_vis_file:string;
69  right_idler_vis_file:string;
70  left_road_wheel_vis_file:string;
71  right_road_wheel_vis_file:string;
72
73  num_track_shoes:int;
74  num_sprockets:int;
75  num_idlers:int;
76  num_road_wheels:int;
77}
78
79root_type State;
80
81// Derived "class" of Agent
82// Creates a copter agent message
83namespace SynFlatBuffers.Agent.Copter;
84
85table State {
86  time:double;
87
88  chassis:Pose;
89
90  propellers:[Pose];
91}
92
93table Description {
94  chassis_vis_file:string;
95  propeller_vis_file:string;
96
97  num_props:int;
98}
99
100root_type State;
101
102namespace SynFlatBuffers.Agent.Environment;
103
104table State {
105  map:SynFlatBuffers.Message; // MAP.State
106  spat:SynFlatBuffers.Message; // SPAT.State
107}
108
109// Do need a description message (even if blank) to initialize everything
110table Description {}
111
112root_type State;
113
114// Base "class"
115// Creates an agent message
116namespace SynFlatBuffers.Agent;
117
118union Type {
119  WheeledVehicle.State,
120  WheeledVehicle.Description,
121  TrackedVehicle.State,
122  TrackedVehicle.Description,
123  Environment.State,
124  Environment.Description,
125  Copter.State,
126  Copter.Description
127}
128
129table State {
130  message:Type;
131}
132
133table Description {
134  description:Type;
135  json:string;
136}
137
138root_type State;
139