SDK Question Touchdown points definition 2016

gattispilot

Addon Developer
Addon Developer
Joined
Oct 17, 2007
Messages
5,737
Reaction score
56
Points
123
Location
Dallas, TX
I hope some one can help me figure out how to define the touchdown points for 2016.

I have looked at the Delta Glider. I have a red cube at the touchdown points.


Code:
static const DWORD ntdvtx_geardown = 13;
static TOUCHDOWNVTX tdvtx_geardown[ntdvtx_geardown] = {
	{_V( 0   ,-2.57,10   ), 1e6, 1e5, 1.6, 0.1},
	{_V(-3.5 ,-2.57,-1   ), 1e6, 1e5, 3.0, 0.2},
	{_V( 3.5 ,-2.57,-1   ), 1e6, 1e5, 3.0, 0.2},
	{_V(-8.5 ,-0.3 ,-7.05), 1e7, 1e5, 3.0},
	{_V( 8.5 ,-0.3 ,-7.05), 1e7, 1e5, 3.0},
	{_V(-8.5 ,-0.4 ,-3   ), 1e7, 1e5, 3.0},
	{_V( 8.5 ,-0.4 ,-3   ), 1e7, 1e5, 3.0},
	{_V(-8.85, 2.3 ,-5.05), 1e7, 1e5, 3.0},
	{_V( 8.85, 2.3 ,-5.05), 1e7, 1e5, 3.0},
	{_V(-8.85, 2.3 ,-7.05), 1e7, 1e5, 3.0},
	{_V( 8.85, 2.3 ,-7.05), 1e7, 1e5, 3.0},
	{_V( 0   , 2   , 6.2 ), 1e7, 1e5, 3.0},
	{_V( 0   ,-0.6 ,10.65), 1e7, 1e5, 3.0}
};
ShuttleA



Code:
static const int ntdvtx = 16;
static TOUCHDOWNVTX tdvtx[ntdvtx] = {
	{_V(-3  ,-3.05, 12.5), 3.5e6, 3.5e5, 3},
	{_V(-3  ,-3.05,-13.5), 3e6,   3e5,   3},
	{_V( 3  ,-3.05,-13.5), 3e6,   3e5,   3},
	{_V( 3  ,-3.05, 12.5), 3.5e6, 3.5e5, 3},
	{_V(-7.7, 0   ,-0.4 ), 3e7,   3e6,   3},
	{_V( 7.7, 0   ,-0.4 ), 3e7,   3e6,   3},
	{_V(-1.5, 3   ,13.5 ), 3e7,   3e6,   3},
	{_V( 1.5, 3   ,13.5 ), 3e7,   3e6,   3},
	{_V(-1.3, 2.8 ,17   ), 3e7,   3e6,   3},
	{_V( 1.3, 2.8 ,17   ), 3e7,   3e6,   3},
	{_V(-1.8, 0   ,18.3 ), 3e7,   3e6,   3},
	{_V( 1.8, 0   ,18.3 ), 3e7,   3e6,   3},
	{_V(-1.9, 2.2 ,-13.8), 3e7,   3e6,   3},
	{_V( 1.9, 2.2 ,-13.8), 3e7,   3e6,   3},
	{_V(-3.3, 0   ,-14.9), 3e7,   3e6,   3},
	{_V( 3.3, 0   ,-14.9), 3e7,   3e6,   3}
};

So it looks like the touchdown points are also defining the shape of the vessel?

So with the older version it was 3 points. Center and left and right rear. It told rotation and direction.

But the Shuttle A has a rectangle of the pads touching the ground.


from the sdk:
Code:
• VECTOR3 pos collision point position (vessel frame) • double stiffness suspension stiffness coefficient • double damping suspension damping coefficient • double mu isotropic/lateral friction coefficient • double mu_lng longitudinal friction coefficient (only used for first 3 points)
So we get the vector 3 point. But the other values I don't understand.

