It's a native Orbiter feature.
I was not sure if it was native or coded through specific vessel modules, so good news there ?
It's a native Orbiter feature.
@asbjos : I'd like to use it for the Proton launcher I'm developping (and then in other projects).
I know how to do it through .dll coding, but this can lead to some conflicts.
I'm working on "inline" launchers, with multiple stages docked together and strapon boosters for some of them.
Parking Brake in its current state works "too well" : it grounds all my rockets stages and bypasses the scenario docking information (overrides the DOCKINFO parameter). So my rocket stages dock but then are immediatly grounded by Parking Brake. As soon as I apply thrust, they all get back to their "normal" postion.
So what I need is a parameter in the scenario file that would disable parking brake for that vessel. Do you think it can be done ? That would help a lot. I'm sure a lot of people will use this great plugin and I want to make my stuff compatible with it.
Yes I'll send you an alpha later today.
Do you have a link to such a vessel? But with a only-park-if-fuel-not-full rule, I assume that also this would be "fixed".Noticed one thing with SC4 vessels:
If lift-off and landing points are defined, ParkingBrake seems to only consider landing points. Lift-off are ignored.
I guess this might also affect non sc4 vessels that do similar changes.
Tested more and indeed it doesn't seem to be a parking break problem.
It's an Orbiter bug....
For the sake of discussion try:
Vinka's spacecraft » Vertical Take Off - Horizontal Landing
On KSC it works (vertical DG). Move to Brighton Beach using scenario editor, it works (vertical DG).
Move to Edwards or Kourou (bases with updated terrain) and the DG becomes horizontal...
Very strange
// Only do extensive check if not already landed, but in contact with planet.
if (v->GroundContact()) // ground contact, maybe not still.
{
if (v->GetThrusterGroupLevel(THGROUP_MAIN) < 0.01 && v->GetThrusterGroupLevel(THGROUP_HOVER) < 0.01 && v->GetThrusterGroupLevel(THGROUP_RETRO) < 0.01)
// main thrusters near-to-Zero (RCS allowed, linear or rotation)
{
if (v->GetGroundspeed() < 0.5)
// speed lower than 0.5m/s (docking requests 0.1m/s)
{
VECTOR3 vv = _V(0, 0, 0);
v->GetAngularVel(vv);
if (length(vv) < 30 * PI / 180)
// low-tumbling (<30deg/s, i.e. 30*pi/180 rad/s)
{
if (v->GetPitch() < PI / 6 && v->GetBank() < PI / 6)
// the orientation must be close to horizontal (30deg max, we don't care the yaw angle)
{
if (!entry->Landed) {
// => force Landed status + notify the server
//tlogging(5, "STC_OwnVesselLanded > do we LandIt?");
ref = v->GetSurfaceRef();
v->GetEquPos(longitude, latitude, radius);
oapiGetHeading(vHandle, &heading);
STC_LandIt(v, ref, longitude, latitude, heading);
void ParkVessel(VESSEL* ves)
{
// Thanks to "jarmonik": https://www.orbiter-forum.com/threads/mars-2020-rover-and-mars-helicopter-scout.37153/page-6#post-577597
// Also honorably mention to "face": https://www.orbiter-forum.com/threads/orbiter-economic-simulation.39629/page-2#post-578205
OBJHANDLE ref = ves->GetSurfaceRef();
double longitude, latitude, radius;
ves->GetEquPos(longitude, latitude, radius);
double heading = 0.0;
OBJHANDLE obj = ves->GetHandle();
oapiGetHeading(obj, &heading);
VESSELSTATUS2 vs;
memset(&vs, 0, sizeof(vs));
vs.version = 2;
vs.rbody = ref;
vs.status = 1; // Landed
vs.arot.x = 10; // <----- Undocumented feature "magic value" to land on touchdown points !! IMPORTANT !! It has to be 10, no more, no less !
vs.surf_lng = longitude;
vs.surf_lat = latitude;
vs.surf_hdg = heading;
ves->DefSetStateEx(&vs);
}
OBJHANDLE handle;
for(int i=0;(handle=oapiGetVesselByIndex(i))!=NULL;i++) { STC_OwnVesselLanded(handle); }
void STC_OwnVesselLanded(OBJHANDLE vHandle)
{
// here, we adapt Parking Brake MFD code to a permanent "Near-0 velocity mode"
// => see STC_LandIt(...) for credits
OBJHANDLE ref;
IDload* pBody;
double longitude, latitude, radius;
double heading = 0.0;
VESSELSTATUS2 vs;
memset(&vs, 0, sizeof(vs));
VESSEL* v = oapiGetVesselInterface(vHandle);
// Only do extensive check if not already landed, but in contact with planet.
if (v->GroundContact()) // ground contact, maybe not still.
======> (etc... see above)
void STC_LandIt(VESSEL* v, OBJHANDLE rbody, double longitude, double latitude, double heading)
{
// Thanks to "asbjos" (under GPLv2 for OMX): https://www.orbiter-forum.com/resources/parking-brake.3105/
// Thanks to "jarmonik": https://www.orbiter-forum.com/threads/mars-2020-rover-and-mars-helicopter-scout.37153/page-6#post-577597
// Also honorably mention to "Face": https://www.orbiter-forum.com/threads/orbiter-economic-simulation.39629/page-2#post-578205
VESSELSTATUS2 vs;
vs.version = 2;
vs.flag = 0x0;
v->GetStatusEx(&vs);
vs.rbody = rbody;
vs.status = 1; // Landed
vs.rvel = _V(0, 0, 0);
vs.arot = _V(0, 0, 0);
vs.vrot = _V(0, 0, 0);
vs.arot.x = 10; // <----- Undocumented feature "magic value" to land on touchdown points !! IMPORTANT !! It has to be 10, no more, no less !
vs.surf_lng = longitude;
vs.surf_lat = latitude;
vs.surf_hdg = heading;
// in order to "smooth" the anchoring on a small body surface and align with the local mesh, maybe consider:
// VECTOR3 VESSEL::GetSurfaceNormal ( ) const
// ELEVHANDLE oapiElevationManager ( OBJHANDLE hPlanet ), then an access to the tiles would be needed (bool oapi::GraphicsClient::ElevationGrid?)
// double oapiSurfaceElevation ( OBJHANDLE hPlanet, double lng, double lat )
// (or) double VESSEL::GetSurfaceElevation ( ) const
// BOOL oapiGetAltitude ( OBJHANDLE hVessel, AltitudeMode mode, double* alt)
// + cancel totally all rotation, thrusts and auto-modes
v->DefSetStateEx(&vs);
return;
}
void EAGLE3::clbkPreStep(double simt, double simdt, double mjd)
{
OBJHANDLE handle;
for (int i = 0; (handle = oapiGetVesselByIndex(i)) != NULL; i++) { STC_OwnVesselLanded(handle); }