spotmicro.GymEnvs package¶
Submodules¶
spotmicro.GymEnvs.spot_bezier_env module¶
This file implements the gym environment of SpotMicro with Bezier Curve.
-
class
spotmicro.GymEnvs.spot_bezier_env.
spotBezierEnv
(distance_weight=1.0, rotation_weight=0.0, energy_weight=0.0, shake_weight=0.0, drift_weight=0.0, rp_weight=10.0, rate_weight=0.03, urdf_root='/home/docs/checkouts/readthedocs.org/user_builds/spot-mini-mini/envs/latest/lib/python3.7/site-packages/pybullet_data', urdf_version=None, distance_limit=inf, observation_noise_stdev=(0.0, 0.0, 0.0, 0.0, 0.0), self_collision_enabled=True, motor_velocity_limit=inf, pd_control_enabled=False, leg_model_enabled=False, accurate_motor_model_enabled=False, remove_default_joint_damping=False, motor_kp=2.0, motor_kd=0.03, control_latency=0.0, pd_latency=0.0, torque_control_enabled=False, motor_overheat_protection=False, hard_reset=False, on_rack=False, render=True, num_steps_to_log=1000, action_repeat=1, control_time_step=None, env_randomizer=<spotmicro.spot_env_randomizer.SpotEnvRandomizer object>, forward_reward_cap=inf, reflection=True, log_path=None, desired_velocity=0.5, desired_rate=0.0, lateral=False, draw_foot_path=False, height_field=False, AutoStepper=True, action_dim=14, contacts=True)[source]¶ Bases:
spotmicro.spot_gym_env.spotGymEnv
The gym environment for spot.
It simulates the locomotion of spot, a quadruped robot. The state space include the angles, velocities and torques for all the motors and the action space is the desired motor angle for each motor. The reward function is based on how far spot walks in 1000 steps and penalizes the energy expenditure.
-
metadata
= {'render.modes': ['human', 'rgb_array'], 'video.frames_per_second': 50}¶
-
step
(action)[source]¶ Step forward the simulation, given the action.
- Args:
action: A list of desired motor angles for eight motors. smach: the bezier state machine containing simulated
random controll inputs- Returns:
- observations: The angles, velocities and torques of all motors. reward: The reward for the current state-action pair. done: Whether the episode has ended. info: A dictionary that stores diagnostic information.
- Raises:
- ValueError: The action dimension is not the same as the number of motors. ValueError: The magnitude of actions is out of bounds.
-