SCvx
SCvx copied to clipboard
Questions
Question1
#Question about **linearized lower thrust constraint**
lhs = [U_last_p[:, k] / (cvx.norm(U_last_p[:, k])) * U_v[:, k] for k in range(K)]
constraints += [
self.T_min - cvx.vstack(lhs) <= self.s_prime
]
constraints in rocket_landing_3d.py the U_last_p[:, k] and U_v[:, k] are numpy array ,just use * ,the outcome still is numpy array, however self.T_min is scalar , Why is there no error when a scalar minus array?
Question2 I am confused about the Coordinate System in the code In the inertial reference , z-axis points UP In the body-fixed reference , z-axis points along the vertical axis of the vehicle
However the euler_to quat function seems not consistent with the coordinate system Would you please explain to me?
here is the euler_to quat function code:
def euler_to_quat(a):
a = np.deg2rad(a)
cy = np.cos(a[1] * 0.5)
sy = np.sin(a[1] * 0.5)
cr = np.cos(a[0] * 0.5)
sr = np.sin(a[0] * 0.5)
cp = np.cos(a[2] * 0.5)
sp = np.sin(a[2] * 0.5)
q = np.zeros(4)
q[0] = cy * cr * cp + sy * sr * sp
q[1] = cy * sr * cp - sy * cr * sp
q[3] = cy * cr * sp + sy * sr * cp
q[2] = sy * cr * cp - cy * sr * sp
return q
I am also curious about the coordinate conventions used in the code