luckyrobots 0.1.71__py3-none-any.whl → 0.1.73__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- luckyrobots/__init__.py +5 -32
- luckyrobots/client.py +90 -458
- luckyrobots/config/robots.yaml +72 -48
- luckyrobots/engine/__init__.py +5 -20
- luckyrobots/grpc/generated/agent_pb2.py +7 -3
- luckyrobots/grpc/generated/agent_pb2_grpc.py +46 -0
- luckyrobots/grpc/generated/scene_pb2.py +13 -3
- luckyrobots/grpc/generated/scene_pb2_grpc.py +88 -0
- luckyrobots/grpc/proto/agent.proto +29 -0
- luckyrobots/grpc/proto/scene.proto +34 -0
- luckyrobots/luckyrobots.py +37 -6
- luckyrobots/models/__init__.py +2 -14
- luckyrobots/models/observation.py +4 -33
- luckyrobots/utils.py +1 -43
- {luckyrobots-0.1.71.dist-info → luckyrobots-0.1.73.dist-info}/METADATA +1 -1
- {luckyrobots-0.1.71.dist-info → luckyrobots-0.1.73.dist-info}/RECORD +18 -22
- luckyrobots/engine/check_updates.py +0 -264
- luckyrobots/engine/download.py +0 -125
- luckyrobots/models/camera.py +0 -97
- luckyrobots/models/randomization.py +0 -77
- {luckyrobots-0.1.71.dist-info → luckyrobots-0.1.73.dist-info}/WHEEL +0 -0
- {luckyrobots-0.1.71.dist-info → luckyrobots-0.1.73.dist-info}/licenses/LICENSE +0 -0
luckyrobots/config/robots.yaml
CHANGED
|
@@ -149,103 +149,127 @@ unitreego1:
|
|
|
149
149
|
- locomotion
|
|
150
150
|
action_space:
|
|
151
151
|
actuator_names:
|
|
152
|
-
-
|
|
153
|
-
-
|
|
154
|
-
-
|
|
155
|
-
-
|
|
156
|
-
-
|
|
157
|
-
-
|
|
158
|
-
-
|
|
159
|
-
-
|
|
160
|
-
-
|
|
161
|
-
-
|
|
162
|
-
-
|
|
163
|
-
-
|
|
152
|
+
- FR_hip_joint
|
|
153
|
+
- FR_thigh_joint
|
|
154
|
+
- FR_calf_joint
|
|
155
|
+
- FL_hip_joint
|
|
156
|
+
- FL_thigh_joint
|
|
157
|
+
- FL_calf_joint
|
|
158
|
+
- RR_hip_joint
|
|
159
|
+
- RR_thigh_joint
|
|
160
|
+
- RR_calf_joint
|
|
161
|
+
- RL_hip_joint
|
|
162
|
+
- RL_thigh_joint
|
|
163
|
+
- RL_calf_joint
|
|
164
164
|
actuator_limits:
|
|
165
|
-
- name:
|
|
165
|
+
- name: FR_hip_joint
|
|
166
166
|
lower: -0.863
|
|
167
167
|
upper: 0.863
|
|
168
|
-
|
|
168
|
+
default: 0.1
|
|
169
|
+
- name: FR_thigh_joint
|
|
169
170
|
lower: -0.686
|
|
170
171
|
upper: 4.501
|
|
171
|
-
|
|
172
|
+
default: 0.9
|
|
173
|
+
- name: FR_calf_joint
|
|
172
174
|
lower: -2.818
|
|
173
175
|
upper: -0.888
|
|
174
|
-
|
|
176
|
+
default: -1.8
|
|
177
|
+
- name: FL_hip_joint
|
|
175
178
|
lower: -0.863
|
|
176
179
|
upper: 0.863
|
|
177
|
-
|
|
180
|
+
default: -0.1
|
|
181
|
+
- name: FL_thigh_joint
|
|
178
182
|
lower: -0.686
|
|
179
183
|
upper: 4.501
|
|
180
|
-
|
|
184
|
+
default: 0.9
|
|
185
|
+
- name: FL_calf_joint
|
|
181
186
|
lower: -2.818
|
|
182
187
|
upper: -0.888
|
|
183
|
-
|
|
188
|
+
default: -1.8
|
|
189
|
+
- name: RR_hip_joint
|
|
184
190
|
lower: -0.863
|
|
185
191
|
upper: 0.863
|
|
186
|
-
|
|
192
|
+
default: 0.1
|
|
193
|
+
- name: RR_thigh_joint
|
|
187
194
|
lower: -0.686
|
|
188
195
|
upper: 4.501
|
|
189
|
-
|
|
196
|
+
default: 0.9
|
|
197
|
+
- name: RR_calf_joint
|
|
190
198
|
lower: -2.818
|
|
191
199
|
upper: -0.888
|
|
192
|
-
|
|
200
|
+
default: -1.8
|
|
201
|
+
- name: RL_hip_joint
|
|
193
202
|
lower: -0.863
|
|
194
203
|
upper: 0.863
|
|
195
|
-
|
|
204
|
+
default: -0.1
|
|
205
|
+
- name: RL_thigh_joint
|
|
196
206
|
lower: -0.686
|
|
197
207
|
upper: 4.501
|
|
198
|
-
|
|
208
|
+
default: 0.9
|
|
209
|
+
- name: RL_calf_joint
|
|
199
210
|
lower: -2.818
|
|
200
211
|
upper: -0.888
|
|
212
|
+
default: -1.8
|
|
201
213
|
observation_space:
|
|
202
214
|
actuator_names:
|
|
203
|
-
-
|
|
204
|
-
-
|
|
205
|
-
-
|
|
206
|
-
-
|
|
207
|
-
-
|
|
208
|
-
-
|
|
209
|
-
-
|
|
210
|
-
-
|
|
211
|
-
-
|
|
212
|
-
-
|
|
213
|
-
-
|
|
214
|
-
-
|
|
215
|
+
- FR_hip_joint
|
|
216
|
+
- FR_thigh_joint
|
|
217
|
+
- FR_calf_joint
|
|
218
|
+
- FL_hip_joint
|
|
219
|
+
- FL_thigh_joint
|
|
220
|
+
- FL_calf_joint
|
|
221
|
+
- RR_hip_joint
|
|
222
|
+
- RR_thigh_joint
|
|
223
|
+
- RR_calf_joint
|
|
224
|
+
- RL_hip_joint
|
|
225
|
+
- RL_thigh_joint
|
|
226
|
+
- RL_calf_joint
|
|
215
227
|
actuator_limits:
|
|
216
|
-
- name:
|
|
228
|
+
- name: FR_hip_joint
|
|
217
229
|
lower: -0.863
|
|
218
230
|
upper: 0.863
|
|
219
|
-
|
|
231
|
+
default: 0.1
|
|
232
|
+
- name: FR_thigh_joint
|
|
220
233
|
lower: -0.686
|
|
221
234
|
upper: 4.501
|
|
222
|
-
|
|
235
|
+
default: 0.9
|
|
236
|
+
- name: FR_calf_joint
|
|
223
237
|
lower: -2.818
|
|
224
238
|
upper: -0.888
|
|
225
|
-
|
|
239
|
+
default: -1.8
|
|
240
|
+
- name: FL_hip_joint
|
|
226
241
|
lower: -0.863
|
|
227
242
|
upper: 0.863
|
|
228
|
-
|
|
243
|
+
default: -0.1
|
|
244
|
+
- name: FL_thigh_joint
|
|
229
245
|
lower: -0.686
|
|
230
246
|
upper: 4.501
|
|
231
|
-
|
|
247
|
+
default: 0.9
|
|
248
|
+
- name: FL_calf_joint
|
|
232
249
|
lower: -2.818
|
|
233
250
|
upper: -0.888
|
|
234
|
-
|
|
251
|
+
default: -1.8
|
|
252
|
+
- name: RR_hip_joint
|
|
235
253
|
lower: -0.863
|
|
236
254
|
upper: 0.863
|
|
237
|
-
|
|
255
|
+
default: 0.1
|
|
256
|
+
- name: RR_thigh_joint
|
|
238
257
|
lower: -0.686
|
|
239
258
|
upper: 4.501
|
|
240
|
-
|
|
259
|
+
default: 0.9
|
|
260
|
+
- name: RR_calf_joint
|
|
241
261
|
lower: -2.818
|
|
242
262
|
upper: -0.888
|
|
243
|
-
|
|
263
|
+
default: -1.8
|
|
264
|
+
- name: RL_hip_joint
|
|
244
265
|
lower: -0.863
|
|
245
266
|
upper: 0.863
|
|
246
|
-
|
|
267
|
+
default: -0.1
|
|
268
|
+
- name: RL_thigh_joint
|
|
247
269
|
lower: -0.686
|
|
248
270
|
upper: 4.501
|
|
249
|
-
|
|
271
|
+
default: 0.9
|
|
272
|
+
- name: RL_calf_joint
|
|
250
273
|
lower: -2.818
|
|
251
274
|
upper: -0.888
|
|
275
|
+
default: -1.8
|
luckyrobots/engine/__init__.py
CHANGED
|
@@ -1,23 +1,8 @@
|
|
|
1
1
|
"""Engine lifecycle management for LuckyEngine."""
|
|
2
2
|
|
|
3
|
-
from .
|
|
4
|
-
|
|
5
|
-
from .manager import (
|
|
6
|
-
find_luckyengine_executable,
|
|
7
|
-
is_luckyengine_running,
|
|
8
|
-
launch_luckyengine,
|
|
9
|
-
stop_luckyengine,
|
|
3
|
+
from luckyrobots.engine.manager import (
|
|
4
|
+
find_luckyengine_executable as find_luckyengine_executable,
|
|
10
5
|
)
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
"launch_luckyengine",
|
|
15
|
-
"stop_luckyengine",
|
|
16
|
-
"is_luckyengine_running",
|
|
17
|
-
"find_luckyengine_executable",
|
|
18
|
-
# Update functions
|
|
19
|
-
"check_updates",
|
|
20
|
-
"apply_changes",
|
|
21
|
-
"get_base_url",
|
|
22
|
-
"get_os_type",
|
|
23
|
-
]
|
|
6
|
+
from luckyrobots.engine.manager import is_luckyengine_running as is_luckyengine_running
|
|
7
|
+
from luckyrobots.engine.manager import launch_luckyengine as launch_luckyengine
|
|
8
|
+
from luckyrobots.engine.manager import stop_luckyengine as stop_luckyengine
|
|
@@ -28,7 +28,7 @@ from . import mujoco_pb2 as mujoco__pb2
|
|
|
28
28
|
from . import telemetry_pb2 as telemetry__pb2
|
|
29
29
|
|
|
30
30
|
|
|
31
|
-
DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x0b\x61gent.proto\x12\thazel.rpc\x1a\x0c\x63ommon.proto\x1a\x0bmedia.proto\x1a\x0cmujoco.proto\x1a\x0ftelemetry.proto\"\x81\x01\n\x0b\x41gentSchema\x12\x12\n\nagent_name\x18\x01 \x01(\t\x12\x19\n\x11observation_names\x18\x02 \x03(\t\x12\x14\n\x0c\x61\x63tion_names\x18\x03 \x03(\t\x12\x18\n\x10observation_size\x18\x04 \x01(\r\x12\x13\n\x0b\x61\x63tion_size\x18\x05 \x01(\r\"+\n\x15GetAgentSchemaRequest\x12\x12\n\nagent_name\x18\x01 \x01(\t\"@\n\x16GetAgentSchemaResponse\x12&\n\x06schema\x18\x01 \x01(\x0b\x32\x16.hazel.rpc.AgentSchema\"<\n\x12StreamAgentRequest\x12\x12\n\nagent_name\x18\x01 \x01(\t\x12\x12\n\ntarget_fps\x18\x02 \x01(\r\"\xa1\x03\n\x19\x44omainRandomizationConfig\x12\x1b\n\x13pose_position_noise\x18\x01 \x03(\x02\x12\x1e\n\x16pose_orientation_noise\x18\x02 \x01(\x02\x12\x1c\n\x14joint_position_noise\x18\x03 \x01(\x02\x12\x1c\n\x14joint_velocity_noise\x18\x04 \x01(\x02\x12\x16\n\x0e\x66riction_range\x18\x05 \x03(\x02\x12\x19\n\x11restitution_range\x18\x06 \x03(\x02\x12\x18\n\x10mass_scale_range\x18\x07 \x03(\x02\x12\x18\n\x10\x63om_offset_range\x18\x08 \x03(\x02\x12\x1c\n\x14motor_strength_range\x18\t \x03(\x02\x12\x1a\n\x12motor_offset_range\x18\n \x03(\x02\x12\x1b\n\x13push_interval_range\x18\x0b \x03(\x02\x12\x1b\n\x13push_velocity_range\x18\x0c \x03(\x02\x12\x14\n\x0cterrain_type\x18\r \x01(\t\x12\x1a\n\x12terrain_difficulty\x18\x0e \x01(\x02\"`\n\x11ResetAgentRequest\x12\x12\n\nagent_name\x18\x01 \x01(\t\x12\x37\n\tdr_config\x18\x02 \x01(\x0b\x32$.hazel.rpc.DomainRandomizationConfig\"6\n\x12ResetAgentResponse\x12\x0f\n\x07success\x18\x01 \x01(\x08\x12\x0f\n\x07message\x18\x02 \x01(\t\"\x87\x01\n\nAgentFrame\x12\x14\n\x0ctimestamp_ms\x18\x01 \x01(\x04\x12\x14\n\x0c\x66rame_number\x18\x02 \x01(\r\x12\x14\n\x0cobservations\x18\x03 \x03(\x02\x12\x0f\n\x07\x61\x63tions\x18\x04 \x03(\x02\x12\x12\n\nagent_name\x18\x05 \x01(\t\x12\x12\n\ntarget_fps\x18\x06 \x01(\r\"\x87\x01\n\x15GetCameraFrameRequest\x12!\n\x02id\x18\x01 \x01(\x0b\x32\x13.hazel.rpc.EntityIdH\x00\x12\x0e\n\x04name\x18\x02 \x01(\tH\x00\x12\r\n\x05width\x18\x03 \x01(\r\x12\x0e\n\x06height\x18\x04 \x01(\r\x12\x0e\n\x06\x66ormat\x18\x05 \x01(\tB\x0c\n\nidentifier\"_\n\x17GetViewportFrameRequest\x12\x15\n\rviewport_name\x18\x01 \x01(\t\x12\r\n\x05width\x18\x02 \x01(\r\x12\x0e\n\x06height\x18\x03 \x01(\r\x12\x0e\n\x06\x66ormat\x18\x04 \x01(\t\"\xfe\x01\n\x15GetObservationRequest\x12\x12\n\nrobot_name\x18\x01 \x01(\t\x12\x12\n\nagent_name\x18\x02 \x01(\t\x12\x1b\n\x13include_joint_state\x18\x03 \x01(\x08\x12\x1b\n\x13include_agent_frame\x18\x04 \x01(\x08\x12\x19\n\x11include_telemetry\x18\x05 \x01(\x08\x12\x31\n\x07\x63\x61meras\x18\x06 \x03(\x0b\x32 .hazel.rpc.GetCameraFrameRequest\x12\x35\n\tviewports\x18\x07 \x03(\x0b\x32\".hazel.rpc.GetViewportFrameRequest\"\xd4\x02\n\x16GetObservationResponse\x12\x0f\n\x07success\x18\x01 \x01(\x08\x12\x0f\n\x07message\x18\x02 \x01(\t\x12\x14\n\x0ctimestamp_ms\x18\x03 \x01(\x04\x12\x14\n\x0c\x66rame_number\x18\x04 \x01(\r\x12*\n\x0bjoint_state\x18\x05 \x01(\x0b\x32\x15.hazel.rpc.JointState\x12*\n\x0b\x61gent_frame\x18\x06 \x01(\x0b\x32\x15.hazel.rpc.AgentFrame\x12,\n\ttelemetry\x18\x07 \x01(\x0b\x32\x19.hazel.rpc.TelemetryFrame\x12\x31\n\rcamera_frames\x18\x08 \x03(\x0b\x32\x1a.hazel.rpc.NamedImageFrame\x12\x33\n\x0fviewport_frames\x18\t \x03(\x0b\x32\x1a.hazel.rpc.
|
|
31
|
+
DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x0b\x61gent.proto\x12\thazel.rpc\x1a\x0c\x63ommon.proto\x1a\x0bmedia.proto\x1a\x0cmujoco.proto\x1a\x0ftelemetry.proto\"\x81\x01\n\x0b\x41gentSchema\x12\x12\n\nagent_name\x18\x01 \x01(\t\x12\x19\n\x11observation_names\x18\x02 \x03(\t\x12\x14\n\x0c\x61\x63tion_names\x18\x03 \x03(\t\x12\x18\n\x10observation_size\x18\x04 \x01(\r\x12\x13\n\x0b\x61\x63tion_size\x18\x05 \x01(\r\"+\n\x15GetAgentSchemaRequest\x12\x12\n\nagent_name\x18\x01 \x01(\t\"@\n\x16GetAgentSchemaResponse\x12&\n\x06schema\x18\x01 \x01(\x0b\x32\x16.hazel.rpc.AgentSchema\"<\n\x12StreamAgentRequest\x12\x12\n\nagent_name\x18\x01 \x01(\t\x12\x12\n\ntarget_fps\x18\x02 \x01(\r\"\xa1\x03\n\x19\x44omainRandomizationConfig\x12\x1b\n\x13pose_position_noise\x18\x01 \x03(\x02\x12\x1e\n\x16pose_orientation_noise\x18\x02 \x01(\x02\x12\x1c\n\x14joint_position_noise\x18\x03 \x01(\x02\x12\x1c\n\x14joint_velocity_noise\x18\x04 \x01(\x02\x12\x16\n\x0e\x66riction_range\x18\x05 \x03(\x02\x12\x19\n\x11restitution_range\x18\x06 \x03(\x02\x12\x18\n\x10mass_scale_range\x18\x07 \x03(\x02\x12\x18\n\x10\x63om_offset_range\x18\x08 \x03(\x02\x12\x1c\n\x14motor_strength_range\x18\t \x03(\x02\x12\x1a\n\x12motor_offset_range\x18\n \x03(\x02\x12\x1b\n\x13push_interval_range\x18\x0b \x03(\x02\x12\x1b\n\x13push_velocity_range\x18\x0c \x03(\x02\x12\x14\n\x0cterrain_type\x18\r \x01(\t\x12\x1a\n\x12terrain_difficulty\x18\x0e \x01(\x02\"`\n\x11ResetAgentRequest\x12\x12\n\nagent_name\x18\x01 \x01(\t\x12\x37\n\tdr_config\x18\x02 \x01(\x0b\x32$.hazel.rpc.DomainRandomizationConfig\"6\n\x12ResetAgentResponse\x12\x0f\n\x07success\x18\x01 \x01(\x08\x12\x0f\n\x07message\x18\x02 \x01(\t\"\x87\x01\n\nAgentFrame\x12\x14\n\x0ctimestamp_ms\x18\x01 \x01(\x04\x12\x14\n\x0c\x66rame_number\x18\x02 \x01(\r\x12\x14\n\x0cobservations\x18\x03 \x03(\x02\x12\x0f\n\x07\x61\x63tions\x18\x04 \x03(\x02\x12\x12\n\nagent_name\x18\x05 \x01(\t\x12\x12\n\ntarget_fps\x18\x06 \x01(\r\"\x87\x01\n\x15GetCameraFrameRequest\x12!\n\x02id\x18\x01 \x01(\x0b\x32\x13.hazel.rpc.EntityIdH\x00\x12\x0e\n\x04name\x18\x02 \x01(\tH\x00\x12\r\n\x05width\x18\x03 \x01(\r\x12\x0e\n\x06height\x18\x04 \x01(\r\x12\x0e\n\x06\x66ormat\x18\x05 \x01(\tB\x0c\n\nidentifier\"_\n\x17GetViewportFrameRequest\x12\x15\n\rviewport_name\x18\x01 \x01(\t\x12\r\n\x05width\x18\x02 \x01(\r\x12\x0e\n\x06height\x18\x03 \x01(\r\x12\x0e\n\x06\x66ormat\x18\x04 \x01(\t\"\xfe\x01\n\x15GetObservationRequest\x12\x12\n\nrobot_name\x18\x01 \x01(\t\x12\x12\n\nagent_name\x18\x02 \x01(\t\x12\x1b\n\x13include_joint_state\x18\x03 \x01(\x08\x12\x1b\n\x13include_agent_frame\x18\x04 \x01(\x08\x12\x19\n\x11include_telemetry\x18\x05 \x01(\x08\x12\x31\n\x07\x63\x61meras\x18\x06 \x03(\x0b\x32 .hazel.rpc.GetCameraFrameRequest\x12\x35\n\tviewports\x18\x07 \x03(\x0b\x32\".hazel.rpc.GetViewportFrameRequest\"\xd4\x02\n\x16GetObservationResponse\x12\x0f\n\x07success\x18\x01 \x01(\x08\x12\x0f\n\x07message\x18\x02 \x01(\t\x12\x14\n\x0ctimestamp_ms\x18\x03 \x01(\x04\x12\x14\n\x0c\x66rame_number\x18\x04 \x01(\r\x12*\n\x0bjoint_state\x18\x05 \x01(\x0b\x32\x15.hazel.rpc.JointState\x12*\n\x0b\x61gent_frame\x18\x06 \x01(\x0b\x32\x15.hazel.rpc.AgentFrame\x12,\n\ttelemetry\x18\x07 \x01(\x0b\x32\x19.hazel.rpc.TelemetryFrame\x12\x31\n\rcamera_frames\x18\x08 \x03(\x0b\x32\x1a.hazel.rpc.NamedImageFrame\x12\x33\n\x0fviewport_frames\x18\t \x03(\x0b\x32\x1a.hazel.rpc.NamedImageFrame\"F\n\x0bStepRequest\x12\x12\n\nagent_name\x18\x01 \x01(\t\x12\x0f\n\x07\x61\x63tions\x18\x02 \x03(\x02\x12\x12\n\ntimeout_ms\x18\x03 \x01(\r\"~\n\x0cStepResponse\x12\x0f\n\x07success\x18\x01 \x01(\x08\x12\x0f\n\x07message\x18\x02 \x01(\t\x12*\n\x0bobservation\x18\x03 \x01(\x0b\x32\x15.hazel.rpc.AgentFrame\x12 \n\x18physics_step_duration_us\x18\x04 \x01(\x04\x32\x87\x03\n\x0c\x41gentService\x12U\n\x0eGetAgentSchema\x12 .hazel.rpc.GetAgentSchemaRequest\x1a!.hazel.rpc.GetAgentSchemaResponse\x12U\n\x0eGetObservation\x12 .hazel.rpc.GetObservationRequest\x1a!.hazel.rpc.GetObservationResponse\x12\x45\n\x0bStreamAgent\x12\x1d.hazel.rpc.StreamAgentRequest\x1a\x15.hazel.rpc.AgentFrame0\x01\x12I\n\nResetAgent\x12\x1c.hazel.rpc.ResetAgentRequest\x1a\x1d.hazel.rpc.ResetAgentResponse\x12\x37\n\x04Step\x12\x16.hazel.rpc.StepRequest\x1a\x17.hazel.rpc.StepResponseB\x03\xf8\x01\x01\x62\x06proto3')
|
|
32
32
|
|
|
33
33
|
_globals = globals()
|
|
34
34
|
_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals)
|
|
@@ -60,6 +60,10 @@ if not _descriptor._USE_C_DESCRIPTORS:
|
|
|
60
60
|
_globals['_GETOBSERVATIONREQUEST']._serialized_end=1591
|
|
61
61
|
_globals['_GETOBSERVATIONRESPONSE']._serialized_start=1594
|
|
62
62
|
_globals['_GETOBSERVATIONRESPONSE']._serialized_end=1934
|
|
63
|
-
_globals['
|
|
64
|
-
_globals['
|
|
63
|
+
_globals['_STEPREQUEST']._serialized_start=1936
|
|
64
|
+
_globals['_STEPREQUEST']._serialized_end=2006
|
|
65
|
+
_globals['_STEPRESPONSE']._serialized_start=2008
|
|
66
|
+
_globals['_STEPRESPONSE']._serialized_end=2134
|
|
67
|
+
_globals['_AGENTSERVICE']._serialized_start=2137
|
|
68
|
+
_globals['_AGENTSERVICE']._serialized_end=2528
|
|
65
69
|
# @@protoc_insertion_point(module_scope)
|
|
@@ -55,6 +55,11 @@ class AgentServiceStub(object):
|
|
|
55
55
|
request_serializer=agent__pb2.ResetAgentRequest.SerializeToString,
|
|
56
56
|
response_deserializer=agent__pb2.ResetAgentResponse.FromString,
|
|
57
57
|
_registered_method=True)
|
|
58
|
+
self.Step = channel.unary_unary(
|
|
59
|
+
'/hazel.rpc.AgentService/Step',
|
|
60
|
+
request_serializer=agent__pb2.StepRequest.SerializeToString,
|
|
61
|
+
response_deserializer=agent__pb2.StepResponse.FromString,
|
|
62
|
+
_registered_method=True)
|
|
58
63
|
|
|
59
64
|
|
|
60
65
|
class AgentServiceServicer(object):
|
|
@@ -93,6 +98,15 @@ class AgentServiceServicer(object):
|
|
|
93
98
|
context.set_details('Method not implemented!')
|
|
94
99
|
raise NotImplementedError('Method not implemented!')
|
|
95
100
|
|
|
101
|
+
def Step(self, request, context):
|
|
102
|
+
"""Synchronous RL step: apply action, wait for physics, return observation.
|
|
103
|
+
This is the recommended interface for RL training as it eliminates
|
|
104
|
+
one network round-trip compared to separate SendControl + GetObservation.
|
|
105
|
+
"""
|
|
106
|
+
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
|
|
107
|
+
context.set_details('Method not implemented!')
|
|
108
|
+
raise NotImplementedError('Method not implemented!')
|
|
109
|
+
|
|
96
110
|
|
|
97
111
|
def add_AgentServiceServicer_to_server(servicer, server):
|
|
98
112
|
rpc_method_handlers = {
|
|
@@ -116,6 +130,11 @@ def add_AgentServiceServicer_to_server(servicer, server):
|
|
|
116
130
|
request_deserializer=agent__pb2.ResetAgentRequest.FromString,
|
|
117
131
|
response_serializer=agent__pb2.ResetAgentResponse.SerializeToString,
|
|
118
132
|
),
|
|
133
|
+
'Step': grpc.unary_unary_rpc_method_handler(
|
|
134
|
+
servicer.Step,
|
|
135
|
+
request_deserializer=agent__pb2.StepRequest.FromString,
|
|
136
|
+
response_serializer=agent__pb2.StepResponse.SerializeToString,
|
|
137
|
+
),
|
|
119
138
|
}
|
|
120
139
|
generic_handler = grpc.method_handlers_generic_handler(
|
|
121
140
|
'hazel.rpc.AgentService', rpc_method_handlers)
|
|
@@ -235,3 +254,30 @@ class AgentService(object):
|
|
|
235
254
|
timeout,
|
|
236
255
|
metadata,
|
|
237
256
|
_registered_method=True)
|
|
257
|
+
|
|
258
|
+
@staticmethod
|
|
259
|
+
def Step(request,
|
|
260
|
+
target,
|
|
261
|
+
options=(),
|
|
262
|
+
channel_credentials=None,
|
|
263
|
+
call_credentials=None,
|
|
264
|
+
insecure=False,
|
|
265
|
+
compression=None,
|
|
266
|
+
wait_for_ready=None,
|
|
267
|
+
timeout=None,
|
|
268
|
+
metadata=None):
|
|
269
|
+
return grpc.experimental.unary_unary(
|
|
270
|
+
request,
|
|
271
|
+
target,
|
|
272
|
+
'/hazel.rpc.AgentService/Step',
|
|
273
|
+
agent__pb2.StepRequest.SerializeToString,
|
|
274
|
+
agent__pb2.StepResponse.FromString,
|
|
275
|
+
options,
|
|
276
|
+
channel_credentials,
|
|
277
|
+
insecure,
|
|
278
|
+
call_credentials,
|
|
279
|
+
compression,
|
|
280
|
+
wait_for_ready,
|
|
281
|
+
timeout,
|
|
282
|
+
metadata,
|
|
283
|
+
_registered_method=True)
|
|
@@ -25,7 +25,7 @@ _sym_db = _symbol_database.Default()
|
|
|
25
25
|
from . import common_pb2 as common__pb2
|
|
26
26
|
|
|
27
27
|
|
|
28
|
-
DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x0bscene.proto\x12\thazel.rpc\x1a\x0c\x63ommon.proto\"x\n\nEntityInfo\x12\x1f\n\x02id\x18\x01 \x01(\x0b\x32\x13.hazel.rpc.EntityId\x12\x0c\n\x04name\x18\x02 \x01(\t\x12\'\n\ttransform\x18\x03 \x01(\x0b\x32\x14.hazel.rpc.Transform\x12\x12\n\ncomponents\x18\x04 \x03(\t\"\x15\n\x13GetSceneInfoRequest\"T\n\x14GetSceneInfoResponse\x12\x12\n\nscene_name\x18\x01 \x01(\t\x12\x12\n\nscene_path\x18\x02 \x01(\t\x12\x14\n\x0c\x65ntity_count\x18\x03 \x01(\r\"M\n\x13ListEntitiesRequest\x12\x1a\n\x12include_transforms\x18\x01 \x01(\x08\x12\x1a\n\x12include_components\x18\x02 \x01(\x08\"?\n\x14ListEntitiesResponse\x12\'\n\x08\x65ntities\x18\x01 \x03(\x0b\x32\x15.hazel.rpc.EntityInfo\"S\n\x10GetEntityRequest\x12!\n\x02id\x18\x01 \x01(\x0b\x32\x13.hazel.rpc.EntityIdH\x00\x12\x0e\n\x04name\x18\x02 \x01(\tH\x00\x42\x0c\n\nidentifier\"I\n\x11GetEntityResponse\x12\r\n\x05\x66ound\x18\x01 \x01(\x08\x12%\n\x06\x65ntity\x18\x02 \x01(\x0b\x32\x15.hazel.rpc.EntityInfo\"e\n\x19SetEntityTransformRequest\x12\x1f\n\x02id\x18\x01 \x01(\x0b\x32\x13.hazel.rpc.EntityId\x12\'\n\ttransform\x18\x02 \x01(\x0b\x32\x14.hazel.rpc.Transform\">\n\x1aSetEntityTransformResponse\x12\x0f\n\x07success\x18\x01 \x01(\x08\x12\x0f\n\x07message\x18\x02 \x01(\
|
|
28
|
+
DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x0bscene.proto\x12\thazel.rpc\x1a\x0c\x63ommon.proto\"x\n\nEntityInfo\x12\x1f\n\x02id\x18\x01 \x01(\x0b\x32\x13.hazel.rpc.EntityId\x12\x0c\n\x04name\x18\x02 \x01(\t\x12\'\n\ttransform\x18\x03 \x01(\x0b\x32\x14.hazel.rpc.Transform\x12\x12\n\ncomponents\x18\x04 \x03(\t\"\x15\n\x13GetSceneInfoRequest\"T\n\x14GetSceneInfoResponse\x12\x12\n\nscene_name\x18\x01 \x01(\t\x12\x12\n\nscene_path\x18\x02 \x01(\t\x12\x14\n\x0c\x65ntity_count\x18\x03 \x01(\r\"M\n\x13ListEntitiesRequest\x12\x1a\n\x12include_transforms\x18\x01 \x01(\x08\x12\x1a\n\x12include_components\x18\x02 \x01(\x08\"?\n\x14ListEntitiesResponse\x12\'\n\x08\x65ntities\x18\x01 \x03(\x0b\x32\x15.hazel.rpc.EntityInfo\"S\n\x10GetEntityRequest\x12!\n\x02id\x18\x01 \x01(\x0b\x32\x13.hazel.rpc.EntityIdH\x00\x12\x0e\n\x04name\x18\x02 \x01(\tH\x00\x42\x0c\n\nidentifier\"I\n\x11GetEntityResponse\x12\r\n\x05\x66ound\x18\x01 \x01(\x08\x12%\n\x06\x65ntity\x18\x02 \x01(\x0b\x32\x15.hazel.rpc.EntityInfo\"e\n\x19SetEntityTransformRequest\x12\x1f\n\x02id\x18\x01 \x01(\x0b\x32\x13.hazel.rpc.EntityId\x12\'\n\ttransform\x18\x02 \x01(\x0b\x32\x14.hazel.rpc.Transform\">\n\x1aSetEntityTransformResponse\x12\x0f\n\x07success\x18\x01 \x01(\x08\x12\x0f\n\x07message\x18\x02 \x01(\t\"C\n\x18SetSimulationModeRequest\x12\'\n\x04mode\x18\x01 \x01(\x0e\x32\x19.hazel.rpc.SimulationMode\"n\n\x19SetSimulationModeResponse\x12\x0f\n\x07success\x18\x01 \x01(\x08\x12\x0f\n\x07message\x18\x02 \x01(\t\x12/\n\x0c\x63urrent_mode\x18\x03 \x01(\x0e\x32\x19.hazel.rpc.SimulationMode\"\x1a\n\x18GetSimulationModeRequest\"D\n\x19GetSimulationModeResponse\x12\'\n\x04mode\x18\x01 \x01(\x0e\x32\x19.hazel.rpc.SimulationMode*k\n\x0eSimulationMode\x12\x1c\n\x18SIMULATION_MODE_REALTIME\x10\x00\x12!\n\x1dSIMULATION_MODE_DETERMINISTIC\x10\x01\x12\x18\n\x14SIMULATION_MODE_FAST\x10\x02\x32\x9b\x04\n\x0cSceneService\x12O\n\x0cGetSceneInfo\x12\x1e.hazel.rpc.GetSceneInfoRequest\x1a\x1f.hazel.rpc.GetSceneInfoResponse\x12O\n\x0cListEntities\x12\x1e.hazel.rpc.ListEntitiesRequest\x1a\x1f.hazel.rpc.ListEntitiesResponse\x12\x46\n\tGetEntity\x12\x1b.hazel.rpc.GetEntityRequest\x1a\x1c.hazel.rpc.GetEntityResponse\x12\x61\n\x12SetEntityTransform\x12$.hazel.rpc.SetEntityTransformRequest\x1a%.hazel.rpc.SetEntityTransformResponse\x12^\n\x11SetSimulationMode\x12#.hazel.rpc.SetSimulationModeRequest\x1a$.hazel.rpc.SetSimulationModeResponse\x12^\n\x11GetSimulationMode\x12#.hazel.rpc.GetSimulationModeRequest\x1a$.hazel.rpc.GetSimulationModeResponseB\x03\xf8\x01\x01\x62\x06proto3')
|
|
29
29
|
|
|
30
30
|
_globals = globals()
|
|
31
31
|
_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals)
|
|
@@ -33,6 +33,8 @@ _builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'scene_pb2', _globals)
|
|
|
33
33
|
if not _descriptor._USE_C_DESCRIPTORS:
|
|
34
34
|
_globals['DESCRIPTOR']._loaded_options = None
|
|
35
35
|
_globals['DESCRIPTOR']._serialized_options = b'\370\001\001'
|
|
36
|
+
_globals['_SIMULATIONMODE']._serialized_start=1021
|
|
37
|
+
_globals['_SIMULATIONMODE']._serialized_end=1128
|
|
36
38
|
_globals['_ENTITYINFO']._serialized_start=40
|
|
37
39
|
_globals['_ENTITYINFO']._serialized_end=160
|
|
38
40
|
_globals['_GETSCENEINFOREQUEST']._serialized_start=162
|
|
@@ -51,6 +53,14 @@ if not _descriptor._USE_C_DESCRIPTORS:
|
|
|
51
53
|
_globals['_SETENTITYTRANSFORMREQUEST']._serialized_end=676
|
|
52
54
|
_globals['_SETENTITYTRANSFORMRESPONSE']._serialized_start=678
|
|
53
55
|
_globals['_SETENTITYTRANSFORMRESPONSE']._serialized_end=740
|
|
54
|
-
_globals['
|
|
55
|
-
_globals['
|
|
56
|
+
_globals['_SETSIMULATIONMODEREQUEST']._serialized_start=742
|
|
57
|
+
_globals['_SETSIMULATIONMODEREQUEST']._serialized_end=809
|
|
58
|
+
_globals['_SETSIMULATIONMODERESPONSE']._serialized_start=811
|
|
59
|
+
_globals['_SETSIMULATIONMODERESPONSE']._serialized_end=921
|
|
60
|
+
_globals['_GETSIMULATIONMODEREQUEST']._serialized_start=923
|
|
61
|
+
_globals['_GETSIMULATIONMODEREQUEST']._serialized_end=949
|
|
62
|
+
_globals['_GETSIMULATIONMODERESPONSE']._serialized_start=951
|
|
63
|
+
_globals['_GETSIMULATIONMODERESPONSE']._serialized_end=1019
|
|
64
|
+
_globals['_SCENESERVICE']._serialized_start=1131
|
|
65
|
+
_globals['_SCENESERVICE']._serialized_end=1670
|
|
56
66
|
# @@protoc_insertion_point(module_scope)
|
|
@@ -55,6 +55,16 @@ class SceneServiceStub(object):
|
|
|
55
55
|
request_serializer=scene__pb2.SetEntityTransformRequest.SerializeToString,
|
|
56
56
|
response_deserializer=scene__pb2.SetEntityTransformResponse.FromString,
|
|
57
57
|
_registered_method=True)
|
|
58
|
+
self.SetSimulationMode = channel.unary_unary(
|
|
59
|
+
'/hazel.rpc.SceneService/SetSimulationMode',
|
|
60
|
+
request_serializer=scene__pb2.SetSimulationModeRequest.SerializeToString,
|
|
61
|
+
response_deserializer=scene__pb2.SetSimulationModeResponse.FromString,
|
|
62
|
+
_registered_method=True)
|
|
63
|
+
self.GetSimulationMode = channel.unary_unary(
|
|
64
|
+
'/hazel.rpc.SceneService/GetSimulationMode',
|
|
65
|
+
request_serializer=scene__pb2.GetSimulationModeRequest.SerializeToString,
|
|
66
|
+
response_deserializer=scene__pb2.GetSimulationModeResponse.FromString,
|
|
67
|
+
_registered_method=True)
|
|
58
68
|
|
|
59
69
|
|
|
60
70
|
class SceneServiceServicer(object):
|
|
@@ -85,6 +95,20 @@ class SceneServiceServicer(object):
|
|
|
85
95
|
context.set_details('Method not implemented!')
|
|
86
96
|
raise NotImplementedError('Method not implemented!')
|
|
87
97
|
|
|
98
|
+
def SetSimulationMode(self, request, context):
|
|
99
|
+
"""Set simulation timing mode (realtime, deterministic, or fast).
|
|
100
|
+
"""
|
|
101
|
+
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
|
|
102
|
+
context.set_details('Method not implemented!')
|
|
103
|
+
raise NotImplementedError('Method not implemented!')
|
|
104
|
+
|
|
105
|
+
def GetSimulationMode(self, request, context):
|
|
106
|
+
"""Get current simulation timing mode.
|
|
107
|
+
"""
|
|
108
|
+
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
|
|
109
|
+
context.set_details('Method not implemented!')
|
|
110
|
+
raise NotImplementedError('Method not implemented!')
|
|
111
|
+
|
|
88
112
|
|
|
89
113
|
def add_SceneServiceServicer_to_server(servicer, server):
|
|
90
114
|
rpc_method_handlers = {
|
|
@@ -108,6 +132,16 @@ def add_SceneServiceServicer_to_server(servicer, server):
|
|
|
108
132
|
request_deserializer=scene__pb2.SetEntityTransformRequest.FromString,
|
|
109
133
|
response_serializer=scene__pb2.SetEntityTransformResponse.SerializeToString,
|
|
110
134
|
),
|
|
135
|
+
'SetSimulationMode': grpc.unary_unary_rpc_method_handler(
|
|
136
|
+
servicer.SetSimulationMode,
|
|
137
|
+
request_deserializer=scene__pb2.SetSimulationModeRequest.FromString,
|
|
138
|
+
response_serializer=scene__pb2.SetSimulationModeResponse.SerializeToString,
|
|
139
|
+
),
|
|
140
|
+
'GetSimulationMode': grpc.unary_unary_rpc_method_handler(
|
|
141
|
+
servicer.GetSimulationMode,
|
|
142
|
+
request_deserializer=scene__pb2.GetSimulationModeRequest.FromString,
|
|
143
|
+
response_serializer=scene__pb2.GetSimulationModeResponse.SerializeToString,
|
|
144
|
+
),
|
|
111
145
|
}
|
|
112
146
|
generic_handler = grpc.method_handlers_generic_handler(
|
|
113
147
|
'hazel.rpc.SceneService', rpc_method_handlers)
|
|
@@ -227,3 +261,57 @@ class SceneService(object):
|
|
|
227
261
|
timeout,
|
|
228
262
|
metadata,
|
|
229
263
|
_registered_method=True)
|
|
264
|
+
|
|
265
|
+
@staticmethod
|
|
266
|
+
def SetSimulationMode(request,
|
|
267
|
+
target,
|
|
268
|
+
options=(),
|
|
269
|
+
channel_credentials=None,
|
|
270
|
+
call_credentials=None,
|
|
271
|
+
insecure=False,
|
|
272
|
+
compression=None,
|
|
273
|
+
wait_for_ready=None,
|
|
274
|
+
timeout=None,
|
|
275
|
+
metadata=None):
|
|
276
|
+
return grpc.experimental.unary_unary(
|
|
277
|
+
request,
|
|
278
|
+
target,
|
|
279
|
+
'/hazel.rpc.SceneService/SetSimulationMode',
|
|
280
|
+
scene__pb2.SetSimulationModeRequest.SerializeToString,
|
|
281
|
+
scene__pb2.SetSimulationModeResponse.FromString,
|
|
282
|
+
options,
|
|
283
|
+
channel_credentials,
|
|
284
|
+
insecure,
|
|
285
|
+
call_credentials,
|
|
286
|
+
compression,
|
|
287
|
+
wait_for_ready,
|
|
288
|
+
timeout,
|
|
289
|
+
metadata,
|
|
290
|
+
_registered_method=True)
|
|
291
|
+
|
|
292
|
+
@staticmethod
|
|
293
|
+
def GetSimulationMode(request,
|
|
294
|
+
target,
|
|
295
|
+
options=(),
|
|
296
|
+
channel_credentials=None,
|
|
297
|
+
call_credentials=None,
|
|
298
|
+
insecure=False,
|
|
299
|
+
compression=None,
|
|
300
|
+
wait_for_ready=None,
|
|
301
|
+
timeout=None,
|
|
302
|
+
metadata=None):
|
|
303
|
+
return grpc.experimental.unary_unary(
|
|
304
|
+
request,
|
|
305
|
+
target,
|
|
306
|
+
'/hazel.rpc.SceneService/GetSimulationMode',
|
|
307
|
+
scene__pb2.GetSimulationModeRequest.SerializeToString,
|
|
308
|
+
scene__pb2.GetSimulationModeResponse.FromString,
|
|
309
|
+
options,
|
|
310
|
+
channel_credentials,
|
|
311
|
+
insecure,
|
|
312
|
+
call_credentials,
|
|
313
|
+
compression,
|
|
314
|
+
wait_for_ready,
|
|
315
|
+
timeout,
|
|
316
|
+
metadata,
|
|
317
|
+
_registered_method=True)
|
|
@@ -167,6 +167,31 @@ message GetObservationResponse {
|
|
|
167
167
|
repeated NamedImageFrame viewport_frames = 9;
|
|
168
168
|
}
|
|
169
169
|
|
|
170
|
+
// =============================================================================
|
|
171
|
+
// Step RPC (synchronous RL step)
|
|
172
|
+
// =============================================================================
|
|
173
|
+
|
|
174
|
+
// Request to step the simulation with the provided action.
|
|
175
|
+
// This is the recommended interface for RL training - it combines
|
|
176
|
+
// SendControl + physics step + GetObservation into a single RPC.
|
|
177
|
+
message StepRequest {
|
|
178
|
+
// Agent logical name. Empty means default agent.
|
|
179
|
+
string agent_name = 1;
|
|
180
|
+
// Action vector to apply for this step.
|
|
181
|
+
repeated float actions = 2;
|
|
182
|
+
// Optional timeout in milliseconds. 0 means use server default.
|
|
183
|
+
uint32 timeout_ms = 3;
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
message StepResponse {
|
|
187
|
+
bool success = 1;
|
|
188
|
+
string message = 2;
|
|
189
|
+
// Observation after the physics step completed.
|
|
190
|
+
AgentFrame observation = 3;
|
|
191
|
+
// Time taken for the physics step in microseconds (for profiling).
|
|
192
|
+
uint64 physics_step_duration_us = 4;
|
|
193
|
+
}
|
|
194
|
+
|
|
170
195
|
// Per-agent RL-style observation streaming (training / inference clients consume this).
|
|
171
196
|
service AgentService {
|
|
172
197
|
rpc GetAgentSchema(GetAgentSchemaRequest) returns (GetAgentSchemaResponse);
|
|
@@ -181,4 +206,8 @@ service AgentService {
|
|
|
181
206
|
// Reset a specific agent (full reset: clear buffers, reset state, resample commands, apply MuJoCo state).
|
|
182
207
|
// Useful for multi-env RL where individual agents need to be reset without resetting the entire scene.
|
|
183
208
|
rpc ResetAgent(ResetAgentRequest) returns (ResetAgentResponse);
|
|
209
|
+
// Synchronous RL step: apply action, wait for physics, return observation.
|
|
210
|
+
// This is the recommended interface for RL training as it eliminates
|
|
211
|
+
// one network round-trip compared to separate SendControl + GetObservation.
|
|
212
|
+
rpc Step(StepRequest) returns (StepResponse);
|
|
184
213
|
}
|
|
@@ -61,10 +61,44 @@ message SetEntityTransformResponse {
|
|
|
61
61
|
string message = 2;
|
|
62
62
|
}
|
|
63
63
|
|
|
64
|
+
// =============================================================================
|
|
65
|
+
// Simulation Mode
|
|
66
|
+
// =============================================================================
|
|
67
|
+
|
|
68
|
+
// Simulation timing mode controls how physics stepping relates to wall-clock time.
|
|
69
|
+
enum SimulationMode {
|
|
70
|
+
// Real-time: physics runs at 1x wall-clock speed (for visualization, games).
|
|
71
|
+
SIMULATION_MODE_REALTIME = 0;
|
|
72
|
+
// Deterministic: physics runs at fixed rate regardless of wall-clock (for reproducibility).
|
|
73
|
+
SIMULATION_MODE_DETERMINISTIC = 1;
|
|
74
|
+
// Fast: physics runs as fast as possible without real-time limiting (for RL training).
|
|
75
|
+
SIMULATION_MODE_FAST = 2;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
message SetSimulationModeRequest {
|
|
79
|
+
SimulationMode mode = 1;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
message SetSimulationModeResponse {
|
|
83
|
+
bool success = 1;
|
|
84
|
+
string message = 2;
|
|
85
|
+
SimulationMode current_mode = 3;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
message GetSimulationModeRequest {}
|
|
89
|
+
|
|
90
|
+
message GetSimulationModeResponse {
|
|
91
|
+
SimulationMode mode = 1;
|
|
92
|
+
}
|
|
93
|
+
|
|
64
94
|
// Scene inspection + basic editing.
|
|
65
95
|
service SceneService {
|
|
66
96
|
rpc GetSceneInfo(GetSceneInfoRequest) returns (GetSceneInfoResponse);
|
|
67
97
|
rpc ListEntities(ListEntitiesRequest) returns (ListEntitiesResponse);
|
|
68
98
|
rpc GetEntity(GetEntityRequest) returns (GetEntityResponse);
|
|
69
99
|
rpc SetEntityTransform(SetEntityTransformRequest) returns (SetEntityTransformResponse);
|
|
100
|
+
// Set simulation timing mode (realtime, deterministic, or fast).
|
|
101
|
+
rpc SetSimulationMode(SetSimulationModeRequest) returns (SetSimulationModeResponse);
|
|
102
|
+
// Get current simulation timing mode.
|
|
103
|
+
rpc GetSimulationMode(GetSimulationModeRequest) returns (GetSimulationModeResponse);
|
|
70
104
|
}
|
luckyrobots/luckyrobots.py
CHANGED
|
@@ -164,13 +164,44 @@ class LuckyRobots:
|
|
|
164
164
|
raise RuntimeError(f"SendControl failed: {getattr(resp, 'message', '')}")
|
|
165
165
|
|
|
166
166
|
def step(
|
|
167
|
-
self,
|
|
167
|
+
self,
|
|
168
|
+
actions: Sequence[float],
|
|
169
|
+
agent_name: str = "",
|
|
168
170
|
) -> ObservationResponse:
|
|
169
|
-
"""
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
171
|
+
"""
|
|
172
|
+
Synchronous RL step: apply action, wait for physics, return observation.
|
|
173
|
+
|
|
174
|
+
This is the recommended interface for RL training. It uses the gRPC Step RPC
|
|
175
|
+
which combines SendControl + physics step + GetObservation into a single call,
|
|
176
|
+
eliminating one network round-trip.
|
|
177
|
+
|
|
178
|
+
Args:
|
|
179
|
+
actions: Action vector to apply for this step.
|
|
180
|
+
agent_name: Agent name (empty = default agent).
|
|
181
|
+
|
|
182
|
+
Returns:
|
|
183
|
+
ObservationResponse with observation after physics step.
|
|
184
|
+
"""
|
|
185
|
+
client = self._require_client()
|
|
186
|
+
return client.step(actions=list(actions), agent_name=agent_name)
|
|
187
|
+
|
|
188
|
+
def set_simulation_mode(self, mode: str = "fast"):
|
|
189
|
+
"""
|
|
190
|
+
Set simulation timing mode.
|
|
191
|
+
|
|
192
|
+
Args:
|
|
193
|
+
mode: "realtime", "deterministic", or "fast"
|
|
194
|
+
- realtime: Physics runs at 1x wall-clock speed (for visualization)
|
|
195
|
+
- deterministic: Physics runs at fixed rate (for reproducibility)
|
|
196
|
+
- fast: Physics runs as fast as possible (for RL training)
|
|
197
|
+
"""
|
|
198
|
+
client = self._require_client()
|
|
199
|
+
return client.set_simulation_mode(mode=mode)
|
|
200
|
+
|
|
201
|
+
def get_simulation_mode(self):
|
|
202
|
+
"""Get current simulation timing mode."""
|
|
203
|
+
client = self._require_client()
|
|
204
|
+
return client.get_simulation_mode()
|
|
174
205
|
|
|
175
206
|
def reset(
|
|
176
207
|
self,
|
luckyrobots/models/__init__.py
CHANGED
|
@@ -1,15 +1,3 @@
|
|
|
1
|
-
"""
|
|
2
|
-
Pydantic models for LuckyRobots.
|
|
3
|
-
"""
|
|
1
|
+
"""Pydantic models for LuckyRobots."""
|
|
4
2
|
|
|
5
|
-
from .observation import ObservationResponse
|
|
6
|
-
from .camera import CameraData, CameraShape
|
|
7
|
-
from .randomization import DomainRandomizationConfig
|
|
8
|
-
|
|
9
|
-
__all__ = [
|
|
10
|
-
"ObservationResponse",
|
|
11
|
-
"StateSnapshot",
|
|
12
|
-
"CameraData",
|
|
13
|
-
"CameraShape",
|
|
14
|
-
"DomainRandomizationConfig",
|
|
15
|
-
]
|
|
3
|
+
from luckyrobots.models.observation import ObservationResponse as ObservationResponse
|