Code:
17.57.3.327 voidVESSEL::SetTouchdownPoints( constVECTOR3&pt1, constVECTOR3&pt2, constVECTOR3&pt3 ) const
Defines the three points defining the vessel's ground contact plane.
Deprecated This method has been replaced by VESSEL::SetTouchdownPoints(const TOUCHDOWNVTX∗,DW← ORD)const Parameters pt1 touchdown point of nose wheel (or equivalent) pt2 touchdown point of left main wheel (or equivalent) pt3 touchdown point of right main wheel (or equivalent)
Note
The points are the positions at which the vessel's undercarriage (or equivalent) touches the surface, specified in local vessel coordinates. The order of points is significant since it defines the direction of the normal. The points should be specified such that the cross product pt3-pt1 x pt2-pt1 defines the horizon "up" direction for the landed vessel (given a left-handed coordinate system). Modifying the touchdown points during the simulation while the vessel is on the ground can result in jumps due to instantaneous position changes (infinite acceleration). To avoid this, the
touchdown points should be modified gradually by small amounts over time (proportional to simulation time steps). This method is retained only for backward compatibility. Vessels should now use Set← TouchdownPoints(const TOUCHDOWNVTX∗,DWORD)const to define a convex hull of touchdown points. The touchdown stiffness and damping parameters are guessed according to the vessel empty mass. Therefore, SetTouchdownPoints should be called after defining the empty vessel mass with SetEmptyMass.
 
Last edited:

N_Molson

Addon Developer
Addon Developer
Donator
Joined
Mar 5, 2010
Messages
6,856
Reaction score
0
Points
0
Location
Toulouse
For the little I know "touchdown points" are now defined as a bounding polygon, so that vessels can tip off, roll over and so on... For the other values, I'd bet it has to do with springs and friction ?
 

gattispilot

Addon Developer
Addon Developer
Joined
Oct 17, 2007
Messages
5,737
Reaction score
56
Points
123
Location
Dallas, TX
Thanks. I get that. But with 4 points how does it know which way is forward?

I assume that the higher the value more dampness and stiffness, right.

So if you want a vessel to not jump all over the place either increase the mass or have a high dampness and low stiffness?


For the little I know "touchdown points" are now defined as a bounding polygon, so that vessels can tip off, roll over and so on... For the other values, I'd bet it has to do with springs and friction ?
 

martins

Orbiter Founder
Orbiter Founder
Joined
Mar 31, 2008
Messages
2,352
Reaction score
8
Points
0
Website
orbit.medphys.ucl.ac.uk
For the little I know "touchdown points" are now defined as a bounding polygon, so that vessels can tip off, roll over and so on... For the other values, I'd bet it has to do with springs and friction ?
Exactly. Instead of just defining 3 touchdown points, you now describe the complete convex hull of the vessel, so that surface interactions are defined for any vessel orientation. The 3-point definition is only retained for backward compatibility, but it will not correctly define the surface interaction any more, since it describes the vessel as a flat triangle. You need at least 4 non-coplanar points to define a volume (tetrahedron). In practice, you should specify enough points to describe a convex polyhedron that provides a reasonable surface impact volume from all angles. (Don't use more points than necessary, to keep performance high. In particular _don't_ use all the vertices of your vessel mesh!)

The two values after the position are the stiffness parameter b and damping parameter a of the damped harmonic oscillator describing the surface interaction:

[math]
m \ddot x + a \dot x + b x = 0
[/math]

The third parameter is the friction coefficient.
For the first 3 touchdown points you can define two separate friction coefficients: a longitudinal one (e.g. rolling landing gear) and a transversal one (movement perpendicular to the landing gear position).

Isn't that described in the API reference?
 

jedidia

shoemaker without legs
Addon Developer
Joined
Mar 19, 2008
Messages
9,356
Reaction score
75
Points
138
Location
between the planets
Thanks. I get that. But with 4 points how does it know which way is forward?
Convention. Forward on a vessel is always Z+, and the "correct" plane parallel to the ground in landed state is computed from the first three touchdown points in the list.

Isn't that described in the API reference?
Kind of... as far as I remember, it just says "damping", "longitudional friction" and "lateral friction" or something along those lines. Enough to get a rough idea what you're dealing with, but not enough to find the equations in question when you don't know them yet.
 
