luckyrobots 0.1.69__py3-none-any.whl → 0.1.71__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 +8 -1
- luckyrobots/client.py +98 -4
- luckyrobots/grpc/generated/agent_pb2.py +36 -32
- luckyrobots/grpc/generated/agent_pb2_grpc.py +110 -128
- luckyrobots/grpc/generated/camera_pb2.py +20 -18
- luckyrobots/grpc/generated/camera_pb2_grpc.py +62 -73
- luckyrobots/grpc/generated/common_pb2.py +20 -16
- luckyrobots/grpc/generated/common_pb2_grpc.py +7 -10
- luckyrobots/grpc/generated/hazel_rpc_pb2.py +43 -0
- luckyrobots/grpc/generated/hazel_rpc_pb2_grpc.py +24 -0
- luckyrobots/grpc/generated/media_pb2.py +16 -12
- luckyrobots/grpc/generated/media_pb2_grpc.py +7 -10
- luckyrobots/grpc/generated/mujoco_pb2.py +28 -24
- luckyrobots/grpc/generated/mujoco_pb2_grpc.py +110 -128
- luckyrobots/grpc/generated/scene_pb2.py +30 -28
- luckyrobots/grpc/generated/scene_pb2_grpc.py +108 -127
- luckyrobots/grpc/generated/telemetry_pb2.py +24 -20
- luckyrobots/grpc/generated/telemetry_pb2_grpc.py +62 -73
- luckyrobots/grpc/generated/viewport_pb2.py +24 -22
- luckyrobots/grpc/generated/viewport_pb2_grpc.py +62 -73
- luckyrobots/grpc/proto/agent.proto +33 -1
- luckyrobots/grpc/proto/camera.proto +1 -1
- luckyrobots/grpc/proto/common.proto +1 -1
- luckyrobots/grpc/proto/hazel_rpc.proto +1 -1
- luckyrobots/grpc/proto/media.proto +1 -1
- luckyrobots/grpc/proto/mujoco.proto +1 -1
- luckyrobots/grpc/proto/scene.proto +1 -1
- luckyrobots/grpc/proto/telemetry.proto +1 -1
- luckyrobots/grpc/proto/viewport.proto +1 -1
- luckyrobots/luckyrobots.py +28 -0
- luckyrobots/models/__init__.py +2 -0
- luckyrobots/models/randomization.py +77 -0
- {luckyrobots-0.1.69.dist-info → luckyrobots-0.1.71.dist-info}/METADATA +1 -1
- luckyrobots-0.1.71.dist-info/RECORD +47 -0
- luckyrobots-0.1.69.dist-info/RECORD +0 -44
- {luckyrobots-0.1.69.dist-info → luckyrobots-0.1.71.dist-info}/WHEEL +0 -0
- {luckyrobots-0.1.69.dist-info → luckyrobots-0.1.71.dist-info}/licenses/LICENSE +0 -0
|
@@ -9,9 +9,13 @@ from google.protobuf import descriptor_pool as _descriptor_pool
|
|
|
9
9
|
from google.protobuf import runtime_version as _runtime_version
|
|
10
10
|
from google.protobuf import symbol_database as _symbol_database
|
|
11
11
|
from google.protobuf.internal import builder as _builder
|
|
12
|
-
|
|
13
12
|
_runtime_version.ValidateProtobufRuntimeVersion(
|
|
14
|
-
_runtime_version.Domain.PUBLIC,
|
|
13
|
+
_runtime_version.Domain.PUBLIC,
|
|
14
|
+
6,
|
|
15
|
+
31,
|
|
16
|
+
1,
|
|
17
|
+
'',
|
|
18
|
+
'viewport.proto'
|
|
15
19
|
)
|
|
16
20
|
# @@protoc_insertion_point(imports)
|
|
17
21
|
|
|
@@ -21,28 +25,26 @@ _sym_db = _symbol_database.Default()
|
|
|
21
25
|
from . import media_pb2 as media__pb2
|
|
22
26
|
|
|
23
27
|
|
|
24
|
-
DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(
|
|
25
|
-
b'\n\x0eviewport.proto\x12\x0chazel.rpc.v1\x1a\x0bmedia.proto"v\n\x1aStartViewportStreamRequest\x12\x15\n\rviewport_name\x18\x01 \x01(\t\x12\x12\n\ntarget_fps\x18\x02 \x01(\r\x12\r\n\x05width\x18\x03 \x01(\r\x12\x0e\n\x06height\x18\x04 \x01(\r\x12\x0e\n\x06\x66ormat\x18\x05 \x01(\t"l\n\x14ViewportStreamConfig\x12\x11\n\tstreaming\x18\x01 \x01(\x08\x12\x15\n\rviewport_name\x18\x02 \x01(\t\x12\x0b\n\x03\x66ps\x18\x03 \x01(\r\x12\r\n\x05width\x18\x04 \x01(\r\x12\x0e\n\x06height\x18\x05 \x01(\r"\x1b\n\x19StopViewportStreamRequest"-\n\x1aStopViewportStreamResponse\x12\x0f\n\x07success\x18\x01 \x01(\x08"\x18\n\x16GetViewportInfoRequest"r\n\x17GetViewportInfoResponse\x12\x1b\n\x13\x61vailable_viewports\x18\x01 \x03(\t\x12:\n\x0e\x63urrent_config\x18\x02 \x01(\x0b\x32".hazel.rpc.v1.ViewportStreamConfig2\xc9\x01\n\x0fViewportService\x12^\n\x0fGetViewportInfo\x12$.hazel.rpc.v1.GetViewportInfoRequest\x1a%.hazel.rpc.v1.GetViewportInfoResponse\x12V\n\x0eStreamViewport\x12(.hazel.rpc.v1.StartViewportStreamRequest\x1a\x18.hazel.rpc.v1.ImageFrame0\x01\x42\x03\xf8\x01\x01\x62\x06proto3'
|
|
26
|
-
)
|
|
28
|
+
DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x0eviewport.proto\x12\thazel.rpc\x1a\x0bmedia.proto\"v\n\x1aStartViewportStreamRequest\x12\x15\n\rviewport_name\x18\x01 \x01(\t\x12\x12\n\ntarget_fps\x18\x02 \x01(\r\x12\r\n\x05width\x18\x03 \x01(\r\x12\x0e\n\x06height\x18\x04 \x01(\r\x12\x0e\n\x06\x66ormat\x18\x05 \x01(\t\"l\n\x14ViewportStreamConfig\x12\x11\n\tstreaming\x18\x01 \x01(\x08\x12\x15\n\rviewport_name\x18\x02 \x01(\t\x12\x0b\n\x03\x66ps\x18\x03 \x01(\r\x12\r\n\x05width\x18\x04 \x01(\r\x12\x0e\n\x06height\x18\x05 \x01(\r\"\x1b\n\x19StopViewportStreamRequest\"-\n\x1aStopViewportStreamResponse\x12\x0f\n\x07success\x18\x01 \x01(\x08\"\x18\n\x16GetViewportInfoRequest\"o\n\x17GetViewportInfoResponse\x12\x1b\n\x13\x61vailable_viewports\x18\x01 \x03(\t\x12\x37\n\x0e\x63urrent_config\x18\x02 \x01(\x0b\x32\x1f.hazel.rpc.ViewportStreamConfig2\xbd\x01\n\x0fViewportService\x12X\n\x0fGetViewportInfo\x12!.hazel.rpc.GetViewportInfoRequest\x1a\".hazel.rpc.GetViewportInfoResponse\x12P\n\x0eStreamViewport\x12%.hazel.rpc.StartViewportStreamRequest\x1a\x15.hazel.rpc.ImageFrame0\x01\x42\x03\xf8\x01\x01\x62\x06proto3')
|
|
27
29
|
|
|
28
30
|
_globals = globals()
|
|
29
31
|
_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals)
|
|
30
|
-
_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR,
|
|
32
|
+
_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'viewport_pb2', _globals)
|
|
31
33
|
if not _descriptor._USE_C_DESCRIPTORS:
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
34
|
+
_globals['DESCRIPTOR']._loaded_options = None
|
|
35
|
+
_globals['DESCRIPTOR']._serialized_options = b'\370\001\001'
|
|
36
|
+
_globals['_STARTVIEWPORTSTREAMREQUEST']._serialized_start=42
|
|
37
|
+
_globals['_STARTVIEWPORTSTREAMREQUEST']._serialized_end=160
|
|
38
|
+
_globals['_VIEWPORTSTREAMCONFIG']._serialized_start=162
|
|
39
|
+
_globals['_VIEWPORTSTREAMCONFIG']._serialized_end=270
|
|
40
|
+
_globals['_STOPVIEWPORTSTREAMREQUEST']._serialized_start=272
|
|
41
|
+
_globals['_STOPVIEWPORTSTREAMREQUEST']._serialized_end=299
|
|
42
|
+
_globals['_STOPVIEWPORTSTREAMRESPONSE']._serialized_start=301
|
|
43
|
+
_globals['_STOPVIEWPORTSTREAMRESPONSE']._serialized_end=346
|
|
44
|
+
_globals['_GETVIEWPORTINFOREQUEST']._serialized_start=348
|
|
45
|
+
_globals['_GETVIEWPORTINFOREQUEST']._serialized_end=372
|
|
46
|
+
_globals['_GETVIEWPORTINFORESPONSE']._serialized_start=374
|
|
47
|
+
_globals['_GETVIEWPORTINFORESPONSE']._serialized_end=485
|
|
48
|
+
_globals['_VIEWPORTSERVICE']._serialized_start=488
|
|
49
|
+
_globals['_VIEWPORTSERVICE']._serialized_end=677
|
|
48
50
|
# @@protoc_insertion_point(module_scope)
|
|
@@ -6,31 +6,29 @@ import warnings
|
|
|
6
6
|
from . import media_pb2 as media__pb2
|
|
7
7
|
from . import viewport_pb2 as viewport__pb2
|
|
8
8
|
|
|
9
|
-
GRPC_GENERATED_VERSION =
|
|
9
|
+
GRPC_GENERATED_VERSION = '1.76.0'
|
|
10
10
|
GRPC_VERSION = grpc.__version__
|
|
11
11
|
_version_not_supported = False
|
|
12
12
|
|
|
13
13
|
try:
|
|
14
14
|
from grpc._utilities import first_version_is_lower
|
|
15
|
-
|
|
16
|
-
_version_not_supported = first_version_is_lower(
|
|
17
|
-
GRPC_VERSION, GRPC_GENERATED_VERSION
|
|
18
|
-
)
|
|
15
|
+
_version_not_supported = first_version_is_lower(GRPC_VERSION, GRPC_GENERATED_VERSION)
|
|
19
16
|
except ImportError:
|
|
20
17
|
_version_not_supported = True
|
|
21
18
|
|
|
22
19
|
if _version_not_supported:
|
|
23
20
|
raise RuntimeError(
|
|
24
|
-
f
|
|
25
|
-
+
|
|
26
|
-
+ f
|
|
27
|
-
+ f
|
|
28
|
-
+ f
|
|
21
|
+
f'The grpc package installed is at version {GRPC_VERSION},'
|
|
22
|
+
+ ' but the generated code in viewport_pb2_grpc.py depends on'
|
|
23
|
+
+ f' grpcio>={GRPC_GENERATED_VERSION}.'
|
|
24
|
+
+ f' Please upgrade your grpc module to grpcio>={GRPC_GENERATED_VERSION}'
|
|
25
|
+
+ f' or downgrade your generated code using grpcio-tools<={GRPC_VERSION}.'
|
|
29
26
|
)
|
|
30
27
|
|
|
31
28
|
|
|
32
29
|
class ViewportServiceStub(object):
|
|
33
|
-
"""Streams pixels from a named viewport (useful for external visualization / training input).
|
|
30
|
+
"""Streams pixels from a named viewport (useful for external visualization / training input).
|
|
31
|
+
"""
|
|
34
32
|
|
|
35
33
|
def __init__(self, channel):
|
|
36
34
|
"""Constructor.
|
|
@@ -39,78 +37,73 @@ class ViewportServiceStub(object):
|
|
|
39
37
|
channel: A grpc.Channel.
|
|
40
38
|
"""
|
|
41
39
|
self.GetViewportInfo = channel.unary_unary(
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
)
|
|
40
|
+
'/hazel.rpc.ViewportService/GetViewportInfo',
|
|
41
|
+
request_serializer=viewport__pb2.GetViewportInfoRequest.SerializeToString,
|
|
42
|
+
response_deserializer=viewport__pb2.GetViewportInfoResponse.FromString,
|
|
43
|
+
_registered_method=True)
|
|
47
44
|
self.StreamViewport = channel.unary_stream(
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
)
|
|
45
|
+
'/hazel.rpc.ViewportService/StreamViewport',
|
|
46
|
+
request_serializer=viewport__pb2.StartViewportStreamRequest.SerializeToString,
|
|
47
|
+
response_deserializer=media__pb2.ImageFrame.FromString,
|
|
48
|
+
_registered_method=True)
|
|
53
49
|
|
|
54
50
|
|
|
55
51
|
class ViewportServiceServicer(object):
|
|
56
|
-
"""Streams pixels from a named viewport (useful for external visualization / training input).
|
|
52
|
+
"""Streams pixels from a named viewport (useful for external visualization / training input).
|
|
53
|
+
"""
|
|
57
54
|
|
|
58
55
|
def GetViewportInfo(self, request, context):
|
|
59
56
|
"""Missing associated documentation comment in .proto file."""
|
|
60
57
|
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
|
|
61
|
-
context.set_details(
|
|
62
|
-
raise NotImplementedError(
|
|
58
|
+
context.set_details('Method not implemented!')
|
|
59
|
+
raise NotImplementedError('Method not implemented!')
|
|
63
60
|
|
|
64
61
|
def StreamViewport(self, request, context):
|
|
65
62
|
"""Missing associated documentation comment in .proto file."""
|
|
66
63
|
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
|
|
67
|
-
context.set_details(
|
|
68
|
-
raise NotImplementedError(
|
|
64
|
+
context.set_details('Method not implemented!')
|
|
65
|
+
raise NotImplementedError('Method not implemented!')
|
|
69
66
|
|
|
70
67
|
|
|
71
68
|
def add_ViewportServiceServicer_to_server(servicer, server):
|
|
72
69
|
rpc_method_handlers = {
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
70
|
+
'GetViewportInfo': grpc.unary_unary_rpc_method_handler(
|
|
71
|
+
servicer.GetViewportInfo,
|
|
72
|
+
request_deserializer=viewport__pb2.GetViewportInfoRequest.FromString,
|
|
73
|
+
response_serializer=viewport__pb2.GetViewportInfoResponse.SerializeToString,
|
|
74
|
+
),
|
|
75
|
+
'StreamViewport': grpc.unary_stream_rpc_method_handler(
|
|
76
|
+
servicer.StreamViewport,
|
|
77
|
+
request_deserializer=viewport__pb2.StartViewportStreamRequest.FromString,
|
|
78
|
+
response_serializer=media__pb2.ImageFrame.SerializeToString,
|
|
79
|
+
),
|
|
83
80
|
}
|
|
84
81
|
generic_handler = grpc.method_handlers_generic_handler(
|
|
85
|
-
|
|
86
|
-
)
|
|
82
|
+
'hazel.rpc.ViewportService', rpc_method_handlers)
|
|
87
83
|
server.add_generic_rpc_handlers((generic_handler,))
|
|
88
|
-
server.add_registered_method_handlers(
|
|
89
|
-
"hazel.rpc.v1.ViewportService", rpc_method_handlers
|
|
90
|
-
)
|
|
84
|
+
server.add_registered_method_handlers('hazel.rpc.ViewportService', rpc_method_handlers)
|
|
91
85
|
|
|
92
86
|
|
|
93
|
-
# This class is part of an EXPERIMENTAL API.
|
|
87
|
+
# This class is part of an EXPERIMENTAL API.
|
|
94
88
|
class ViewportService(object):
|
|
95
|
-
"""Streams pixels from a named viewport (useful for external visualization / training input).
|
|
89
|
+
"""Streams pixels from a named viewport (useful for external visualization / training input).
|
|
90
|
+
"""
|
|
96
91
|
|
|
97
92
|
@staticmethod
|
|
98
|
-
def GetViewportInfo(
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
metadata=None,
|
|
109
|
-
):
|
|
93
|
+
def GetViewportInfo(request,
|
|
94
|
+
target,
|
|
95
|
+
options=(),
|
|
96
|
+
channel_credentials=None,
|
|
97
|
+
call_credentials=None,
|
|
98
|
+
insecure=False,
|
|
99
|
+
compression=None,
|
|
100
|
+
wait_for_ready=None,
|
|
101
|
+
timeout=None,
|
|
102
|
+
metadata=None):
|
|
110
103
|
return grpc.experimental.unary_unary(
|
|
111
104
|
request,
|
|
112
105
|
target,
|
|
113
|
-
|
|
106
|
+
'/hazel.rpc.ViewportService/GetViewportInfo',
|
|
114
107
|
viewport__pb2.GetViewportInfoRequest.SerializeToString,
|
|
115
108
|
viewport__pb2.GetViewportInfoResponse.FromString,
|
|
116
109
|
options,
|
|
@@ -121,26 +114,23 @@ class ViewportService(object):
|
|
|
121
114
|
wait_for_ready,
|
|
122
115
|
timeout,
|
|
123
116
|
metadata,
|
|
124
|
-
_registered_method=True
|
|
125
|
-
)
|
|
117
|
+
_registered_method=True)
|
|
126
118
|
|
|
127
119
|
@staticmethod
|
|
128
|
-
def StreamViewport(
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
metadata=None,
|
|
139
|
-
):
|
|
120
|
+
def StreamViewport(request,
|
|
121
|
+
target,
|
|
122
|
+
options=(),
|
|
123
|
+
channel_credentials=None,
|
|
124
|
+
call_credentials=None,
|
|
125
|
+
insecure=False,
|
|
126
|
+
compression=None,
|
|
127
|
+
wait_for_ready=None,
|
|
128
|
+
timeout=None,
|
|
129
|
+
metadata=None):
|
|
140
130
|
return grpc.experimental.unary_stream(
|
|
141
131
|
request,
|
|
142
132
|
target,
|
|
143
|
-
|
|
133
|
+
'/hazel.rpc.ViewportService/StreamViewport',
|
|
144
134
|
viewport__pb2.StartViewportStreamRequest.SerializeToString,
|
|
145
135
|
media__pb2.ImageFrame.FromString,
|
|
146
136
|
options,
|
|
@@ -151,5 +141,4 @@ class ViewportService(object):
|
|
|
151
141
|
wait_for_ready,
|
|
152
142
|
timeout,
|
|
153
143
|
metadata,
|
|
154
|
-
_registered_method=True
|
|
155
|
-
)
|
|
144
|
+
_registered_method=True)
|
|
@@ -2,7 +2,7 @@ syntax = "proto3";
|
|
|
2
2
|
|
|
3
3
|
// Agent + observation service definitions for the LuckyEngine / Hazel ScriptCore gRPC API (v1).
|
|
4
4
|
|
|
5
|
-
package hazel.rpc
|
|
5
|
+
package hazel.rpc;
|
|
6
6
|
|
|
7
7
|
option cc_enable_arenas = true;
|
|
8
8
|
|
|
@@ -37,10 +37,42 @@ message StreamAgentRequest {
|
|
|
37
37
|
uint32 target_fps = 2;
|
|
38
38
|
}
|
|
39
39
|
|
|
40
|
+
// Domain randomization configuration for physics parameters.
|
|
41
|
+
// All range fields are [min, max] pairs. Empty ranges mean "use defaults".
|
|
42
|
+
message DomainRandomizationConfig {
|
|
43
|
+
// Initial state randomization
|
|
44
|
+
repeated float pose_position_noise = 1; // [x, y, z] position noise std
|
|
45
|
+
float pose_orientation_noise = 2; // Orientation noise std (radians)
|
|
46
|
+
float joint_position_noise = 3; // Joint position noise std
|
|
47
|
+
float joint_velocity_noise = 4; // Joint velocity noise std
|
|
48
|
+
|
|
49
|
+
// Physics parameters (all [min, max] ranges)
|
|
50
|
+
repeated float friction_range = 5; // Surface friction coefficient
|
|
51
|
+
repeated float restitution_range = 6; // Bounce/restitution coefficient
|
|
52
|
+
repeated float mass_scale_range = 7; // Body mass multiplier
|
|
53
|
+
repeated float com_offset_range = 8; // Center of mass offset
|
|
54
|
+
|
|
55
|
+
// Motor/actuator randomization
|
|
56
|
+
repeated float motor_strength_range = 9; // Motor strength multiplier
|
|
57
|
+
repeated float motor_offset_range = 10; // Motor position offset
|
|
58
|
+
|
|
59
|
+
// External disturbances
|
|
60
|
+
repeated float push_interval_range = 11; // Time between pushes [min, max]
|
|
61
|
+
repeated float push_velocity_range = 12; // Push velocity magnitude [min, max]
|
|
62
|
+
|
|
63
|
+
// Terrain configuration
|
|
64
|
+
string terrain_type = 13; // Terrain type identifier
|
|
65
|
+
float terrain_difficulty = 14; // Terrain difficulty level
|
|
66
|
+
}
|
|
67
|
+
|
|
40
68
|
message ResetAgentRequest {
|
|
41
69
|
// Agent logical name. Convention in this repo is `agent_0`, `agent_1`, ...
|
|
42
70
|
// Empty typically means "default agent" (agent_0).
|
|
43
71
|
string agent_name = 1;
|
|
72
|
+
|
|
73
|
+
// Optional domain randomization config for this reset.
|
|
74
|
+
// If not provided, use defaults or keep previous values.
|
|
75
|
+
DomainRandomizationConfig dr_config = 2;
|
|
44
76
|
}
|
|
45
77
|
|
|
46
78
|
message ResetAgentResponse {
|
luckyrobots/luckyrobots.py
CHANGED
|
@@ -4,6 +4,8 @@ import time
|
|
|
4
4
|
from collections.abc import Sequence
|
|
5
5
|
from typing import Optional
|
|
6
6
|
|
|
7
|
+
from typing import Any
|
|
8
|
+
|
|
7
9
|
from .engine import launch_luckyengine, stop_luckyengine
|
|
8
10
|
from .models import ObservationResponse
|
|
9
11
|
from .client import LuckyEngineClient, GrpcConnectionError
|
|
@@ -170,6 +172,32 @@ class LuckyRobots:
|
|
|
170
172
|
time.sleep(sleep_s)
|
|
171
173
|
return self.get_observation()
|
|
172
174
|
|
|
175
|
+
def reset(
|
|
176
|
+
self,
|
|
177
|
+
agent_name: str = "",
|
|
178
|
+
randomization_cfg: Optional[Any] = None,
|
|
179
|
+
) -> ObservationResponse:
|
|
180
|
+
"""
|
|
181
|
+
Reset the agent and return a fresh observation.
|
|
182
|
+
|
|
183
|
+
Args:
|
|
184
|
+
agent_name: Agent logical name. Empty string means default agent.
|
|
185
|
+
randomization_cfg: Optional domain randomization config for this reset.
|
|
186
|
+
Use this to randomize physics parameters (friction, mass, etc.)
|
|
187
|
+
at the start of each episode for sim-to-real transfer.
|
|
188
|
+
|
|
189
|
+
Returns:
|
|
190
|
+
ObservationResponse after reset.
|
|
191
|
+
|
|
192
|
+
Raises:
|
|
193
|
+
RuntimeError: If reset fails.
|
|
194
|
+
"""
|
|
195
|
+
client = self._require_client()
|
|
196
|
+
resp = client.reset_agent(agent_name=agent_name, randomization_cfg=randomization_cfg)
|
|
197
|
+
if hasattr(resp, "success") and not resp.success:
|
|
198
|
+
raise RuntimeError(f"Reset failed: {getattr(resp, 'message', '')}")
|
|
199
|
+
return self.get_observation(agent_name=agent_name)
|
|
200
|
+
|
|
173
201
|
def close(self, stop_engine: bool = True) -> None:
|
|
174
202
|
"""Close gRPC client and optionally stop the engine executable."""
|
|
175
203
|
if self._engine_client is not None:
|
luckyrobots/models/__init__.py
CHANGED
|
@@ -4,10 +4,12 @@ Pydantic models for LuckyRobots.
|
|
|
4
4
|
|
|
5
5
|
from .observation import ObservationResponse, StateSnapshot
|
|
6
6
|
from .camera import CameraData, CameraShape
|
|
7
|
+
from .randomization import DomainRandomizationConfig
|
|
7
8
|
|
|
8
9
|
__all__ = [
|
|
9
10
|
"ObservationResponse",
|
|
10
11
|
"StateSnapshot",
|
|
11
12
|
"CameraData",
|
|
12
13
|
"CameraShape",
|
|
14
|
+
"DomainRandomizationConfig",
|
|
13
15
|
]
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
"""
|
|
2
|
+
Domain randomization configuration for physics parameters.
|
|
3
|
+
|
|
4
|
+
This model maps to the DomainRandomizationConfig proto message in agent.proto.
|
|
5
|
+
"""
|
|
6
|
+
|
|
7
|
+
from typing import Optional
|
|
8
|
+
from pydantic import BaseModel, Field, ConfigDict
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
class DomainRandomizationConfig(BaseModel):
|
|
12
|
+
"""Domain randomization configuration for physics parameters.
|
|
13
|
+
|
|
14
|
+
All range fields are [min, max] tuples. None/empty means "use defaults".
|
|
15
|
+
|
|
16
|
+
Usage:
|
|
17
|
+
randomization_cfg = DomainRandomizationConfig(
|
|
18
|
+
friction_range=(0.5, 1.5),
|
|
19
|
+
mass_scale_range=(0.8, 1.2),
|
|
20
|
+
joint_position_noise=0.05,
|
|
21
|
+
)
|
|
22
|
+
client.reset_agent(randomization_cfg=randomization_cfg)
|
|
23
|
+
"""
|
|
24
|
+
|
|
25
|
+
model_config = ConfigDict(frozen=True)
|
|
26
|
+
|
|
27
|
+
# Initial state randomization
|
|
28
|
+
pose_position_noise: Optional[tuple[float, float, float]] = Field(
|
|
29
|
+
default=None, description="[x, y, z] position noise std"
|
|
30
|
+
)
|
|
31
|
+
pose_orientation_noise: Optional[float] = Field(
|
|
32
|
+
default=None, description="Orientation noise std (radians)"
|
|
33
|
+
)
|
|
34
|
+
joint_position_noise: Optional[float] = Field(
|
|
35
|
+
default=None, description="Joint position noise std"
|
|
36
|
+
)
|
|
37
|
+
joint_velocity_noise: Optional[float] = Field(
|
|
38
|
+
default=None, description="Joint velocity noise std"
|
|
39
|
+
)
|
|
40
|
+
|
|
41
|
+
# Physics parameters (all [min, max] ranges)
|
|
42
|
+
friction_range: Optional[tuple[float, float]] = Field(
|
|
43
|
+
default=None, description="Surface friction coefficient [min, max]"
|
|
44
|
+
)
|
|
45
|
+
restitution_range: Optional[tuple[float, float]] = Field(
|
|
46
|
+
default=None, description="Bounce/restitution coefficient [min, max]"
|
|
47
|
+
)
|
|
48
|
+
mass_scale_range: Optional[tuple[float, float]] = Field(
|
|
49
|
+
default=None, description="Body mass multiplier [min, max]"
|
|
50
|
+
)
|
|
51
|
+
com_offset_range: Optional[tuple[float, float]] = Field(
|
|
52
|
+
default=None, description="Center of mass offset [min, max]"
|
|
53
|
+
)
|
|
54
|
+
|
|
55
|
+
# Motor/actuator randomization
|
|
56
|
+
motor_strength_range: Optional[tuple[float, float]] = Field(
|
|
57
|
+
default=None, description="Motor strength multiplier [min, max]"
|
|
58
|
+
)
|
|
59
|
+
motor_offset_range: Optional[tuple[float, float]] = Field(
|
|
60
|
+
default=None, description="Motor position offset [min, max]"
|
|
61
|
+
)
|
|
62
|
+
|
|
63
|
+
# External disturbances
|
|
64
|
+
push_interval_range: Optional[tuple[float, float]] = Field(
|
|
65
|
+
default=None, description="Time between pushes [min, max]"
|
|
66
|
+
)
|
|
67
|
+
push_velocity_range: Optional[tuple[float, float]] = Field(
|
|
68
|
+
default=None, description="Push velocity magnitude [min, max]"
|
|
69
|
+
)
|
|
70
|
+
|
|
71
|
+
# Terrain configuration
|
|
72
|
+
terrain_type: Optional[str] = Field(
|
|
73
|
+
default=None, description="Terrain type identifier"
|
|
74
|
+
)
|
|
75
|
+
terrain_difficulty: Optional[float] = Field(
|
|
76
|
+
default=None, description="Terrain difficulty level"
|
|
77
|
+
)
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: luckyrobots
|
|
3
|
-
Version: 0.1.
|
|
3
|
+
Version: 0.1.71
|
|
4
4
|
Summary: Robotics-AI Training in Hyperrealistic Game Environments
|
|
5
5
|
Project-URL: Homepage, https://github.com/luckyrobots/luckyrobots
|
|
6
6
|
Project-URL: Documentation, https://luckyrobots.readthedocs.io
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
luckyrobots/__init__.py,sha256=VWewiYhYbYCs1ZSD0KxozmG2jH2uLlBxsVgFIRivKTM,824
|
|
2
|
+
luckyrobots/client.py,sha256=0i8lVaLHjXXXzNZH3DWoc3ViqWBeoInrPP9nefkNWR4,32646
|
|
3
|
+
luckyrobots/luckyrobots.py,sha256=YLx8mvuOOmY-ZaAve_k2md0HIGG84__5oXUXF1ymjhI,7812
|
|
4
|
+
luckyrobots/utils.py,sha256=62BqpSRBFykVRMZ5Ti2F-yKRDoyU3UNHeesDF_PVCFc,2958
|
|
5
|
+
luckyrobots/config/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
6
|
+
luckyrobots/config/robots.yaml,sha256=Wu2AgwhZxo9F-RLcqPJXHnqzjT8a0wR-rFBcecck_eE,5164
|
|
7
|
+
luckyrobots/engine/__init__.py,sha256=-3r7aLueDF7eyumqIhTvYqS8ZNnVSJUJEHG4ybsKrjc,546
|
|
8
|
+
luckyrobots/engine/check_updates.py,sha256=KGQHrj1LB0_vexktO01xx-ZvPOYKkto4VBb3H1KV7uI,7593
|
|
9
|
+
luckyrobots/engine/download.py,sha256=vIb5T40Jk2BnfjPo0f4KgW14Om6P4_mvPpZ9JAlkVvg,4029
|
|
10
|
+
luckyrobots/engine/manager.py,sha256=8vxSevaoXo-lw2G6y74lVc-Ms8xIELK0yLswydMiOQY,13388
|
|
11
|
+
luckyrobots/grpc/__init__.py,sha256=hPh-X_FEus2sxrfQB2fQjD754X5bMaUFTWm3mZmUhe0,153
|
|
12
|
+
luckyrobots/grpc/generated/__init__.py,sha256=u69M4E_2LwRQSD_n4wvQyMX7dryBCrIdsho59c52Crk,732
|
|
13
|
+
luckyrobots/grpc/generated/agent_pb2.py,sha256=me4OtOKGfwg5JUho6I5NV6v7ie-DO7T6iSCs8LcQ6yM,6555
|
|
14
|
+
luckyrobots/grpc/generated/agent_pb2_grpc.py,sha256=VnjWZTKOE4KWRsy1n-ssfAk1kEP5uUqOhakWKzFtr4g,9123
|
|
15
|
+
luckyrobots/grpc/generated/camera_pb2.py,sha256=2UDkgzMYdDZ53euPfLAndeI7k4wI9QH_Dvwkay6TAB4,2623
|
|
16
|
+
luckyrobots/grpc/generated/camera_pb2_grpc.py,sha256=hUXzsf2qCE-ffZzkF8El2UuuLu6nxjKSYPukId2uFP8,5278
|
|
17
|
+
luckyrobots/grpc/generated/common_pb2.py,sha256=0eZTxqlsZdTrgp2hgLy-hdDNtac5U3kkS_D9UbVy0e8,2045
|
|
18
|
+
luckyrobots/grpc/generated/common_pb2_grpc.py,sha256=MWix04c710srn9BtjDxa9-UkZz0wa-w8tB0EmYndSgg,886
|
|
19
|
+
luckyrobots/grpc/generated/hazel_rpc_pb2.py,sha256=XB1nGSVTYhpulRpS8Ja44KaCV5s-l1t_FPV4DJ5_ak8,1716
|
|
20
|
+
luckyrobots/grpc/generated/hazel_rpc_pb2_grpc.py,sha256=5bhVh5DmVDl2ZsdgN7mTnElDbgU142TOI1qm8a8eblw,889
|
|
21
|
+
luckyrobots/grpc/generated/media_pb2.py,sha256=TtGdBub2Pj1vG_jJJIZnIZealLD0s98wZ4KgGIrcn2c,1827
|
|
22
|
+
luckyrobots/grpc/generated/media_pb2_grpc.py,sha256=szeOZzqDnIBFEyjAtXEHNxytTb9hTvOkQj0PhvXumMM,885
|
|
23
|
+
luckyrobots/grpc/generated/mujoco_pb2.py,sha256=Oq1AdZ0h-svs7ntlaDZ-zvQdTPsulnaE7YaINvBIBpM,3476
|
|
24
|
+
luckyrobots/grpc/generated/mujoco_pb2_grpc.py,sha256=Rz8hyPvhB2nR-0Mej4Ly9ixbrdpPCxDafmL8H4x43Nk,8603
|
|
25
|
+
luckyrobots/grpc/generated/scene_pb2.py,sha256=LzCApFBj0RXsFhvLYW07VXbuZubaiACj6rX8QwbGSG4,3981
|
|
26
|
+
luckyrobots/grpc/generated/scene_pb2_grpc.py,sha256=A-aj6kPPydehlq1PhspITymVNktK0k3fd7xDKMU0Zy0,8569
|
|
27
|
+
luckyrobots/grpc/generated/telemetry_pb2.py,sha256=LgVtxJv7ovtqlrgxG375aXADGt3qXwgpsIhIkJ3pLKE,2790
|
|
28
|
+
luckyrobots/grpc/generated/telemetry_pb2_grpc.py,sha256=8TuCSc7rnQZFNqhEPXUoJsWAnwvEvyyEI5GaqQUCSSs,5463
|
|
29
|
+
luckyrobots/grpc/generated/viewport_pb2.py,sha256=Z_5gBD23z7He_OACYkaIsi0o4LIESzOG7o_rO1lRLVs,3093
|
|
30
|
+
luckyrobots/grpc/generated/viewport_pb2_grpc.py,sha256=BkJqREcjIa3ZdNgZUxH_MvBWOte9VJJGi-KlFgYepog,5436
|
|
31
|
+
luckyrobots/grpc/proto/agent.proto,sha256=XOyjtsTCU9iIl-cXCWVOWynF-WTSDaMVY7EwVEDMEsE,7282
|
|
32
|
+
luckyrobots/grpc/proto/camera.proto,sha256=unLowpk4d0AGJgyKrbzTr1F_CxOV9dXRoXn-gO8eJVw,1097
|
|
33
|
+
luckyrobots/grpc/proto/common.proto,sha256=zQPj-Z8b8mAE2_eHlJ0L2_-JH-CYY_OJcv8046fAtQM,772
|
|
34
|
+
luckyrobots/grpc/proto/hazel_rpc.proto,sha256=gtFukd1B9WRbY2kWBgd5YQWSw4cobYf1YRYX6VEaULE,1229
|
|
35
|
+
luckyrobots/grpc/proto/media.proto,sha256=3Rhmiaw1zceQBFdwxX1ViFgH-cSr7mBjNEGHPaFmTsk,836
|
|
36
|
+
luckyrobots/grpc/proto/mujoco.proto,sha256=b7tBvYqqvcSjmqrEax6_75-P3fIHHZq63A1HVJKjx0U,1873
|
|
37
|
+
luckyrobots/grpc/proto/scene.proto,sha256=y19i9MYkqZQPfrvTZEwMH_LekYGOIjvo5qtCXh9_Xlg,1825
|
|
38
|
+
luckyrobots/grpc/proto/telemetry.proto,sha256=PZiUoA0bpwuvsBUdoQQdBNGWOuhlBMKAiBpwqPZiJgY,1481
|
|
39
|
+
luckyrobots/grpc/proto/viewport.proto,sha256=gunF8cIrVgvoAX8FNER6gw_u-IlRWAR1Q6ts0zUuqr8,1324
|
|
40
|
+
luckyrobots/models/__init__.py,sha256=assqJIKZXvDGwCVM0grNLJCBWyHtKRBAaxdJb2dON10,332
|
|
41
|
+
luckyrobots/models/camera.py,sha256=e-CftAndHASfokhtUtU7ujGb2q_kcXZ6-2KKvY42CKg,3682
|
|
42
|
+
luckyrobots/models/observation.py,sha256=jbRiUTjOP2ZiSobsnNcks3aMPAJA6oPoKqiXwvrNQK0,4758
|
|
43
|
+
luckyrobots/models/randomization.py,sha256=AicqHovzG97Ge33wtNQE-_EvKxndjEHguTjCiHfhAV8,2753
|
|
44
|
+
luckyrobots-0.1.71.dist-info/METADATA,sha256=9E-gglRuotJLzwUVxRy44pQlfDyCwKbImt_Zt7MwBT4,8379
|
|
45
|
+
luckyrobots-0.1.71.dist-info/WHEEL,sha256=WLgqFyCfm_KASv4WHyYy0P3pM_m7J5L9k2skdKLirC8,87
|
|
46
|
+
luckyrobots-0.1.71.dist-info/licenses/LICENSE,sha256=xsPYvRJPH_fW_sofTUknI_KvZOsD4-BqjSOTZqI6Nmw,1069
|
|
47
|
+
luckyrobots-0.1.71.dist-info/RECORD,,
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
luckyrobots/__init__.py,sha256=3hJT7tvGfzU6-PzXICpv4O9SNAiuFhE95o0_dTxLi7Y,739
|
|
2
|
-
luckyrobots/client.py,sha256=D81pk16ZFKP_uYDSJAur_aucRu7eW2JXW0s63HAYWfQ,28935
|
|
3
|
-
luckyrobots/luckyrobots.py,sha256=F68TUhKplLbdkuARGGUer9jSf1QUzLhu1Rfc-vqDZso,6788
|
|
4
|
-
luckyrobots/utils.py,sha256=62BqpSRBFykVRMZ5Ti2F-yKRDoyU3UNHeesDF_PVCFc,2958
|
|
5
|
-
luckyrobots/config/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
6
|
-
luckyrobots/config/robots.yaml,sha256=Wu2AgwhZxo9F-RLcqPJXHnqzjT8a0wR-rFBcecck_eE,5164
|
|
7
|
-
luckyrobots/engine/__init__.py,sha256=-3r7aLueDF7eyumqIhTvYqS8ZNnVSJUJEHG4ybsKrjc,546
|
|
8
|
-
luckyrobots/engine/check_updates.py,sha256=KGQHrj1LB0_vexktO01xx-ZvPOYKkto4VBb3H1KV7uI,7593
|
|
9
|
-
luckyrobots/engine/download.py,sha256=vIb5T40Jk2BnfjPo0f4KgW14Om6P4_mvPpZ9JAlkVvg,4029
|
|
10
|
-
luckyrobots/engine/manager.py,sha256=8vxSevaoXo-lw2G6y74lVc-Ms8xIELK0yLswydMiOQY,13388
|
|
11
|
-
luckyrobots/grpc/__init__.py,sha256=hPh-X_FEus2sxrfQB2fQjD754X5bMaUFTWm3mZmUhe0,153
|
|
12
|
-
luckyrobots/grpc/generated/__init__.py,sha256=u69M4E_2LwRQSD_n4wvQyMX7dryBCrIdsho59c52Crk,732
|
|
13
|
-
luckyrobots/grpc/generated/agent_pb2.py,sha256=71ILNgwKLNhfiTsU8ocZTasG-hNViF03Cn3-ldBvc9A,5728
|
|
14
|
-
luckyrobots/grpc/generated/agent_pb2_grpc.py,sha256=LAiYHz2UhQNFCKYmm4FeKnSIVXpAoR9CpWiIKTu1Bro,8962
|
|
15
|
-
luckyrobots/grpc/generated/camera_pb2.py,sha256=QGxa8sfMqzzdShyA7RVXLWsfSzXZ0Kg7cPSZYYl6E2c,2664
|
|
16
|
-
luckyrobots/grpc/generated/camera_pb2_grpc.py,sha256=u7jimo_r0ThMmQOl43IXoyWNGIX2T583mv4xcCBciqk,5212
|
|
17
|
-
luckyrobots/grpc/generated/common_pb2.py,sha256=puH7AOneT8K5FjcW2PjnUY6e2u-vobtnS4bpaPl4nhM,2073
|
|
18
|
-
luckyrobots/grpc/generated/common_pb2_grpc.py,sha256=kFXVJY9Ju1lO1ramSeiLiMAZBYWBDrDaON96j2C3rXI,901
|
|
19
|
-
luckyrobots/grpc/generated/media_pb2.py,sha256=FUgow9NoFf9DztuVrrokGXxuJBHFb0AKBQAc3aez7BU,1839
|
|
20
|
-
luckyrobots/grpc/generated/media_pb2_grpc.py,sha256=AqZmnqqFTTxtFC5bsA-YygCMD93BTRSb97RBovHCARo,900
|
|
21
|
-
luckyrobots/grpc/generated/mujoco_pb2.py,sha256=20UVm-fptmjfv17L06HKSTkMyVZwKa-aPzaltAUaNSA,3540
|
|
22
|
-
luckyrobots/grpc/generated/mujoco_pb2_grpc.py,sha256=HDroQ6_HgaG06WxLsMwo6DHze3Or8bGXlhJln8Oqwfo,8442
|
|
23
|
-
luckyrobots/grpc/generated/scene_pb2.py,sha256=ggZ5ZqMoYyWY4MShDG6S7TTH7HIa3_uyddxFEkF4ocw,4067
|
|
24
|
-
luckyrobots/grpc/generated/scene_pb2_grpc.py,sha256=yPWO10jLAL9orTtzG08NDjWVz1uw8i9Yf8zRVtESMHE,8417
|
|
25
|
-
luckyrobots/grpc/generated/telemetry_pb2.py,sha256=RdTlqizfmLBlT3Es0A_gkW0ec4rY3AsMwXkuG8Ds8zU,2840
|
|
26
|
-
luckyrobots/grpc/generated/telemetry_pb2_grpc.py,sha256=Sq6nExNUZe1-rERJceSoSt23Pbx-DeFA3zrOJsOQpxA,5397
|
|
27
|
-
luckyrobots/grpc/generated/viewport_pb2.py,sha256=LO_6MujrgVjm_QgeGjsyBVHal13SXN_6ROGb86WAEso,3147
|
|
28
|
-
luckyrobots/grpc/generated/viewport_pb2_grpc.py,sha256=QIrjDAdE2kU-R6VVzAso3iZDDdurJllXkXwBggFYCcs,5370
|
|
29
|
-
luckyrobots/grpc/proto/agent.proto,sha256=-3MzIKGzDC6QhPYUHuCXZfp6ygXA7c9usWblV55np3s,5694
|
|
30
|
-
luckyrobots/grpc/proto/camera.proto,sha256=fXCaU9TdJk0zHJs0Jbkq9DABOwaPJBHyUKj1RyMoJeQ,1100
|
|
31
|
-
luckyrobots/grpc/proto/common.proto,sha256=6twE6_HQUMd1N6Ko2vUEDWtL07pCflHIfmit66ggvg0,775
|
|
32
|
-
luckyrobots/grpc/proto/hazel_rpc.proto,sha256=a0F_Dl1JgmJdoIe4okL_tHDzIQvL7dETrb634EuWTrg,1232
|
|
33
|
-
luckyrobots/grpc/proto/media.proto,sha256=CNZJTepdS6Gx68d_Cd3ciaPrOsAe3e7yZbgHIGYe1LY,839
|
|
34
|
-
luckyrobots/grpc/proto/mujoco.proto,sha256=nVovXeedm-imERtSVLeBR8dpEDmlFxXhyVujKy9BylU,1876
|
|
35
|
-
luckyrobots/grpc/proto/scene.proto,sha256=9p19X6_IdiarDXHczkxvjO6Uhjltbwnk8lYuZik7Q1s,1828
|
|
36
|
-
luckyrobots/grpc/proto/telemetry.proto,sha256=vD27JPNPhgi36fkJMTLoFNbv5YXEiz1xntsK00OJ6-Q,1484
|
|
37
|
-
luckyrobots/grpc/proto/viewport.proto,sha256=l3BZBho-v0DHLKt3OQhJwodaZMxZfFceAPQQUmW7PVU,1327
|
|
38
|
-
luckyrobots/models/__init__.py,sha256=LsKj7q9fMTqpSC4WThJVlRMmwho5D08OURVCgerEURI,246
|
|
39
|
-
luckyrobots/models/camera.py,sha256=e-CftAndHASfokhtUtU7ujGb2q_kcXZ6-2KKvY42CKg,3682
|
|
40
|
-
luckyrobots/models/observation.py,sha256=jbRiUTjOP2ZiSobsnNcks3aMPAJA6oPoKqiXwvrNQK0,4758
|
|
41
|
-
luckyrobots-0.1.69.dist-info/METADATA,sha256=S9czWJXY1XdNYfp2uPzs96YnxBqeJo9CD8ECBy1lQX0,8379
|
|
42
|
-
luckyrobots-0.1.69.dist-info/WHEEL,sha256=WLgqFyCfm_KASv4WHyYy0P3pM_m7J5L9k2skdKLirC8,87
|
|
43
|
-
luckyrobots-0.1.69.dist-info/licenses/LICENSE,sha256=xsPYvRJPH_fW_sofTUknI_KvZOsD4-BqjSOTZqI6Nmw,1069
|
|
44
|
-
luckyrobots-0.1.69.dist-info/RECORD,,
|
|
File without changes
|