FlightEnvVec

The wrapper of Flightmare.

class FlightEnvVec(impl)

An OpenAIGym like environment of Flightmare.

env = FlightEnvVec.FlightEnvVec(QuadrotorEnv_v1(

dump(cfg, Dumper=RoundTripDumper), False))

param impl:

Implementation of flightgym

type impl:

flightgym.QuadrotorEnv_v1

seed(self, seed=0)

Set a random seed for the environment.

Parameters:

seed (int) – Random seed

Return type:

bool

step(self, action)

Simulate one step with the given thrusts.

Get observations and the total reward of this step.

// thrusts of each propeller
action = [f1, f2, f3, f4]
//full states of the quadrotor
obs = [position, orientation, linear velocity, angular velocity]
Parameters:

action (np.ndarray) – thrusts of each propeller

Return type:

observations, reward, done, info

Error

stepUnity() not yet implemented.

stepUnity(self, action, send_id)

Simulate one step with the given thrusts and render it in Unity.

Get observations and the total reward of this step.

// thrusts of each propeller
action = [f1, f2, f3, f4]
//full states of the quadrotor
obs = [position, orientation, linear velocity, angular velocity]
Parameters:
  • action (np.ndarray) – thrusts of each propeller

  • send_id (int) – frame ID

Return type:

observations, reward, done, info

sample_actions(self)

Sample an action.

// thrusts of each propeller
action = [f1, f2, f3, f4]
Return type:

action (np.ndarray)

reset()

Reset the quadrotor state and get observations.

//full states of the quadrotor
obs = [position, orientation, linear velocity, angular velocity]
Return type:

obs

reset_and_update_info(self)

Reset the quadrotor state, get observations and update info.

//full states of the quadrotor
obs = [position, orientation, linear velocity, angular velocity]
Return type:

obs, info

Error

render() not yet implemented.

render(self, mode='human')

Render in Flightmare.

rtype:

None

close(self)

Close the environment.

Return type:

None

connectUnity(self)

Connect to Flightmare.

Return type:

None

disconnectUnity(self)

Disconnect from Flightmare.

Return type:

None