C++ Question Thrust matching and "Zero-Torque" vectors.

Hlynkacg

Aspiring rocket scientist
Addon Developer
Tutorial Publisher
Donator
Joined
Dec 27, 2010
Messages
1,868
Reaction score
4
Points
0
Location
San Diego
I'm sorry to be bothering you guys with what should be a simple fix but I'm still working on my space tug and need help writing a function. I know how to do the math on paper but lack the knowledge of C++ to make it work in Orbiter.

Code:
GetsuperstructureCG;

Using the above calculate the angular moment for "RCS_Trans_group" and return the value "torque1"; 

Do the same for "RCS_Att_group[i]" and return the value "torque2"; 

Calculate thrust-level/vector for "RCS_Att_group" where (torque2) = (-torque1);

When "RCS_Trans_group" fires automatically fire "RCS_Att_group" with the above level/vector

Yes, I know I'm reinventing the dragonfly, but the comments in the sample code don't exactly explain what's going on and there are levels of system simulation that further obscure the matter.

The intent is that when the Translation thrusters fire, the Pitch/yaw thrusters will automaticaly counter any shift in CG caused by a payload or docked vessel. I've been able to do this manually using the SetThruster Dir and Ref functions but want this process to be completely transperant to the end user.

(In future versions I may impliment a simulated failure modes that will force the user to "go manual")
 
Last edited:
Back
Top