1313class QuadXPoleBalanceEnv (QuadXBaseEnv ):
1414 """Simple Hover Environment with the additional goal of keeping a pole upright.
1515
16- Actions are vp, vq, vr, T, ie: angular rates and thrust .
16+ Actions are direct motor PWM commands because any underlying controller introduces too much control latency .
1717 The target is to not crash and not let the pole hit the ground for the longest time possible.
1818
1919 Args:
@@ -32,7 +32,7 @@ class QuadXPoleBalanceEnv(QuadXBaseEnv):
3232 def __init__ (
3333 self ,
3434 sparse_reward : bool = False ,
35- flight_mode : int = 0 ,
35+ flight_mode : int = - 1 ,
3636 flight_dome_size : float = 3.0 ,
3737 max_duration_seconds : float = 20.0 ,
3838 angle_representation : Literal ["euler" , "quaternion" ] = "quaternion" ,
@@ -45,12 +45,12 @@ def __init__(
4545 Args:
4646 ----
4747 sparse_reward (bool): whether to use sparse rewards or not.
48- flight_mode (int): the flight mode of the UAV
48+ flight_mode (int): the flight mode of the UAV.
4949 flight_dome_size (float): size of the allowable flying area.
5050 max_duration_seconds (float): maximum simulation time of the environment.
5151 angle_representation (Literal["euler", "quaternion"]): can be "euler" or "quaternion".
5252 agent_hz (int): looprate of the agent to environment interaction.
53- render_mode (None | Literal["human", "rgb_array"]): render_mode
53+ render_mode (None | Literal["human", "rgb_array"]): render_mode.
5454 render_resolution (tuple[int, int]): render_resolution.
5555
5656 """
@@ -94,7 +94,10 @@ def reset(
9494 super ().begin_reset (
9595 seed ,
9696 options ,
97- drone_options = {"drone_model" : "primitive_drone" },
97+ drone_options = {
98+ "drone_model" : "primitive_drone" ,
99+ "camera_position_offset" : np .array ([- 3.0 , 0.0 , 1.0 ]),
100+ },
98101 )
99102 self .pole .reset (p = self .env , start_location = np .array ([0.0 , 0.0 , 1.55 ]))
100103 super ().end_reset (seed , options )
0 commit comments