Last edited:

martins

Orbiter Founder
Orbiter Founder
Joined
Mar 31, 2008
Messages
2,352
Reaction score
8
Points
0
Website
orbit.medphys.ucl.ac.uk
So if you want a vessel to not jump all over the place either increase the mass or have a high dampness and low stiffness?
Low stiffness makes the vessel jump more. It's the equivalent of a soft spring, so exerts a low force at large spring displacement.

However, be careful when increasing the stiffness. A higher stiffness also increases the eigenfrequency of the system, which can lead to numerical instabilities in particular at higher time accelerations (large forces even at small displacements).

Regarding damping: look up "critical damping" for computing damping values that return the spring to equilibrium fastest and don't induce oscillations.
 

gattispilot

Addon Developer
Addon Developer
Joined
Oct 17, 2007
Messages
5,737
Reaction score
56
Points
123
Location
Dallas, TX
So for a car/Land based vessel. One could make the touch down points where the wheels touch and then go up to the top. So one could just make a rectangle/box of points.

Then for the values. If you wanted the car to hug the surface. make the dampness high and the stiff low?
 

martins

Orbiter Founder
Orbiter Founder
Joined
Mar 31, 2008
Messages
2,352
Reaction score
8
Points
0
Website
orbit.medphys.ucl.ac.uk
So for a car/Land based vessel. One could make the touch down points where the wheels touch and then go up to the top. So one could just make a rectangle/box of points.
There is one subtlety here: Orbiter treats the first 3 touchdown points specially. So even if you define a car with 4 wheel contact points in a rectangle, you should adhere to that pattern: Make a "virtual" contact p1 between the two front wheels. The two back wheels are contacts p2 and p3. Set points p4 and p5 to the actual front wheel positions. Add further points for describing the box volume.

Then apply the proper friction coefficients for the first 3 points. p1 should probably have double the friction coefficient of the back wheel since it simulates two wheels.
Points p4 and p5 can have friction coefficient 0, since they are only used for impact simulation. (Its probably best to lift p4 and p5 a bit compared to p1, to make sure p1 has ground contact on uneven ground).

Edit: Or just don't define the two front wheel points at all. That will make them sink into the ground a bit when the car is tilted, but this shouldn't happen in normal operation anyway, and it avoids some potential side effects.
Then for the values. If you wanted the car to hug the surface. make the dampness high and the stiff low?
Make the damping critical.
 

4throck

Enthusiast !
Joined
Jun 19, 2008
Messages
2,953
Reaction score
74
Points
48
Location
Lisbon
Website
orbiterspaceport.blogspot.com
Just to add that on my experiments with SC4 + Orbiter 2016 and defining just 3 points, the order of the points is not trivial.

Depending on how you set those up, your ship will tend to flip on landing.

Makes sense, since some coordinate groups might give you a good "up" normal, but invert your "left/right" or "front/back" forces, flipping the ship.

So
LAND_PT1=(0,-12.1,9)
LAND_PT2=(-4,-12.1,-9)
LAND_PT3=(4,-12.1,-9)


is different from
LAND_PT1=(0,-12.1,9)
LAND_PT2=(4,-12.1,-9)
LAND_PT3=(-4,-12.1,-9)
 

martins

Orbiter Founder
Orbiter Founder
Joined
Mar 31, 2008
Messages
2,352
Reaction score
8
Points
0
Website
orbit.medphys.ucl.ac.uk
This, however, is explained in the manual, I'm pretty sure. As regards to surface friction, Orbiter infers the forward direction from the first 3 contact points p1, p2, p3 as p1 - 0.5*(p2+p3) and the lateral direction as p3-p2.

So those three points indeed don't commute.
 

Ripley

Tutorial translator
Donator
Joined
Sep 12, 2010
Messages
2,892
Reaction score
6
Points
38
Location
Rome
Website
www.tuttovola.org
typo in thread's title

Since the importance of this issue and for others to find it more easily, can a mod please edit the title?
For example, from "Tounchdown point definition 2016" to "Touchdown points definition 2016"?
 

