1from __future__
import annotations
4from typing
import Callable, Optional, Sequence, Union, overload
42 R360p:
"VideoResolution"
43 R480p:
"VideoResolution"
44 R720p:
"VideoResolution"
45 R1080p:
"VideoResolution"
46 R2K:
"VideoResolution"
47 R4K:
"VideoResolution"
51 """Placement target in an accumulated scene spec."""
54 def __init__(self, kind: AttachKind = AttachKind.World, name: str =
"") ->
None: ...
58 """MJCF attachment applied to a robot root or prior attachment."""
60 attach_to: AttachTarget
64 contact_exclusions: list[tuple[str, str]]
69 """Robot root MJCF plus placement and ordered attachment specs."""
72 attach_to: AttachTarget
75 attachments: list[AttachmentSpec]
80 """MJCF asset or primitive object. Primitive size, rgba, mass, and friction are required."""
83 attach_to: AttachTarget
85 size: Optional[list[float]]
87 rgba: Optional[list[float]]
91 friction: Optional[list[float]]
96 """Named fixed world camera. pos and fovy are required."""
98 pos: Optional[list[float]]
100 fovy: Optional[float]
105 """Full scene description. timestep, add_floor, and add_skybox are required."""
106 robots: list[RobotSpec]
107 timestep: Optional[float]
109 add_floor: Optional[bool]
110 add_skybox: Optional[bool]
111 objects: list[SceneObject]
112 cameras: list[CameraSpec]
117 """Logical FT sensor backed by MuJoCo force and torque sensors."""
126 """Optional tool mass/TCP description for building the robot KDL chain."""
129 ft_sensors: list[ForceTorqueSensorSpec]
145 """Context passed to Env.on_reset after MuJoCo data is reset."""
149 def info(self) -> ResetInfo: ...
153 """Owned MuJoCo model/data built from SceneSpec."""
156 def build(spec: SceneSpec) ->
"Scene": ...
157 """Build and compile a MuJoCo scene."""
167 """Return a body world pose as PyKDL.Frame."""
169 """Return a site world pose as PyKDL.Frame."""
173 pos: Sequence[float],
174 quat: Optional[Sequence[float]] =
None,
176 """Set a free body pose. quat is xyzw when provided."""
181 force: Sequence[float],
182 torque: Sequence[float] = (0.0, 0.0, 0.0),
184 """Set a world-frame external body wrench."""
188 """Rebuild the scene with an added object and rebind existing Robot handles."""
190 """Rebuild the scene without the named object and rebind existing Robot handles."""
194 """Robot handle synchronized with a Scene or Env and backed by a wrapper-built KDL chain."""
198 joint_names: list[str]
199 joint_limits: list[tuple[float, float]]
200 jnt_pos_msr: list[float]
201 jnt_vel_msr: list[float]
202 jnt_trq_msr: list[float]
203 jnt_pos_cmd: list[float]
204 jnt_trq_cmd: list[float]
211 tool: Optional[ToolFrameSpec] =
None,
218 q: Union[Sequence[float], kdl.JntArray],
219 call_forward: bool =
True,
223 """Return the wrapper-built chain as a PyKDL.Chain."""
227 """Return the latest measured force-torque sensor value as a PyKDL.Wrench."""
229 """Return the configured FT sensor frame_site pose as a PyKDL.Frame."""
232 q: Optional[Union[Sequence[float], kdl.JntArray]] =
None,
234 """Return FK terminal pose as PyKDL.Frame."""
244 """Wrapper for the custom MuJoCo simulate UI."""
245 realtime_factor: float
248 def open(robot: Robot, title: str =
"MuJoCo") ->
"SimulateViewer": ...
251 def open(scene:
"Scene", title: str =
"MuJoCo") ->
"SimulateViewer": ...
261 rgba: Optional[Sequence[float]] =
None,
269 lookat: tuple[float, float, float] = (0.0, 0.0, 0.0),
274 """Offscreen MuJoCo video recorder for a Scene or Env."""
277 scene: Union[
"Scene",
"Env"],
282 ) ->
"VideoRecorder": ...
285 scene: Union[
"Scene",
"Env"],
287 resolution: VideoResolution = VideoResolution.R720p,
289 ) ->
"VideoRecorder": ...
297 lookat: tuple[float, float, float] = (0.0, 0.0, 0.0),
303 """Resettable scene environment that keeps registered Robot handles synchronized."""
305 on_reset: Optional[Callable[[ResetContext],
None]]
307 def build(spec: SceneSpec) ->
"Env": ...
314 tool: Optional[ToolFrameSpec] =
None,
316 def reset(self, options: Optional[ResetOptions] =
None) -> ResetInfo: ...
318 """Rebuild the environment with an added object and rebind existing Robot handles."""
320 """Rebuild the environment without the named object and rebind existing Robot handles."""
329 pos: Sequence[float],
330 quat: Optional[Sequence[float]] =
None,
336 force: Sequence[float],
337 torque: Sequence[float] = (0.0, 0.0, 0.0),
346__mujoco_version__: str
None __init__(self, AttachKind kind=AttachKind.World, str name="")
None save_xml(self, str path)
kdl.Frame site_frame(self, str name)
"Env" build(SceneSpec spec)
None save_binary(self, str path)
bool has_actuator(self, str name)
None set_actuator_ctrl(self, str name, float value)
float actuator_ctrl(self, str name)
None set_body_wrench(self, str name, Sequence[float] force, Sequence[float] torque=(0.0, 0.0, 0.0))
kdl.Frame body_frame(self, str name)
ResetInfo reset(self, Optional[ResetOptions] options=None)
None add_object(self, SceneObject object)
Robot create_robot(self, str base_body, str tip_body, str prefix="", Optional[ToolFrameSpec] tool=None)
list[str] camera_names(self)
None remove_object(self, str name)
None set_body_pose(self, str name, Sequence[float] pos, Optional[Sequence[float]] quat=None)
ResetOptions options(self)
None set_joint_pos(self, Union[Sequence[float], kdl.JntArray] q, bool call_forward=True)
list[str] ft_sensor_names(self)
"Robot" from_scene(Scene scene, str base_body, str tip_body, str prefix="", Optional[ToolFrameSpec] tool=None)
kdl.Chain kdl_chain(self)
kdl.Frame ft_sensor_frame(self, str name)
kdl.Frame tip_to_tcp(self)
kdl.Wrench ft_sensor(self, str name)
kdl.Frame fk_frame(self, Optional[Union[Sequence[float], kdl.JntArray]] q=None)
list[float] gravity_torques(self, float gravity_z=-9.81)
list[str] camera_names(self)
None set_actuator_ctrl(self, str name, float value)
kdl.Frame body_frame(self, str name)
"Scene" build(SceneSpec spec)
float actuator_ctrl(self, str name)
kdl.Frame site_frame(self, str name)
None set_body_pose(self, str name, Sequence[float] pos, Optional[Sequence[float]] quat=None)
None save_xml(self, str path)
None add_object(self, SceneObject object)
bool has_actuator(self, str name)
None set_body_wrench(self, str name, Sequence[float] force, Sequence[float] torque=(0.0, 0.0, 0.0))
None remove_object(self, str name)
None save_binary(self, str path)
bool use_camera(self, str name="")
None set_free_camera(self, float distance, float azimuth, float elevation, tuple[float, float, float] lookat=(0.0, 0.0, 0.0))
None add_trace_segment(self, Sequence[float] a, Sequence[float] b, Optional[Sequence[float]] rgba=None)
"SimulateViewer" open(Robot robot, str title="MuJoCo")
"VideoRecorder" open_preset(Union["Scene", "Env"] scene, str out_path, VideoResolution resolution=VideoResolution.R720p, int fps=60)
None set_free_camera(self, float distance, float azimuth, float elevation, tuple[float, float, float] lookat=(0.0, 0.0, 0.0))
"VideoRecorder" open(Union["Scene", "Env"] scene, str out_path, int width=1280, int height=720, int fps=60)
bool use_camera(self, str name="")
str scene_object_site_name(SceneObject object, str site_name)
None set_log_level(LogLevel level)