You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: PyFlyt/core/abstractions/base_drone.py
+6Lines changed: 6 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -18,6 +18,7 @@ class DroneClass(ABC):
18
18
Each drone inheriting from this class must have several attributes and methods implemented before they can be considered usable.
19
19
20
20
Args:
21
+
----
21
22
p (bullet_client.BulletClient): PyBullet physics client ID.
22
23
start_pos (np.ndarray): an `(3,)` array for the starting X, Y, Z position for the drone.
23
24
start_orn (np.ndarray): an `(3,)` array for the starting X, Y, Z orientation for the drone.
@@ -64,6 +65,7 @@ class DroneClass(ABC):
64
65
>>> self.use_camera = use_camera
65
66
>>> if self.use_camera:
66
67
>>> self.camera = Camera(...)
68
+
67
69
"""
68
70
69
71
def__init__(
@@ -80,6 +82,7 @@ def __init__(
80
82
"""Defines the default configuration for UAVs, to be used in conjunction with the Aviary class.
81
83
82
84
Args:
85
+
----
83
86
p (bullet_client.BulletClient): PyBullet physics client ID.
84
87
start_pos (np.ndarray): an `(3,)` array for the starting X, Y, Z position for the drone.
85
88
start_orn (np.ndarray): an `(3,)` array for the starting X, Y, Z orientation for the drone.
@@ -88,6 +91,7 @@ def __init__(
88
91
drone_model (str): name of the drone itself, must be the same name as the folder where the URDF and YAML files are located.
89
92
model_dir (None | str = None): directory where the drone model folder is located, if none is provided, defaults to the directory of the default drones.
90
93
np_random (None | np.random.RandomState = None): random number generator of the simulation.
94
+
91
95
"""
92
96
ifphysics_hz%control_hz!=0:
93
97
raiseValueError(
@@ -264,9 +268,11 @@ def register_controller(
264
268
"""Default register_controller.
265
269
266
270
Args:
271
+
----
267
272
controller_id (int): ID to bind to this controller
268
273
controller_constructor (type[ControlClass]): A class pointer to the controller implementation, must be subclass of `ControlClass`.
269
274
base_mode (int): Whether this controller uses outputs of an underlying controller as setpoints.
Copy file name to clipboardExpand all lines: PyFlyt/core/abstractions/boosters.py
+13-1Lines changed: 13 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -16,6 +16,7 @@ class Boosters:
16
16
Additionally, some boosters, typically of the solid fuel variety, cannot be extinguished and reignited, a property we call reignitability.
17
17
18
18
Args:
19
+
----
19
20
p (bullet_client.BulletClient): PyBullet physics client ID.
20
21
physics_period (float): physics period of the simulation.
21
22
np_random (np.random.RandomState): random number generator of the simulation.
@@ -31,6 +32,7 @@ class Boosters:
31
32
thrust_unit (np.ndarray): an `(n, 3)` array representing the unit vector pointing in the direction of force for each booster, relative to the booster link's body frame.
32
33
reignitable (np.ndarray | list[bool]): a list of booleans representing whether the booster can be extinguished and then reignited.
33
34
noise_ratio (np.ndarray): a list of floats representing the percent amount of fluctuation present in each booster.
35
+
34
36
"""
35
37
36
38
def__init__(
@@ -54,6 +56,7 @@ def __init__(
54
56
"""Used for simulating an array of boosters.
55
57
56
58
Args:
59
+
----
57
60
p (bullet_client.BulletClient): PyBullet physics client ID.
58
61
physics_period (float): physics period of the simulation.
59
62
np_random (np.random.RandomState): random number generator of the simulation.
@@ -69,6 +72,7 @@ def __init__(
69
72
thrust_unit (np.ndarray): an `(n, 3)` array representing the unit vector pointing in the direction of force for each booster, relative to the booster link's body frame.
70
73
reignitable (np.ndarray | list[bool]): a list of booleans representing whether the booster can be extinguished and then reignited.
71
74
noise_ratio (np.ndarray): a list of floats representing the percent amount of fluctuation present in each booster.
- (b0, b1, ..., bn) represent the remaining fuel ratio
136
142
- (c0, c1, ..., cn) represent the current throttle state
137
143
138
-
Returns:
144
+
Returns
145
+
-------
139
146
np.ndarray: A (3 * num_boosters, ) array
147
+
140
148
"""
141
149
returnnp.concatenate(
142
150
[
@@ -156,9 +164,11 @@ def physics_update(
156
164
"""Converts booster settings into forces on the booster and inertia change on fuel tank.
157
165
158
166
Args:
167
+
----
159
168
ignition (np.ndarray): (num_boosters,) array of booleans for engine on or off.
160
169
pwm (np.ndarray): (num_boosters,) array of floats between [0, 1] for min or max thrust.
161
170
rotation (np.ndarray): (num_boosters, 3, 3) rotation matrices to rotate each booster's thrust axis around, this is readily obtained from the `gimbals` component.
Copy file name to clipboardExpand all lines: PyFlyt/core/abstractions/camera.py
+10-2Lines changed: 10 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -19,6 +19,7 @@ class Camera:
19
19
On image capture, the camera returns an RGBA image, a depth map, and a segmentation map with pixel values representing the IDs of objects in the environment.
20
20
21
21
Args:
22
+
----
22
23
p (bullet_client.BulletClient): PyBullet physics client ID.
23
24
uav_id (int): ID of the drone.
24
25
camera_id (int): integer representing the ID of the link that the camera is attached to.
@@ -29,6 +30,7 @@ class Camera:
29
30
camera_position_offset (np.ndarray = np.array([0.0, 0.0, 0.0])): an (3,) array representing an offset of where the camera is from the center of the link in `camera_id`.
30
31
is_tracking_camera (bool = False): if the camera is a tracking camera, the focus point of the camera is adjusted to focus on the center body of the aircraft instead of at infinity.
31
32
cinematic (bool = False): it's not a bug, it's a feature.
33
+
32
34
"""
33
35
34
36
def__init__(
@@ -47,6 +49,7 @@ def __init__(
47
49
"""Used for implementing camera modules.
48
50
49
51
Args:
52
+
----
50
53
p (bullet_client.BulletClient): PyBullet physics client ID.
51
54
uav_id (int): ID of the drone.
52
55
camera_id (int): integer representing the ID of the link that the camera is attached to.
@@ -57,6 +60,7 @@ def __init__(
57
60
camera_position_offset (np.ndarray = np.array([0.0, 0.0, 0.0])): an (3,) array representing an offset of where the camera is from the center of the link in `camera_id`.
58
61
is_tracking_camera (bool = False): if the camera is a tracking camera, the focus point of the camera is adjusted to focus on the center body of the aircraft instead of at infinity.
59
62
cinematic (bool = False): it's not a bug, it's a feature.
63
+
60
64
"""
61
65
check_numpy()
62
66
ifis_tracking_cameraanduse_gimbal:
@@ -96,8 +100,10 @@ def __init__(
96
100
defview_mat(self) ->np.ndarray:
97
101
"""Generates the view matrix for the camera depending on the current orientation and implicit parameters.
0 commit comments