gattispilot

Addon Developer
Addon Developer
Joined
Oct 17, 2007
Messages
5,737
Reaction score
56
Points
123
Location
Dallas, TX
I fixed it. Thanks

---------- Post added at 04:17 PM ---------- Previous post was at 12:32 PM ----------

OK. so my ler here are the points.
Code:
static const int ntdvtx = 9;
static TOUCHDOWNVTX tdvtx[ntdvtx] = {
	{ _V(0, -2.166, 1.5), 1e6, 1e5, 1.6, 0.2 },
	{ _V(-2, -2.166, -2.6), 1e6, 1e5, 1.6, 0.1 },
	{ _V(2, -2.166, -2.6), 1e6, 1e5, 1.6, 0.1 },
	{ _V(-2, -2.164, 1.5), 1e6, 1e5, 1.6, 0 },
	{ _V(2, -2.164, 1.5), 1e6, 1e5, 1.6, 0 },
	{ _V(-2, 1.6, -2.6), 1e6, 1e5, 1.6, 0 },
	{ _V(2, 1.6, -2.6), 1e6, 1e5, 1.6, 0 },
	{ _V(-2, 1.6, 1.5), 1e6, 1e5, 1.6, 0 },
	{ _V(2, 1.6, 1.5), 1e6, 1e5, 1.6, 0 }
};
In the image the green dots are the first 3.


So at the start it is good. I throttle forward. Other than a slight deviation of forward it is ok. Til I hit a hill? And I flip a couple of times and lay on the side.



---------- Post added 09-09-16 at 06:06 AM ---------- Previous post was 09-08-16 at 04:17 PM ----------

I try on Earth at Canaveral pad 1. Seems there is a hill there?



What is odd is Guess it rolls down as I have applied some forward thrust to keep her in place.
 

Donamy

Addon Developer
Addon Developer
Donator
Beta Tester
Joined
Oct 16, 2007
Messages
6,758
Reaction score
5
Points
113
Location
Cape
maybe it needs more friction.
 

gattispilot

Addon Developer
Addon Developer
Joined
Oct 17, 2007
Messages
5,737
Reaction score
56
Points
123
Location
Dallas, TX
Well I double friction.
Code:
static const int ntdvtx = 9;
static TOUCHDOWNVTX tdvtx[ntdvtx] = {
	{ _V(0, -2.166, 1.5), 1e6, 1e5, 3.2, 0.4 },
	{ _V(-2, -2.166, -2.6), 1e6, 1e5, 3.2, 0.2 },
	{ _V(2, -2.166, -2.6), 1e6, 1e5, 3.2, 0.2 },
	{ _V(-2, -2.164, 1.5), 1e6, 1e5, 3.2, 0 },
	{ _V(2, -2.164, 1.5), 1e6, 1e5, 3.2, 0 },
	{ _V(-2, 1.6, -2.6), 1e6, 1e5, 3.2, 0 },
	{ _V(2, 1.6, -2.6), 1e6, 1e5, 3.2, 0 },
	{ _V(-2, 1.6, 1.5), 1e6, 1e5, 3.2, 0 },
	{ _V(2, 1.6, 1.5), 1e6, 1e5, 3.2, 0 }
};
I know if is a Space simulator so maybe I am expecting too much for ground travel?

One thing I noticed the shadow seem to not be affected by the surface. Even though the wheels are covered you see the full shadow.


ouch. I started to climb a hill and it spun around and landed in the surface.
 

fred18

Addon Developer
Addon Developer
Donator
Joined
Feb 2, 2012
Messages
1,628
Reaction score
1
Points
38
One question: if i define the touchdown points with the old definition what would be the damping and stiffness parameters? They will be some sort of default ones, but i found no way to "get" them
 

gattispilot

Addon Developer
Addon Developer
Joined
Oct 17, 2007
Messages
5,737
Reaction score
56
Points
123
Location
Dallas, TX
I went back to DG settings and did ok for a bit but then I flipped and ended up this way. I hoped by exit and reloading the vessel would be upright.

