unilab.envs.locomotion.go2w.joystick¶
Functions
|
Build reset DR payloads that are valid for a motor-actuator Go2W model. |
|
Classes
Go2WDomainRandConfig(randomize_base_mass: 'bool' = False, added_mass_range: 'list[float]' = <factory>, randomize_body_mass: 'bool' = False, body_mass_multiplier_range: 'list[float]' = <factory>, random_com: 'bool' = False, com_offset_x: 'list[float]' = <factory>, randomize_gravity: 'bool' = False, gravity_range: 'list[list[float]]' = <factory>, randomize_ground_friction: 'bool' = False, ground_friction_multiplier_range: 'list[float]' = <factory>, randomize_dof_armature: 'bool' = False, dof_armature_multiplier_range: 'list[float]' = <factory>, push_robots: 'bool' = False, push_interval: 'int' = 750, max_force: 'list[float]' = <factory>, push_body_name: 'str | None' = None, randomize_init_yaw: 'bool' = True, init_z_range: 'list[float]' = <factory>, init_roll_range: 'list[float]' = <factory>, init_pitch_range: 'list[float]' = <factory>, init_yaw_range: 'list[float]' = <factory>, randomize_kp: 'bool' = True, kp_multiplier_range: 'list[float]' = <factory>, randomize_kd: 'bool' = True, kd_multiplier_range: 'list[float]' = <factory>) |
|
Go2WJoystickCfg(scene: 'SceneCfg' = <factory>, sim_dt: 'float' = 0.005, max_episode_seconds: 'float' = 20.0, ctrl_dt: 'float' = 0.02, render_spacing: float = 1.0, render_offset_mode: str = 'grid', motrix_max_iterations: Optional[int] = None, post_step_forward_sensor: bool = False, control_config: 'ControlConfig' = <factory>, noise_config: 'NoiseConfig' = <factory>, sensor: 'JoystickSensor' = <factory>, asset: 'Asset' = <factory>, init_state: 'InitState' = <factory>, commands: 'Commands' = <factory>, reward_config: 'RewardConfig | None' = None, domain_rand: 'Go2WDomainRandConfig' = <factory>) |
|
InitState() |
|
JoystickSensor() |
|
RewardConfig(scales: 'dict[str, float]', tracking_sigma: 'float', base_height_target: 'float', only_positive_rewards: 'bool' = False, joint_pos_penalty_stand_still_scale: 'float' = 5.0, joint_pos_penalty_velocity_threshold: 'float' = 0.5, joint_pos_penalty_command_threshold: 'float' = 0.1) |
- class unilab.envs.locomotion.go2w.joystick.InitState[source]¶
Bases:
objectInitState()
- pos = [0.0, 0.0, 0.42]¶
- __init__()¶
- class unilab.envs.locomotion.go2w.joystick.Go2WDomainRandConfig[source]¶
Bases:
DomainRandConfigGo2WDomainRandConfig(randomize_base_mass: ‘bool’ = False, added_mass_range: ‘list[float]’ = <factory>, randomize_body_mass: ‘bool’ = False, body_mass_multiplier_range: ‘list[float]’ = <factory>, random_com: ‘bool’ = False, com_offset_x: ‘list[float]’ = <factory>, randomize_gravity: ‘bool’ = False, gravity_range: ‘list[list[float]]’ = <factory>, randomize_ground_friction: ‘bool’ = False, ground_friction_multiplier_range: ‘list[float]’ = <factory>, randomize_dof_armature: ‘bool’ = False, dof_armature_multiplier_range: ‘list[float]’ = <factory>, push_robots: ‘bool’ = False, push_interval: ‘int’ = 750, max_force: ‘list[float]’ = <factory>, push_body_name: ‘str | None’ = None, randomize_init_yaw: ‘bool’ = True, init_z_range: ‘list[float]’ = <factory>, init_roll_range: ‘list[float]’ = <factory>, init_pitch_range: ‘list[float]’ = <factory>, init_yaw_range: ‘list[float]’ = <factory>, randomize_kp: ‘bool’ = True, kp_multiplier_range: ‘list[float]’ = <factory>, randomize_kd: ‘bool’ = True, kd_multiplier_range: ‘list[float]’ = <factory>)
- Parameters:
- __init__(randomize_base_mass=False, added_mass_range=<factory>, randomize_body_mass=False, body_mass_multiplier_range=<factory>, random_com=False, com_offset_x=<factory>, randomize_gravity=False, gravity_range=<factory>, randomize_ground_friction=False, ground_friction_multiplier_range=<factory>, randomize_dof_armature=False, dof_armature_multiplier_range=<factory>, push_robots=False, push_interval=750, max_force=<factory>, push_body_name=None, randomize_init_yaw=True, init_z_range=<factory>, init_roll_range=<factory>, init_pitch_range=<factory>, init_yaw_range=<factory>, randomize_kp=True, kp_multiplier_range=<factory>, randomize_kd=True, kd_multiplier_range=<factory>)¶
- class unilab.envs.locomotion.go2w.joystick.RewardConfig[source]¶
Bases:
objectRewardConfig(scales: ‘dict[str, float]’, tracking_sigma: ‘float’, base_height_target: ‘float’, only_positive_rewards: ‘bool’ = False, joint_pos_penalty_stand_still_scale: ‘float’ = 5.0, joint_pos_penalty_velocity_threshold: ‘float’ = 0.5, joint_pos_penalty_command_threshold: ‘float’ = 0.1)
- Parameters:
- __init__(scales, tracking_sigma, base_height_target, only_positive_rewards=False, joint_pos_penalty_stand_still_scale=5.0, joint_pos_penalty_velocity_threshold=0.5, joint_pos_penalty_command_threshold=0.1)¶
- class unilab.envs.locomotion.go2w.joystick.JoystickSensor[source]¶
Bases:
objectJoystickSensor()
- local_linvel = 'local_linvel'¶
- gyro = 'gyro'¶
- gravity = 'upvector'¶
- __init__()¶
- class unilab.envs.locomotion.go2w.joystick.Go2WJoystickCfg[source]¶
Bases:
Go2WBaseCfgGo2WJoystickCfg(scene: ‘SceneCfg’ = <factory>, sim_dt: ‘float’ = 0.005, max_episode_seconds: ‘float’ = 20.0, ctrl_dt: ‘float’ = 0.02, render_spacing: float = 1.0, render_offset_mode: str = ‘grid’, motrix_max_iterations: Optional[int] = None, post_step_forward_sensor: bool = False, control_config: ‘ControlConfig’ = <factory>, noise_config: ‘NoiseConfig’ = <factory>, sensor: ‘JoystickSensor’ = <factory>, asset: ‘Asset’ = <factory>, init_state: ‘InitState’ = <factory>, commands: ‘Commands’ = <factory>, reward_config: ‘RewardConfig | None’ = None, domain_rand: ‘Go2WDomainRandConfig’ = <factory>)
- Parameters:
scene (SceneCfg)
sim_dt (float)
max_episode_seconds (float)
ctrl_dt (float)
render_spacing (
float)render_offset_mode (
str)post_step_forward_sensor (
bool)control_config (ControlConfig)
noise_config (NoiseConfig)
sensor (JoystickSensor)
asset (Asset)
init_state (InitState)
commands (Commands)
reward_config (RewardConfig | None)
domain_rand (Go2WDomainRandConfig)
- max_episode_seconds: float = 20.0¶
- init_state: InitState¶
- commands: Commands¶
- reward_config: RewardConfig | None = None¶
- sensor: JoystickSensor¶
- domain_rand: Go2WDomainRandConfig¶
- __init__(scene=<factory>, sim_dt=0.005, max_episode_seconds=20.0, ctrl_dt=0.02, render_spacing=1.0, render_offset_mode='grid', motrix_max_iterations=None, post_step_forward_sensor=False, control_config=<factory>, noise_config=<factory>, sensor=<factory>, asset=<factory>, init_state=<factory>, commands=<factory>, reward_config=None, domain_rand=<factory>)¶
- Parameters:
scene (SceneCfg)
sim_dt (float)
max_episode_seconds (float)
ctrl_dt (float)
render_spacing (
float)render_offset_mode (
str)post_step_forward_sensor (
bool)control_config (ControlConfig)
noise_config (NoiseConfig)
sensor (JoystickSensor)
asset (Asset)
init_state (InitState)
commands (Commands)
reward_config (RewardConfig | None)
domain_rand (Go2WDomainRandConfig)
- unilab.envs.locomotion.go2w.joystick.build_go2w_backend_reset_randomization(env, num_reset)[source]¶
Build reset DR payloads that are valid for a motor-actuator Go2W model.
kp/kd are intentionally excluded here. Go2W samples them through the same config path as Go2, but applies them inside its owner pre-step motor control.
- Parameters:
- Return type:
- unilab.envs.locomotion.go2w.joystick.sample_go2w_reset_yaw(domain_rand, num_reset)[source]¶
- Parameters:
domain_rand (
Go2WDomainRandConfig)num_reset (
int)
- Return type:
- class unilab.envs.locomotion.go2w.joystick.Go2WJoystickDomainRandomizationProvider[source]¶
Bases:
LocomotionDRProvider- validate(env, capabilities)[source]¶
- Parameters:
env (
Any)capabilities (
DomainRandomizationCapabilities)
- Return type:
- class unilab.envs.locomotion.go2w.joystick.Go2WJoystickEnv[source]¶
Bases:
Go2WBaseEnv- Parameters:
cfg (
Go2WJoystickCfg)
- __init__(cfg, num_envs=1, backend_type='mujoco')[source]¶
- Parameters:
cfg (
Go2WJoystickCfg)
- property obs_groups_spec: dict[str, int]¶
101}.
Subclasses MUST override this property.
- Type:
Return observation group dimensions, e.g. {“obs”
- Type:
98, “critic”
- apply_action(actions, state)[source]¶
子类实现:action → ctrl
- Parameters:
actions (
ndarray)state (
NpEnvState)
- Return type:
- update_state(state)[source]¶
子类实现:计算 obs/reward/terminated
- Parameters:
state (
NpEnvState)- Return type: