PyFlyt/QuadX-Ball-In-Cup-v2#

https://raw.githubusercontent.com/jjshoots/PyFlyt/master/readme_assets/quadx_ball_in_cup.gif

Task Description#

The goal is to swing up a suspended ball onto the drone, and then bring it to the starting position.

This environment was introduced and contributed by GitHub user defrag-bambino.

Usage#

import gymnasium
import PyFlyt.gym_envs

env = gymnasium.make("PyFlyt/QuadX-Ball-In-Cup-v2", render_mode="human")

term, trunc = False, False
obs, _ = env.reset()
while not (term or trunc):
    obs, rew, term, trunc, _ = env.step(env.action_space.sample())

Environment Options#

class PyFlyt.gym_envs.quadx_envs.quadx_ball_in_cup_env.QuadXBallInCupEnv(sparse_reward: bool = False, goal_reach_distance: float = 1.0, goal_reach_velocity: float = 1.0, flight_mode: int = 0, flight_dome_size: float = 30.0, max_duration_seconds: float = 20.0, angle_representation: Literal['euler', 'quaternion'] = 'quaternion', agent_hz: int = 30, render_mode: None | Literal['human', 'rgb_array'] = None, render_resolution: tuple[int, int] = (480, 480))#

QuadX Ball-in-Cup Environment.

Actions are vp, vq, vr, T, ie: angular rates and thrust. The goal is to swing up a suspended ball onto the drone, and then bring it to the starting position.

Args:#

sparse_reward (bool): whether to use sparse rewards or not. goal_reach_distance (float): minimum distance from the ending position that the UAV must reach for success. goal_reach_velocity (float): maximum velocity that the UAV must maintain at the ending position for success. flight_mode (int): the flight mode of the UAV. flight_dome_size (float): size of the allowable flying area. max_duration_seconds (float): maximum simulation time of the environment. angle_representation (Literal[“euler”, “quaternion”]): can be “euler” or “quaternion”. agent_hz (int): looprate of the agent to environment interaction. render_mode (None | Literal[“human”, “rgb_array”]): render_mode render_resolution (tuple[int, int]): render_resolution.