Code:
static const int ntdvtx = 9;
static TOUCHDOWNVTX tdvtx[ntdvtx] = {
	{ _V(0, -2.166, 1.5), 1e6, 1e5, 3.2, 0.4 },
	{ _V(-2, -2.166, -2.6), 1e6, 1e5, 3.2, 0.2 },
	{ _V(2, -2.166, -2.6), 1e6, 1e5, 3.2, 0.2 },
	{ _V(-2, -2.164, 1.5), 1e6, 1e5, 3.2, 0 },
	{ _V(2, -2.164, 1.5), 1e6, 1e5, 3.2, 0 },
	{ _V(-2, 1.6, -2.6), 1e6, 1e5, 3.2, 0 },
	{ _V(2, 1.6, -2.6), 1e6, 1e5, 3.2, 0 },
	{ _V(-2, 1.6, 1.5), 1e6, 1e5, 3.2, 0 },
	{ _V(2, 1.6, 1.5), 1e6, 1e5, 3.2, 0 }
};


Code:
LER:LER4
  STATUS Landed Moon
  POS -33.4434380 41.1179350
  HEADING 329.57
  ALT 1.500
  AROT -56.919 41.280 -125.223
  RCSMODE 0
  AFCMODE 7
  PRPLEVEL 0:0.999482
  NAVFREQ 0 0
  WHEELROT 0.000000
END
So has any one tried to go up their own mesh? Like roll a crawler up a ramp.
 

gattispilot

Addon Developer
Addon Developer
Joined
Oct 17, 2007
Messages
5,737
Reaction score
56
Points
123
Location
Dallas, TX
That's sad. So maybe someone will figure out how to make the terrain raise up like a ramp for launchpad. Or landing pads above the surface.

What is fun/interesting is to drive a delta glider on the ground. It has no issues that's why I went with the dg specs

---------- Post added 09-13-16 at 05:13 AM ---------- Previous post was 09-12-16 at 08:18 AM ----------

So I used 3 points.
Code:
static const int ntdvtx = 3;
static TOUCHDOWNVTX tdvtx[ntdvtx] = {
    { _V(0, -2.166, 1.5), 1e6, 1e5, 3.2, 0.8 },
    { _V(-2, -2.166, -2.6), 1e6, 1e5, 3.2, 0.4 },
    { _V(2, -2.166, -2.6), 1e6, 1e5, 3.2, 0.4 }//,
//    { _V(-2, -2.164, 1.5), 1e6, 1e5, 3.2, 0 },
//    { _V(2, -2.164, 1.5), 1e6, 1e5, 3.2, 0 },
//    { _V(-2, 1.6, -2.6), 1e6, 1e5, 3.2, 0 },
//    { _V(2, 1.6, -2.6), 1e6, 1e5, 3.2, 0 },
//    { _V(-2, 1.6, 1.5), 1e6, 1e5, 3.2, 0 },
//    { _V(2, 1.6, 1.5), 1e6, 1e5, 3.2, 0 }
};
I rotate the LER wheels 90 degrees which rotates the thrust.
Code:
SetThrusterDir(th_main[0], _V(sinTurn, 0, cosTurn));
        SetThrusterDir(th_retro[0], _V(-sinTurn, 0, -cosTurn));
Well the vessel flip and landed under the surface.


Why does the Surface MFD say the Alt is -2.57. It does this on the DG also.


Code:
LER:LER4
  UCGO @@0,1,0,0,
  STATUS Landed Moon
  POS -33.4397132 41.1163117
  HEADING 298.01
  ALT -2.171
  AROT 147.458 47.031 -71.960
  RCSMODE 0
  AFCMODE 7
  PRPLEVEL 0:0.999803
  NAVFREQ 0 0
  WHEELROT 0.000000
END
 
Last edited:

turtle91

New member
Joined
Nov 1, 2010
Messages
303
Reaction score
0
Points
0
Why does the Surface MFD say the Alt is -2.57. It does this on the DG also.
Because it measures the "sea"-level altitude.
If you are i.e. parking at Brighton Beach, you are sitting in a hole...below standard sea-level.
 
Top