forked from f1tenth/f1tenth_gym
-
Notifications
You must be signed in to change notification settings - Fork 0
/
sim_requests.proto
181 lines (156 loc) · 4.96 KB
/
sim_requests.proto
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
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
// MIT License
// Copyright (c) 2020 Joseph Auckley, Matthew O'Kelly, Aman Sinha, Hongrui Zheng
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
// The above copyright notice and this permission notice shall be included in all
// copies or substantial portions of the Software.
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
// SOFTWARE.
syntax = 'proto3';
package racecar_simulator_standalone;
message MapRequest {
// request message for updating map
repeated double map = 1;
double origin_x = 2;
double origin_y = 3;
double map_resolution = 4;
double free_threshold = 5;
int32 map_height = 6;
int32 map_width = 7;
}
message MapResponse {
// response message for updating map
// 0 is success, 1 is failure
int32 result = 1;
}
message PoseRequest {
// request message for setting pose
double pose_x = 1;
double pose_y = 2;
double pose_theta = 3;
}
message PoseResponse {
// response message for setting pose
repeated double scan = 1;
double angle_min = 2;
double angle_max = 3;
}
message CarObservation {
// full state observation for EACH car
// bare minimum at the moment
// scan stuff
repeated double scan = 1;
// odom stuff
// position
double pose_x = 2;
double pose_y = 3;
// orientation
double theta = 4;
// velocities
double linear_vel_x = 5;
double linear_vel_y = 6;
double ang_vel_z = 7;
// collision
bool collision = 8;
double collision_angle = 9;
}
message SimObservation {
// observations for all agents in sim
repeated CarObservation observations = 1;
int32 ego_idx = 2;
}
message StepRequest {
// request for stepping the sim
// should have all cars' requested actions
int32 ego_idx = 1;
repeated double requested_vel = 2;
repeated double requested_ang = 3;
}
message StepResponse {
// response message for stepping if failure
// 1 is failure
// should not receive this with result other than failure
int32 result = 1;
}
message SimResetRequest {
// request for reinitialize sim
int32 num_cars = 1;
int32 ego_idx = 2;
}
message SimResetResponse {
// response for reinitialize sim
// 0 success, 1 failure
int32 result = 1;
}
message SimResetByPoseRequest {
// request for reinitializing sim at given pose
int32 num_cars = 1;
int32 ego_idx = 2;
repeated double car_x = 3;
repeated double car_y = 4;
repeated double car_theta = 5;
}
message UpdateParamRequest {
// request for param update
double mu = 1;
double h_cg = 2;
double l_r = 3;
double cs_f = 4;
double cs_r = 5;
double I_z = 6;
double mass = 7;
}
message UpdateParamResponse {
// response for update param
// 0 success, 1 failure
int32 result = 1;
}
message AddObstacleRequest {
// request for adding obstacle (from click in rviz)
double index = 1;
double obstacle_size = 2;
double flag = 3;
}
message SimRequest {
// wrapper for all request sent to sim server
// types of requests: 0 - step the sim
// 1 - set the map for sim
// 2 - reset sim
// 3 - update params
// 4 - reset sim by pose
// 7 - add obstacle (from click in rviz)
int32 type = 1;
oneof request {
StepRequest step_request = 2;
MapRequest map_request = 3;
SimResetRequest reset_request = 4;
SimResetByPoseRequest reset_bypose_request = 5;
UpdateParamRequest update_request = 6;
AddObstacleRequest add_obstacle_request = 7;
}
}
message SimResponse {
// wrapper for all response from the sim server
// types of responses: 0 - step response (full obs)
// 1 - step failed response (no map)
// 2 - map response
// 3 - reset sim response
// 4 - update sim response
int32 type = 1;
oneof response {
SimObservation sim_obs = 2;
StepResponse step_result = 3;
MapResponse map_result = 4;
SimResetResponse reset_resp = 5;
UpdateParamResponse update_resp = 6;
}
}