Skip to content

Commit ce513f2

Browse files
authored
Update remus100.py
If positive deflection of stern plane pitches vehicle up the calculations are represented more accurately by this: Positive deflection -> Positive Z force (Z-down) Negative X distance and Positive Z force -> Positive Y moment (right hand rule) positive Y moment -> pitches vehicle up The small error is in the cross product of the x distance and the applied force. My = [-x, 0,0] X [0,0,z] = [0, x*z, 0] where the Y moment is positive for a positive z force and a negative x distance. The simulation seems to run the same with this small change.
1 parent 7a138c6 commit ce513f2

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/python_vehicle_simulator/vehicles/remus100.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -367,15 +367,15 @@ def dynamics(self, eta, nu, u_actual, u_control, sampleTime):
367367
Y_r = -0.5 * self.rho * U_rh**2 * self.A_r * self.CL_delta_r * delta_r
368368

369369
# Stern-plane heave force
370-
Z_s = -0.5 * self.rho * U_rv**2 * self.A_s * self.CL_delta_s * delta_s
370+
Z_s = 0.5 * self.rho * U_rv**2 * self.A_s * self.CL_delta_s * delta_s
371371

372372
# Generalized force vector
373373
tau = np.array([
374374
(1-t_prop) * X_prop + X_r + X_s,
375375
Y_r,
376376
Z_s,
377377
K_prop / 10, # scaled down by a factor of 10 to match exp. results
378-
self.x_s * Z_s,
378+
-1 * self.x_s * Z_s,
379379
self.x_r * Y_r
380380
], float)
381381

@@ -502,4 +502,4 @@ def depthHeadingAutopilot(self, eta, nu, sampleTime):
502502

503503
return u_control
504504

505-
505+

0 commit comments

Comments
 (0)