Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion PyFlyt/core/abstractions/base_wind_field.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ class WindFieldClass(ABC):
>>> wind[:, -1] = np.log(position[:, -1]) * self.strength
>>>
>>> # plus some noise,
>>> wind += self.np_random.randn(*wind.shape)
>>> wind += self.np_random.standard_normal(wind.shape)
>>>
>>> return wind
>>>
Expand Down
2 changes: 1 addition & 1 deletion docs_source/documentation/core/abstractions/base_drone.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
```{eval-rst}
.. property:: PyFlyt.core.abstractions.DroneClass.np_random

**dtype** - `np.random.RandomState`
**dtype** - `np.random.Generator`

.. property:: PyFlyt.core.abstractions.DroneClass.physics_period

Expand Down
2 changes: 1 addition & 1 deletion docs_source/documentation/core/wind.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ To define custom wind models, refer the the example provided by the `WindFieldCl
```{eval-rst}
.. property:: PyFlyt.core.abstractions.WindFieldClass.np_random

**dtype** - `np.random.RandomState`
**dtype** - `np.random.Generator`
```

### Required Methods
Expand Down
17 changes: 10 additions & 7 deletions examples/core/04_camera.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
drone_type="quadx",
drone_options=dict(
use_camera=True,
camera_angle=30,
camera_angle_degrees=30,
camera_FOV_degrees=110,
camera_fps=30,
# by default, camera_fps=control_hz,
Expand All @@ -29,7 +29,7 @@
# set to velocity control
env.set_mode(6)

# simulate for 1000 steps (1000/120 ~= 8 seconds)
# simulate for 100 steps (100/120 ~= 1 second)
for i in range(100):
env.step()

Expand All @@ -38,9 +38,12 @@
DEPTH_img = env.drones[0].depthImg
SEG_img = env.drones[0].segImg

plt.imshow(RGBA_img)
# plt.show()
plt.imshow(DEPTH_img)
# plt.show()
plt.imshow(SEG_img)
# show the three images side by side
fig, axes = plt.subplots(1, 3)
for ax, img, title in zip(
axes, [RGBA_img, DEPTH_img, SEG_img], ["RGBA", "Depth", "Segmentation"]
):
ax.imshow(img)
ax.set_title(title)
ax.axis("off")
plt.show()
2 changes: 1 addition & 1 deletion examples/core/10_custom_wind.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ def __call__(self, time: float, position: np.ndarray):
"""
wind = np.zeros_like(position)
wind[:, -1] = np.exp(position[:, -1]) * self.strength
wind += self.np_random.randn(*wind.shape)
wind += self.np_random.standard_normal(wind.shape)
return wind


Expand Down