From ac5021111c7747d72f2c62e10768ef1f67fed1ad Mon Sep 17 00:00:00 2001 From: crobarcro <3159692+crobarcro@users.noreply.github.com> Date: Wed, 29 Oct 2025 01:27:25 +0000 Subject: [PATCH 1/2] quadx.py: allow setting the urdf link to attach the camera to --- PyFlyt/core/drones/quadx.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/PyFlyt/core/drones/quadx.py b/PyFlyt/core/drones/quadx.py index 29c19996..d84f4957 100644 --- a/PyFlyt/core/drones/quadx.py +++ b/PyFlyt/core/drones/quadx.py @@ -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. @@ -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, From af4a4a866e0c2ba0496b57b77c15476644971b60 Mon Sep 17 00:00:00 2001 From: crobarcro <3159692+crobarcro@users.noreply.github.com> Date: Mon, 3 Nov 2025 15:41:40 +0000 Subject: [PATCH 2/2] quadx_base_env.py: allow specifying a world_scale in constructor --- PyFlyt/gym_envs/quadx_envs/quadx_base_env.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/PyFlyt/gym_envs/quadx_envs/quadx_base_env.py b/PyFlyt/gym_envs/quadx_envs/quadx_base_env.py index 0b3eb4dd..be213259 100644 --- a/PyFlyt/gym_envs/quadx_envs/quadx_base_env.py +++ b/PyFlyt/gym_envs/quadx_envs/quadx_base_env.py @@ -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__. @@ -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 @@ -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, )