Programming Question Touchdown and eva

How to do this?
I have a vessel of a box I can pick it up and move it. But drop it and it goes under the surface,

What I would really like is a cheat where if not attached then forced landed

Melissa_Lewis:2016SEVASOLIDRED
STATUS Landed Moon
POS -6.8116090 -80.3592728
HEADING 66.56
ALT 0.900
AROT 4.407 -29.882 168.943
AFCMODE 7
NAVFREQ 0 0
EVA_TIME 1675.757815
OXYGEN 97.090698
VISOR 0.000000
SVISOR 0.000000
FVISOR 0.025585
LIGHTS 0
TYPE 1
END
SAMPLEBAG:ARTEMISEVATOOLS\EVASAMPLEBAG
STATUS Orbiting Moon
RPOS -26235891686.015 126344123518.253 242077058073.022
RVEL -758728527.7309 3653840483.1522 7000674858.6288
AROT 5.371 5.087 -178.736
VROT -2212.7271 1210.3617 -17822.4258
AFCMODE 7
NAVFREQ 0 0
TYPE 9
END
 

Attachments

  • SAMPLEBAG2.jpg
    SAMPLEBAG2.jpg
    51.1 KB · Views: 2
  • SAMPLEBAG1.jpg
    SAMPLEBAG1.jpg
    39.2 KB · Views: 2
I see that UACS Cargo does what I want. You drop the package and it lands.
the UACS code is here: https://github.com/abdullah-radwan/UACS/tree/master
The best I can tell if ground contact??? then set the vs state to 1 landed.

if (!GetFlightStatus() && GroundContact())
{
VECTOR3 angAcc; GetAngularAcc(angAcc);

if (length(angAcc) < 0.5)
{
VESSELSTATUS2 status = GetVesselStatus(this);
status.status = 1;

SetGroundRotation(status, cargoInfo.frontPos, cargoInfo.rightPos, cargoInfo.leftPos);
DefSetStateEx(&status);
}
}

So I have this as I understand if on the ground then make it landed, right? It lands good but still moves
void LEVA::clbkPreStep(double simt, double simdt, double mjd)
{
{
VESSELSTATUS2 vs;
memset(&vs, 0, sizeof(vs));
vs.version = 2;
GetStatusEx(&vs);

if (GroundContact() == true)



vs.status = 1; // Landed


DefSetStateEx(&vs2);

}
}
 
Last edited:
cargoInfo.frontPos = { 0, -0.65, 0.65 };
cargoInfo.rightPos = { 0.65, -0.65, -0.65 };
cargoInfo.leftPos = { -0.65, -0.65, -0.65 };

double stiffness = 100 * GetMass();
double damping = 2 * sqrt(GetMass() * stiffness);

std::array<TOUCHDOWNVTX, 7> tdVtx
{ {
{{ 0, -0.65, 0.65 }, stiffness, damping, 3, 3},
{{ -0.65, -0.65, -0.65 }, stiffness, damping, 3, 3},
{{ 0.65, -0.65, -0.65 }, stiffness, damping, 3, 3},
{{ -0.65, 0.65, -0.65 }, stiffness, damping, 3, 3},
{{ 0.65, 0.65, -0.65 }, stiffness, damping, 3, 3},
{{ -0.65, -0.65, 0.65 }, stiffness, damping, 3, 3},
{{ 0.65, -0.65, 0.65 }, stiffness, damping, 3, 3}
} };

SetTouchdownPoints(tdVtx.data(), tdVtx.size());

// If the cargo was unpacked and it is landed
if (init && status.status)
{
SetGroundRotation(status, cargoInfo.frontPos, cargoInfo.rightPos, cargoInfo.leftPos);
DefSetStateEx(&status);
}
}

It is also based off the cfg. But if the cargo is on the surface it it landed. I can't find that function SetGroundRotation

I think what needs to happen if the vessel is on the ground then make it landed. I think I have that. But it is not landing
 
I used the UACS mass of 50. But if a guy picks up a cargo and drops it. The cargo is a landed vessel
 
So looking at UACS. the cargo is always landed.
the guy picked it up and it still shows landed.

So how to make it landed always?
 

Attachments

The problem is probably that the SAMPLEBAG is being released with an orbital status (STATUS Orbiting Moon) instead of a landed status (STATUS Landed Moon).

In Orbiter, an object without engines or special ground-handling logic does not automatically detect terrain collisions. If it is created slightly above the surface with an orbital status, it may pass through the terrain or end up with invalid coordinates.

To force the bag to stay on the ground when it is not attached, there are several possible approaches:

1. Convert it immediately to a landed vessel

When the bag is dropped:

VESSELSTATUS2 vs;
memset(&vs, 0, sizeof(vs));
vs.version = 2;

vs.status = 1; // LANDED
vs.rbody = GetSurfaceRef();

vs.surf_lng = lng;
vs.surf_lat = lat;
vs.surf_hdg = heading;

DefSetStateEx(&vs);

This is the simplest solution if the bag does not need to roll or bounce.

2. Monitor altitude and force landing

In clbkPreStep:

double alt = GetAltitude();

if (!attached && alt < 0.05)
{
VESSELSTATUS2 vs;
memset(&vs, 0, sizeof(vs));
vs.version = 2;

GetStatusEx(&vs);

vs.status = 1; // LANDED

DefSetStateEx(&vs);
}

As soon as the bag gets close to the ground, it is converted to a landed vessel.

3. Define touchdown points

If the bag has touchdown points:

static TOUCHDOWNVTX tdvtx[3] =
{
{_V( 0,-0.15, 0.2), 1e5, 1e3, 1.6, 0.1},
{_V(-0.2,-0.15,-0.2), 1e5, 1e3, 1.6, 0.1},
{_V( 0.2,-0.15,-0.2), 1e5, 1e3, 1.6, 0.1}
};

SetTouchdownPoints(tdvtx,3);

However, this alone may not be sufficient for very small EVA objects.

4. The method commonly used for EVA equipment

When the object is released:

Get the current latitude and longitude.
Create the bag directly with STATUS Landed.
Set its heading to match the astronaut.
Set all velocities to zero.

This guarantees that the bag is immediately placed on the surface and cannot sink below the terrain.

Looking at your scenario:

SAMPLEBAG
STATUS Orbiting Moon
...
VROT -2212 ...

The most suspicious part is the very large angular velocity (VROT) combined with the orbital status. This suggests that the bag is being released as a normal spacecraft rather than as a surface object. I would first examine the code that creates the SAMPLEBAG when it is dropped. If you can post that code, I can show exactly where to force the vessel into the LANDED state.
 
Back
Top