API Question Getting a thrustgroup command?

Zatnikitelman

Addon Developer
Addon Developer
Joined
Jan 13, 2008
Messages
2,303
Reaction score
6
Points
38
Location
Atlanta, GA, USA, North America
I'm looking for an API command that will give me both the manual input (know this one) and the commanded value of a thrust group. For example, if I hit killrot, I want to be able to know what ATT_PITCHUP or some other group is being commanded to do vs. getting group level which would only work if thrusters were actually defined for a specific group. Does GetManalControlLevel do this or does it just work for the keyboard and joystick?
Thanks in advance,
Zat
 
I don't think I understand what you mean...Can you elaborate?
 
Hmm, yea, sorry. Middle-of-the-day crappiness took over there :P
Ok, Orbiter's built-in Autopilots activate the thruster groups to move around to the desired attitude. Now, the only way I know of to get this magnitude is to use the getThrustGroupLevel method which only works after the thrusters are actually firing. There's also the getManualcontrolLevel method, but that only gets from the keyboard or joystick.
Does anyone know of a way of getting the overall commanded level of a thruster group irregardless of what the input is (autopilot, keyboard etc.)?
 
Hmm, yea, sorry. Middle-of-the-day crappiness took over there :P
Ok, Orbiter's built-in Autopilots activate the thruster groups to move around to the desired attitude. Now, the only way I know of to get this magnitude is to use the getThrustGroupLevel method which only works after the thrusters are actually firing. There's also the getManualcontrolLevel method, but that only gets from the keyboard or joystick.
Does anyone know of a way of getting the overall commanded level of a thruster group irregardless of what the input is (autopilot, keyboard etc.)?
I'm not really understanding what the problem with getThrustGroupLevel is. What do you mean, it "only works after the thrusters are actually firing"?

If the thrusters aren't actually firing, then the overall commanded level is 0....
 
I'm not sure.. can't you use getThrustGroupLevel in clbkPreStep and get the level of the thrusters before they are firing this way ? Not quite sure when the orbiter autopilot does his job.
 
I'm not sure.. can't you use getThrustGroupLevel in clbkPreStep and get the level of the thrusters before they are firing this way ? Not quite sure when the orbiter autopilot does his job.
The only issue to be aware of is that other plugins that set the thruster group level in clbkPreStep (or opcPreStep) may or may not get their callback before your plugin. So results will be varied depending on the specific Orbiter configuration (experimental evidence indicates plugins occuring first in the modules list in the orbiter.cfg get the callback first). I'm not sure whether clbkPreStep or opcPreStep are called first but that should be consistent and testable with a debugger.
 
Ok, let's say that a vehicle either doesn't have thrusters or has some weird configuration that Orbiter's built-in autopilots couldn't normally handle. Getting the level of the thruster group wouldn't work because a command is being sent, but nothing done about it because it won't be firing any thrusters.
GetManualControlLevel only works for commands sent by the user. Somewhere, Orbiter is sending a command to the thruster groups, and I want to know if there's a way to intercept that command (and make use of it of course).
 
Sorry Zat, I'm still confused about what you are trying to achieve. When a thruster group level is set, Orbiter sets the levels of individual thrusters according to how that thruster group is defined. You can get the individual thruster levels with VESSEL::GetThrusterLevel.

You either get the group level, or the individual thruster level. That's it, there is no other magic going on inside the Orbiter core. There is still the timing issue to be aware of that I mentioned above.

Does that help?
 
if I understand you correctly, what you can do is create dummy thruster groups. For example, say that you are making a vessel where you don't want the user to have access to the RCS thrusters. What you can do is create your RCS thrusters as a USER thruster group. Then create a copy of that group for the standard RCS groups, but make sure that you assign 0 thrust to each thruster. Then you can check whether a nav mode is active, if it is, you can set the level for the real thruster group (hidden from the user) the same as the dummy group that orbiter auto-pilots use.

As a secondary method, I suppose you can hook the SetThrusterGroupLevel method...
 
Back
Top