From 0a046aec60f7a9b5f582609a1c4fc46349808309 Mon Sep 17 00:00:00 2001 From: zuorenchen Date: Thu, 25 Jun 2026 23:39:50 +0100 Subject: [PATCH 1/3] Update ActiveRocketPy submodule to add actuator classes --- ActiveRocketPy | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ActiveRocketPy b/ActiveRocketPy index b7d286d..1d48998 160000 --- a/ActiveRocketPy +++ b/ActiveRocketPy @@ -1 +1 @@ -Subproject commit b7d286da24650606a00be858d3f0d55494a97d17 +Subproject commit 1d48998cad5d2e8de255a86332a979f46809dc6a From 9bb0ee929b4dc67c2672d77fb20e762993973fe0 Mon Sep 17 00:00:00 2001 From: zuorenchen Date: Fri, 26 Jun 2026 00:06:19 +0100 Subject: [PATCH 2/3] Update names to align with ActiveRocketPy actuator class updates --- BalloonPoppingGymEnv/envs/balloon_world.py | 38 +++++++++++-------- .../scenario_0_given_parameters.yaml | 5 ++- .../scenario_0_parameters.yaml | 8 +++- .../scenario_1_given_parameters.yaml | 5 ++- .../scenario_1_parameters.yaml | 7 +++- 5 files changed, 41 insertions(+), 22 deletions(-) diff --git a/BalloonPoppingGymEnv/envs/balloon_world.py b/BalloonPoppingGymEnv/envs/balloon_world.py index ff88183..a219020 100644 --- a/BalloonPoppingGymEnv/envs/balloon_world.py +++ b/BalloonPoppingGymEnv/envs/balloon_world.py @@ -100,8 +100,10 @@ def __init__(self, render_mode, parameters): dtype=np.float64, ), "tvc": spaces.Box( - low=-self.rocket_parameters["control"]["gimbal_range"] * np.ones(2), - high=self.rocket_parameters["control"]["gimbal_range"] * np.ones(2), + low=-self.rocket_parameters["control"]["max_gimbal_angle"] + * np.ones(2), + high=self.rocket_parameters["control"]["max_gimbal_angle"] + * np.ones(2), dtype=np.float64, ), "throttle": spaces.Box( @@ -213,8 +215,12 @@ def step(self, action): self.__init_rocket_simulation() else: # Apply action to step the rocket simulation and get sensor measurements self._rocket_flight.rocket.roll_control.roll_torque = action["roll"] - self._rocket_flight.rocket.tvc.gimbal_angle_x = action["tvc"][0] - self._rocket_flight.rocket.tvc.gimbal_angle_y = action["tvc"][1] + self._rocket_flight.rocket.thrust_vector_control.gimbal_angle_x = action[ + "tvc" + ][0] + self._rocket_flight.rocket.thrust_vector_control.gimbal_angle_y = action[ + "tvc" + ][1] self._rocket_flight.rocket.throttle_control.throttle = action["throttle"] self._rocket_flight.step_simulation() _sensor = self._rocket_flight.sensors @@ -233,7 +239,7 @@ def step(self, action): "rocket_states": self._rocket_states.copy().tolist(), "balloon_states": self._balloon_states.copy().tolist(), "balloon_status": self._balloon_status[:, 0].tolist(), - } + } if self.trajectories is None: self.trajectories = [step_record] else: @@ -926,12 +932,12 @@ def tvc_controller_function( tvc.gimbal_angle_y, ) - rocket.add_tvc( - gimbal_range=control_cfg["gimbal_range"], - gimbal_rate_limit=control_cfg["gimbal_rate_limit"], - sampling_rate=1 / self.simulation_parameters["time_step"], + rocket.add_thrust_vector_control( controller_function=tvc_controller_function, - return_controller=False, + sampling_rate=1 / self.simulation_parameters["time_step"], + max_gimbal_angle=control_cfg["max_gimbal_angle"], + gimbal_rate_limit=control_cfg["gimbal_rate_limit"], + gimbal_time_constant=control_cfg["gimbal_time_constant"], ) def roll_controller_function( @@ -950,11 +956,11 @@ def roll_controller_function( ) rocket.add_roll_control( + controller_function=roll_controller_function, + sampling_rate=1 / self.simulation_parameters["time_step"], max_roll_torque=control_cfg["max_roll_torque"], torque_rate_limit=control_cfg["torque_rate_limit"], - sampling_rate=1 / self.simulation_parameters["time_step"], - controller_function=roll_controller_function, - return_controller=False, + roll_torque_time_constant=control_cfg["roll_torque_time_constant"], ) def throttle_controller_function( @@ -973,11 +979,11 @@ def throttle_controller_function( ) rocket.add_throttle_control( + controller_function=throttle_controller_function, + sampling_rate=1 / self.simulation_parameters["time_step"], throttle_range=control_cfg["throttle_range"], throttle_rate_limit=control_cfg["throttle_rate_limit"], - sampling_rate=1 / self.simulation_parameters["time_step"], - controller_function=throttle_controller_function, - return_controller=False, + throttle_time_constant=control_cfg["throttle_time_constant"], ) self._rocket_flight = Flight( diff --git a/BalloonPoppingGymEnv/envs/scenario_parameters/scenario_0_given_parameters.yaml b/BalloonPoppingGymEnv/envs/scenario_parameters/scenario_0_given_parameters.yaml index 7424b08..846b4c3 100644 --- a/BalloonPoppingGymEnv/envs/scenario_parameters/scenario_0_given_parameters.yaml +++ b/BalloonPoppingGymEnv/envs/scenario_parameters/scenario_0_given_parameters.yaml @@ -76,9 +76,12 @@ rocket: - gnss_altitude_accuracy - gnss_velocity_accuracy control: - - gimbal_range + - max_gimbal_angle - gimbal_rate_limit + - gimbal_time_constant - max_roll_torque - torque_rate_limit + - roll_torque_time_constant - throttle_range - throttle_rate_limit + - throttle_time_constant diff --git a/BalloonPoppingGymEnv/envs/scenario_parameters/scenario_0_parameters.yaml b/BalloonPoppingGymEnv/envs/scenario_parameters/scenario_0_parameters.yaml index 41b963e..42dfa45 100644 --- a/BalloonPoppingGymEnv/envs/scenario_parameters/scenario_0_parameters.yaml +++ b/BalloonPoppingGymEnv/envs/scenario_parameters/scenario_0_parameters.yaml @@ -14,7 +14,7 @@ environment: enable: false altitude_spacing: 10.0 # (m) vertical spacing between gust samples max_gust_speed: 3.0 # (m/s) maximum gust speed - gust_decay_height: 150.0 # (m) characteristic decay height for the gust speed with altitude + gust_decay_height: 150.0 # (m) characteristic decay height for the gust speed with altitude # Simulation timing configuration simulation: @@ -105,9 +105,13 @@ rocket: gnss_altitude_accuracy: 0.0 # (m) altitude accuracy of the GNSS receiver gnss_velocity_accuracy: 0.0 # (m/s) velocity accuracy of the GNSS receiver control: - gimbal_range: 15 # (deg) maximum gimbal angle in any direction + max_gimbal_angle: 15 # (deg) maximum gimbal angle in any direction gimbal_rate_limit: 60 # (deg/s) maximum gimbal rate + gimbal_time_constant: null # 1st order low pass filter time constant for actuator dynamics. null to turn off. max_roll_torque: 10 # (N*m) maximum roll torque torque_rate_limit: 20 # (N*m/s) maximum roll torque rate + roll_torque_time_constant: null # 1st order low pass filter time constant for actuator dynamics. null to turn off. throttle_range: [0.0, 1.0] # range of the throttle (0 to 1) throttle_rate_limit: 2.0 # (1/s) maximum throttle rate + throttle_time_constant: null # 1st order low pass filter time constant for actuator dynamics. null to turn off. + diff --git a/BalloonPoppingGymEnv/envs/scenario_parameters/scenario_1_given_parameters.yaml b/BalloonPoppingGymEnv/envs/scenario_parameters/scenario_1_given_parameters.yaml index 1844c47..28f1bbc 100644 --- a/BalloonPoppingGymEnv/envs/scenario_parameters/scenario_1_given_parameters.yaml +++ b/BalloonPoppingGymEnv/envs/scenario_parameters/scenario_1_given_parameters.yaml @@ -76,9 +76,12 @@ rocket: - gnss_altitude_accuracy - gnss_velocity_accuracy control: - - gimbal_range + - max_gimbal_angle - gimbal_rate_limit + - gimbal_time_constant - max_roll_torque - torque_rate_limit + - roll_torque_time_constant - throttle_range - throttle_rate_limit + - throttle_time_constant diff --git a/BalloonPoppingGymEnv/envs/scenario_parameters/scenario_1_parameters.yaml b/BalloonPoppingGymEnv/envs/scenario_parameters/scenario_1_parameters.yaml index 92a337d..990258d 100644 --- a/BalloonPoppingGymEnv/envs/scenario_parameters/scenario_1_parameters.yaml +++ b/BalloonPoppingGymEnv/envs/scenario_parameters/scenario_1_parameters.yaml @@ -14,7 +14,7 @@ environment: enable: false altitude_spacing: 10.0 # (m) vertical spacing between gust samples max_gust_speed: 3.0 # (m/s) maximum gust speed - gust_decay_height: 150.0 # (m) characteristic decay height for the gust speed with altitude + gust_decay_height: 150.0 # (m) characteristic decay height for the gust speed with altitude # Simulation timing configuration simulation: @@ -105,9 +105,12 @@ rocket: gnss_altitude_accuracy: 0.0 # (m) altitude accuracy of the GNSS receiver gnss_velocity_accuracy: 0.0 # (m/s) velocity accuracy of the GNSS receiver control: - gimbal_range: 15 # (deg) maximum gimbal angle in any direction + max_gimbal_angle: 15 # (deg) maximum gimbal angle in any direction gimbal_rate_limit: 60 # (deg/s) maximum gimbal rate + gimbal_time_constant: null # 1st order low pass filter time constant for actuator dynamics. null to turn off. max_roll_torque: 10 # (N*m) maximum roll torque torque_rate_limit: 20 # (N*m/s) maximum roll torque rate + roll_torque_time_constant: null # 1st order low pass filter time constant for actuator dynamics. null to turn off. throttle_range: [0.0, 1.0] # range of the throttle (0 to 1) throttle_rate_limit: 2.0 # (1/s) maximum throttle rate + throttle_time_constant: null # 1st order low pass filter time constant for actuator dynamics. null to turn off. From 59fab8040569ed42e2b5b7fa7e33c980972d3208 Mon Sep 17 00:00:00 2001 From: zuorenchen Date: Fri, 26 Jun 2026 21:51:18 +0100 Subject: [PATCH 3/3] Bump ActiveRocketPy version after actuator module merged to main --- ActiveRocketPy | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ActiveRocketPy b/ActiveRocketPy index 1d48998..6f640a1 160000 --- a/ActiveRocketPy +++ b/ActiveRocketPy @@ -1 +1 @@ -Subproject commit 1d48998cad5d2e8de255a86332a979f46809dc6a +Subproject commit 6f640a11e208b270fdcb0816fff49bf5f91bd5f2