SDK Question Touchdown points for a cube

Abdullah Radwan

Addon Developer
Addon Developer
Joined
Aug 20, 2017
Messages
314
Reaction score
284
Points
78
Location
Cairo
Hello,

I want to update UCSO touchdown points to Orbiter 2016, as it currently uses Orbiter 2010 touchdown points copied from UCGO. The cargo is basically a cube, whose size is 1.3M as UCGO.

I've tried to use this code below, but it didn't work (the cargo sank into the ground):

Code:
	double x_target = -0.5;
	double stiffness = (-1) * (GetMass() * 9.80655) / (3 * x_target);
	double damping = 0.9 * (2 * sqrt(GetMass() * stiffness));

	static TOUCHDOWNVTX tdvtx[8] = {
		{{ 0.65, -0.65, -0.65 }, stiffness, damping, 0.5, 0.005},
		{{ 0.65, -0.65, 0.65 }, stiffness, damping, 0.5, 0.005},
		{{ -0.65, -0.65, 0.65 }, stiffness, damping, 0.5, 0.005},
		{{ -0.65, -0.65, -0.65 }, stiffness, damping, 0.5, 0.005},

		{{ 0.65, 0.65, -0.65 }, stiffness, damping, 0.5, 0.005},
		{{ 0.65, 0.65, 0.65 }, stiffness, damping, 0.5, 0.005},
		{{ -0.65, 0.65, 0.65 }, stiffness, damping, 0.5, 0.005},
		{{ -0.65, 0.65, -0.65 }, stiffness, damping, 0.5, 0.005}
	};
	SetTouchdownPoints(tdvtx, 8);

The coordinates are taken from Blender and converted to Orbiter coordinates. They are the 4 edges coordinates of the top face and bottom face. Why this doesn't make a cube?

Also, what stiffness and damping values should I use?

Top:

0aXiN1N.png


Bottom:

EhymW7u.png
 
Last edited:

gattispilot

Addon Developer
Addon Developer
Joined
Oct 17, 2007
Messages
8,689
Reaction score
2,670
Points
203
Location
Dallas, TX
I assume that the -.65 is at the bottom?
how far does it sink?
 

4throck

Enthusiast !
Joined
Jun 19, 2008
Messages
3,502
Reaction score
1,008
Points
153
Location
Lisbon
Website
orbiterspaceport.blogspot.com
Unfortunately you have discovered O2016 problem with surface.
From my tests landing only works well if you vessel has a similar mass to the Deltaglider.
Too light or too heavy vessels don't behave well and skip, sink, etc.
I guess your cube is relatively light.

The point coordinates are correct, and you already have some calculations to get stiffness and damping based on mass.
But you can use fred's Vessel Builder to check them and try new values in real time.
As I said, for low masses I never got it to work, but perhaps you can find a solution ;)
 

Abdullah Radwan

Addon Developer
Addon Developer
Joined
Aug 20, 2017
Messages
314
Reaction score
284
Points
78
Location
Cairo
I've used Fred18 calculations to calculate the touchdown points and that worked:

Code:
          double ro = 1.3; // Your vessel size.
	  TOUCHDOWNVTX td[4];

	  double x_target = -0.5; // How many meters you want your vessel to sink 'under pressure'.
	  double stiffness = (-1)*(GetMass()*9.80655) / (3 * x_target);
	  double damping = 0.9*(2 * sqrt(GetMass()*stiffness));
	  for (int i = 0; i<4; i++)
	  {

		  td[i].damping = damping;
		  td[i].mu = 3;
		  td[i].mu_lng = 3;
		  td[i].stiffness = stiffness;
	  }
	  td[0].pos.x = cos(30 * RAD)*ro;
	  td[0].pos.y = -Height_From_Ground;
	  td[0].pos.z = -sin(30*RAD)*ro;
	  td[1].pos.x = 0;
	  td[1].pos.y = -Height_From_Ground;
	  td[1].pos.z = 1*ro;
	  td[2].pos.x = -cos(30 * RAD)*ro;
	  td[2].pos.y = -Height_From_Ground;
	  td[2].pos.z = -sin(30 * RAD)*ro;
	  td[3].pos.x = 0;
	  td[3].pos.y = 15 * ro;
	  td[3].pos.z = 0;


	  SetTouchdownPoints(td, 4);

I've extracted the values, as they always the same for UCSO:

Code:
	double stiffness = -(GetMass() * 9.80655) / (3 * -0.001);
	double damping = 0.9 * (2 * sqrt(GetMass() * stiffness));

	static TOUCHDOWNVTX tdvtx[4] = {
	{{ 1.125833, -0.65, -0.65 }, stiffness, damping, 3, 3},
	{{ 0, -0.65, 1.3 }, stiffness, damping, 3, 3},
	{{ -1.125833, -0.65, -0.65 }, stiffness, damping, 3, 3},
	{{ 0, 19.5, 0 }, stiffness, damping, 3, 3}
	};

Many thanks, Fred18! Your calculations are awesome!
 
Top