Actions#

Abstract base class#

class enki_env.config.ActionConfig#

The abstract base class of action configurations.

It defines how a robot actuates actions.

abstractmethod actuate(act: Action, robot: pyenki.DifferentialWheeled, dt: float) None#

How a robot actuates an action.

Must be implemented by concrete classes!

Parameters:
  • act – The action

  • robot – The robot that actuates the action

  • dt – The time step

abstract property space: gym.spaces.Box#

The action space

Must be implemented by concrete classes!

Robot base class#

class enki_env.robots.DifferentialDriveAction(max_speed: float = 0, max_acceleration: float = 1, fix_orientation: bool = False, fix_position: bool = False, acceleration: bool = False, dtype: type[~numpy.floating[~Any]] = <class 'numpy.float64'>)#

Bases: ActionConfig

The action configuration common to all robots.

Actions are given by two numbers in [-1, 1] which are re-scaled and actuated either as (linear) wheel speeds or (linear) wheel accelerations:

left = action[0]
right = action[1]

If either fix_orientation=True or fix_position=True actions are instead given by a single number in [-1, 1] that is mapped to left/right wheel like

left  = +action[0] if fix_orientation
      = -action[0] if fix_position
right = action[0]
acceleration: bool = False#

Whether actions are wheel accelerations or wheel speeds.

dtype#

The scalar type of actions.

alias of float64

fix_orientation: bool = False#

Whether to nullify the angular component. If set, it reduces the dimension of the action space by one.

fix_position: bool = False#

Whether to nullify the linear component. If set, it reduces the dimension of the action space by one.

max_acceleration: float = 1#

Maximal wheel acceleration in cm/s^2; only relevant if acceleration=True.

max_speed: float = 0#

Maximal wheel speed in cm/s.