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
3 changes: 2 additions & 1 deletion PyFlyt/core/drones/quadx.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ def __init__(
camera_position_offset: np.ndarray = np.array([0.0, 0.0, 0.0]),
camera_resolution: tuple[int, int] = (128, 128),
camera_fps: None | int = None,
camera_link_id: int = 0,
):
"""Creates a drone in the QuadX configuration and handles all relevant control and physics.

Expand Down Expand Up @@ -202,7 +203,7 @@ def __init__(
self.camera = Camera(
p=self.p,
uav_id=self.Id,
camera_id=0,
camera_id=camera_link_id,
use_gimbal=use_gimbal,
camera_FOV_degrees=camera_FOV_degrees,
camera_angle_degrees=camera_angle_degrees,
Expand Down
4 changes: 4 additions & 0 deletions PyFlyt/gym_envs/quadx_envs/quadx_base_env.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ def __init__(
agent_hz: int = 30,
render_mode: None | Literal["human", "rgb_array"] = None,
render_resolution: tuple[int, int] = (480, 480),
world_scale: int = 1,
):
"""__init__.

Expand Down Expand Up @@ -125,6 +126,8 @@ def __init__(
elif angle_representation == "quaternion":
self.angle_representation = 1

self.world_scale = world_scale

def close(self) -> None:
"""Disconnects the internal Aviary."""
# if we already have an env, disconnect from it
Expand Down Expand Up @@ -189,6 +192,7 @@ def begin_reset(
drone_type="quadx",
render=self.render_mode == "human",
drone_options=drone_options,
world_scale=self.world_scale,
np_random=self.np_random,
)

Expand Down