QUAD20#

Quadrotor system.

This system is taken from ARCH-COMP20 Category Report: Continuous and Hybrid Systems with Nonlinear Dynamics.

class gym_socks.envs.QUAD20.QuadrotorEnv(*args, **kwargs)[source]#

Quadrotor system.

Bases: gym_socks.envs.dynamical_system.DynamicalSystem

The quadrotor system is a high-dimensional (12D) system. The states are the position, velocity, and angles of the system, and the inputs are the torques on the angles.

action_space = None#

The action (input) space of the system.

property center_mass#
close()[source]#

Override close in your subclass to perform any necessary cleanup.

Environments will automatically close() themselves when garbage collected or when the program exits.

cost(time, state, action)[source]#

Cost function for the system.

Warning

This function is typically not used in SOCKS, but is included here for compatibility with OpenAI gym, which returns the cost from the step() function.

dynamics(time, state, action, disturbance)[source]#

Dynamics for the system.

generate_disturbance(time, state, action)[source]#

Generate a disturbance.

Note

Override generate_disturbance() in subclasses to modify the disturbance properties, such as the scale or distribution.

generate_observation(time, state, action)[source]#

Generate an observation from the system.

\[y = h(x, u, v)\]
Parameters
  • time – The time variable.

  • state – The state of the system at the current time step.

  • action – The control action applied at the current time step.

Returns

An observation of the system at the current time step.

Note

Override generate_observation() in subclasses if the system is partially observable. By default, the function returns the system state directly, meaning it is fully observable.

property gravitational_acceleration#
property np_random#

Random number generator.

observation_space = None#

The space of system observations.

Note

The observation space typically only differs from the state space if the system is partially observable. If this is the case, generate_observation() should be defined to return an element of the observation space.

property radius_center_mass#
render(mode='human')[source]#

Renders the environment.

This method must be overridden in subclasses in order to enable rendering. Not all environments support rendering.

Parameters

mode – the mode to render with

reset(state=None)[source]#

Reset the system to a random initial condition.

property rotor_distance#
property rotor_mass#
property sampling_time#

Sampling time, in seconds.

seed(seed=None)[source]#

Sets the seed of the random number generator.

Parameters

seed – Integer value representing the random seed.

Returns

The seed of the RNG.

state_space = None#

The state space of the system.

Note

By convention, in controls theory the state space of the system is the set of all possible states that the system can have. OpenAI Gym’s convention is to ignore the underlying state space, opting to use only the observation_space.

step(time=0, action=None)[source]#

Advances the system forward one time step.

Parameters
  • time – Time of the simulation. Used primarily for time-varying systems.

  • action – Action (input) applied to the system at the current time step.

Returns

A tuple (obs, cost, done, info), where obs is the observation vector. Generally, it is the state of the system corrupted by some measurement noise. If the system is fully observable, this is the actual state of the system at the next time step. cost is the cost (reward) obtained by the system for taking action u in state x and transitioning to state y. In general, this is not typically used with DynamicalSystem models. done is a flag to indicate the simulation has terminated. Usually toggled by guard conditions, which terminates the simulation if the system violates certain operating constraints. info is a dictionary containing extra information.

Return type

tuple