fix rotation angles
@@ -572,7 +572,10 @@ class FloatingForces(generator_interface.BaseGenerator):
# beam.ini_info.for_pos[0:3])
self.q[it, 0:3] = (np.dot(cga, struct_tstep.pos[self.buoyancy_node, :]) +
struct_tstep.for_pos[0:3])
- self.q[it, 3:6] = algebra.quat2euler(struct_tstep.quat)
+ # ams: in my casethe angles are negative in the x and z components
+ self.q[it, 3:6] = (algebra.quat2euler(struct_tstep.quat)*
+ np.array([-1., 0., -1.]))
+ print(self.q[it, 3:6])
self.qdot[it, 0:3] = np.dot(cga, struct_tstep.for_vel[0:3])
self.qdot[it, 3:6] = np.dot(cga, struct_tstep.for_vel[3:6])
@@ -639,8 +642,7 @@ class FloatingForces(generator_interface.BaseGenerator):
struct_tstep.runtime_generated_forces[self.mooring_node, 3:6] -= np.dot(cbg, force_cl[3:6])
# Yaw moment generated by the mooring system
- # ams: In my cases yaw is measured in the wrong direction
- yaw = -np.array([self.q[data.ts, 3], 0., 0.])
+ yaw = np.array([self.q[data.ts, 3], 0., 0.])
mooring_yaw = -self.floating_data['mooring']['yaw_spring_stif']*yaw
struct_tstep.runtime_generated_forces[self.mooring_node, 3:6] += np.dot(cbg,
mooring_yaw)
