
    nie                     N    S r SSKrSSKJrJr  SrSr " S S\R                  S9rg)	zThe abstract robot class.    N)OptionalSequencelinear_velocityangular_velocityc                      \ rS rSrSr\R                    SS\\\	      S\\\	      SS4S jj5       r
\R                  S 5       r\R                  S	 5       r\R                  S
 5       r\R                  S 5       r\R                  S 5       r\S 5       r\\R                  S 5       5       r\S 5       r\S 5       r\S 5       r\S 5       r\S 5       rSrg)	RobotBase   z8The base class for all robots used in the mobility team.Nbase_positionbase_orientation_quaternionreturnc                     g)a#  Resets the states (e.g. pose and sensor readings) of the robot.

This is called at the start of each episode by the environment.

Args:
  base_position: Robot base position after reset. If None, robot stay where
    it was after reset. For robot that does not support reset with position
    change, a ValueError should be raised.
  base_orientation_quaternion: Robot base orientation after reset. If None,
    robot stays in pre-reset orientation. For robot that does not support
    reset with orientation change, a ValueError should be raised.
N )selfr
   r   s      b/home/james-whalen/.local/lib/python3.13/site-packages/pybullet_envs/minitaur/robots/robot_base.pyresetRobotBase.reset   s    " 	    c                     g)zShuts down the robot.Nr   r   s    r   	terminateRobotBase.terminate"        	r   c                     g)a  Processes the input action before the action repeat loop.

We assume that an action sent to the real robot is sticky, i.e. it will be
executed until a new action is received after some time. To simulate this,
we introduced the action_repeat parameter, to reflect how many time steps it
takes for the policy to generate a new action. That is, for each control
step, the simulation contains an inner loop:

  robot.pre_control_step(action)  # Smooth or interpolate the action
  for i in range(action_repeat):
    robot.apply_action(action)
    bullet.stepSimulation(time_step)  # Step the sim for one time step
    robot.receive_observation()  # Update the sensor observations
  robot.post_control_step() # Update some internal variables.

Args:
  action: Data type depends on the robot. Can be desired motor
    position/torques for legged robots, or desired velocity/angular velocity
    for wheeled robots.
Nr   r   actions     r   pre_control_stepRobotBase.pre_control_step'   s    , 	r   c                     g)z Applies the action to the robot.Nr   r   s     r   apply_actionRobotBase.apply_action?   r   r   c                     g)z"Updates the robot sensor readings.Nr   r   s    r   receive_observationRobotBase.receive_observationD   r   r   c                     g)z6Updates some internal variables such as step counters.Nr   r   s    r   post_control_stepRobotBase.post_control_stepI   r   r   c                     [        S5      e)zThe action spec of the robot.zaction_space is not implementedNotImplementedErrorr   s    r   action_spaceRobotBase.action_spaceN   s     ?
@@r   c                     g)a9  Name of each action in the action_space.

This is a structure of strings with the same shape as the action space,
where each string describes the corresponding element of the action space
(for example, a kinematic robot might return ("linear_velocity",
"angular_velocity")). Used for logging in the safety layer.
Nr   r   s    r   action_namesRobotBase.action_namesS   s    r   c                     [        S5      e)a  Returns the sensors on this robot.

Sensors are the main interface between the robot class and the gym
environment. Sensors can return what the robot can measure (e.g.
joint angles, IMU readings), and can represent more general quantities, i.e.
the last action taken, that can be part of the observation space.
Sensor classes are used by the robot class to the specify its observation
space.

z sensors property not implementedr(   r   s    r   sensorsRobotBase.sensors^   s     @
AAr   c                     [        S5      e)a  Returns the base pose as a quaternion in format (x, y, z, w).

These properties differ from the sensor interfaces, as they represent
the built-in measurable quantities. We assume most robots have an IMU at
its base to measure the base pose. Actually, some sensor classes like the
base pose sensor and joint angle sensor will call these built-in methods. In
general, how these quantities can be extracted depends on the specific real
robots.

z.base_orientation_quaternion is not implementedr(   r   s    r   r   %RobotBase.base_orientation_quaternionl   s     N
OOr   c                     [        S5      e)z-Returns the base roll, pitch, and yaw angles.z&base_roll_pitch_yaw is not implementedr(   r   s    r   base_roll_pitch_yawRobotBase.base_roll_pitch_yawz   s     F
GGr   c                     [        S5      e)Nz+base_roll_pitch_yaw_rate is not implementedr(   r   s    r   base_roll_pitch_yaw_rate"RobotBase.base_roll_pitch_yaw_rate   s    
K
LLr   c                     [        S5      e)Nz base_position is not implementedr(   r   s    r   r
   RobotBase.base_position   s    
@
AAr   r   )NN)__name__
__module____qualname____firstlineno____doc__abcabstractmethodr   r   floatr   r   r   r   r"   r%   propertyr*   r-   r0   r   r5   r8   r
   __static_attributes__r   r   r   r   r      s}   @ 26?C	huo.	 $,HUO#<	 IM	 	$ 	 	 	 	. 	 	 	 	 	 	 A A    B B P P H H M M B Br   r   )	metaclass)	r@   rA   typingr   r   LINEAR_VELOCITYANGULAR_VELOCITYABCMetar   r   r   r   <module>rK      s/     
 % $% yB#++ yBr   