Orbiter-Forum  

Go Back   Orbiter-Forum > Orbiter Space Flight Simulator > Orbiter SDK
Register Blogs Orbinauts List Social Groups FAQ Projects Mark Forums Read

Notices

Orbiter SDK Orbiter software developers post your questions and answers about the SDK, the API interface, LUA, meshing, etc.

Reply
 
Thread Tools
Old 11-05-2016, 11:35 AM   #91
fred18
Addon Developer

Default

If it may help this code is doing quite well for me for general cases, I got it after martin explanation
Code:
   double x_target=-0.5;
   double stiffness=(-1)*(EmptyMass*9.80655)/(3*x_target);
   double damping=0.9*(2*sqrt(EmptyMass*stiffness));
Of course EmptyMass should be probably total mass in your case
fred18 is offline   Reply With Quote
Thanked by:
Old 11-06-2016, 11:36 PM   #92
jedidia
shoemaker without legs
 
jedidia's Avatar
Default

Huh... I thought that compression of the touchdown points would be reflected in their position, but it isn't. How would I best go about hooking up gear compression to an animation?

The only way I can see currently is to calculate the altitude above ground of every individual touchdown point, but that seems excessive, seeing as orbiter doubtlessly does the same already. Is there any way to querry the altitude above/below ground or current compression of a given touchdown point?
jedidia is offline   Reply With Quote
Thanked by:
Old 11-07-2016, 01:33 PM   #93
JMW
Aspiring Addon Developer
 
JMW's Avatar
Default

Very good question!
I had previously (very arbitrarily) done it for 2010 in the A4E Skyhawk & F-35B Lightning.
Now have adapted to 2016 but is not directly linked to the compression value (hence even more abitrary! )
So very interested to see any solutions.....
JMW is offline   Reply With Quote
Thanked by:
Old 11-07-2016, 01:45 PM   #94
fred18
Addon Developer

Default

only way to do it that comes to my mind is to get the altitude above the ground of the points... barycenter height, orientation against soil, trigonometry to get the height of each point, animation set proportional to it
fred18 is offline   Reply With Quote
Old 11-07-2016, 03:49 PM   #95
JMW
Aspiring Addon Developer
 
JMW's Avatar
Default

Well, I've googled barycentre height and it's way over my head.

https://en.wikipedia.org/wiki/Barycentric_coordinate_system


Are you calculating height of CG with view of linking to animation, cos that might work?

Is there a call to GetCG relative to the surface ?..........

PHP Code:
* \brief Elevation of the vessel's centre of gravity (COG) above ground.
     * \return Distance of COG from vessel ground contact plane [m].
     * \note The COG elevation is defined as the normal distance of the vessel'
s
     
*   centre of gravity from the ground contact plane defined by its
     
*   three touchdown points.
     * \
note By definitionthe vessel's centre of gravity coincides with the
     *   origin of the local vessel frame. 
     * \sa GetTouchdownPoints, SetTouchdownPoints
     */
    double GetCOG_elev () const; 

Last edited by JMW; 11-07-2016 at 03:53 PM. Reason: Answer my own question
JMW is offline   Reply With Quote
Thanked by:
Old 11-07-2016, 03:49 PM   #96
martins
Orbiter Founder
Default

Quote:
Originally Posted by jedidia View Post
 Huh... I thought that compression of the touchdown points would be reflected in their position, but it isn't. How would I best go about hooking up gear compression to an animation?

The only way I can see currently is to calculate the altitude above ground of every individual touchdown point, but that seems excessive, seeing as orbiter doubtlessly does the same already. Is there any way to querry the altitude above/below ground or current compression of a given touchdown point?
I'm afraid this information is not (yet) exposed to the API. I'll see if this can be incorporated in an update. For now you are on your own, as far as computing the compression is concerned.
martins is offline   Reply With Quote
Old 11-07-2016, 04:17 PM   #97
fred18
Addon Developer

Default

Quote:
Originally Posted by JMW View Post
 Well, I've googled barycentre height and it's way over my head.

https://en.wikipedia.org/wiki/Barycentric_coordinate_system


Are you calculating height of CG with view of linking to animation, cos that might work?

Is there a call to GetCG relative to the surface ?..........
I think you're thinking it wrong: getting a barycenter of a complex structure is another story, here it's enough to use GetAltitude with ALTMODE_GROUND used
fred18 is offline   Reply With Quote
Old 11-07-2016, 04:27 PM   #98
JMW
Aspiring Addon Developer
 
JMW's Avatar
Default

Probably.
Guess we'll have to wait for the Doc to give us a call........

Yeah, wrong tree.
CG doesn't of itself change with braking effort.
Dunno why, but thought it would...........

Last edited by JMW; 11-07-2016 at 04:38 PM. Reason: Durh !
JMW is offline   Reply With Quote
Old 11-07-2016, 07:39 PM   #99
jedidia
shoemaker without legs
 
jedidia's Avatar
Default

Quote:
For now you are on your own, as far as computing the compression is concerned.
Thanks, I'll hold off on it for a bit then. I would feel capable of doing it, but the whole processing overhead seems somewhat intense for something that Orbiter must already be doing in one way or another.
jedidia is offline   Reply With Quote
Old 11-14-2016, 11:53 AM   #100
gattispilot
Addon Developer
 
gattispilot's Avatar
Default

Ok. Not sure why this vessel is rotating in the z axis. I know the touchdown points are 2010 setup. But it does the same in 2016 format. This vessel is fine in 2010

Code:
	SetTouchdownPoints(_V(0, .001, 20), _V(-15, .001, -20), _V(15, .001, -20));;
2016 code:
Code:
	DWORD ntdvtx = 4;
static TOUCHDOWNVTX tdvtx[4] = {
	{ _V(0, 0.001, 20), 1e5, 1e2, 0.5, 0.005 },
	{ _V(-15, 0.001, -20), 1e5, 1e2, 0.5, 0.005 },
	{ _V(15, 0.001, -20), 1e5, 1e2, 0.5, 0.005 },
	{ _V(0, 5, 0), 1e5, 1e2, 0.5 }// new point just to make a closed shape (more are not needed as the crawler is unlikely to get upside down)
};
Code:
	
	SetTouchdownPoints(tdvtx, ntdvtx);


---------- Post added 11-14-16 at 05:53 AM ---------- Previous post was 11-13-16 at 03:47 PM ----------

I used Fred's formula and now the LER works.

its not perfect as sometimes the wheels are covered by the mesh.
Code:
static const int ntdvtx = 3;
static TOUCHDOWNVTX tdvtx[ntdvtx] = {
	{ _V(0, -2.166, 1.5), 26150.8, 18409.6, 3.2, 0.8 },
	{ _V(-2, -2.166, -2.6), 26150.8, 18409.6, 3.2, 0.4 },
	{ _V(2, -2.166, -2.6), 26150.8, 18409.6, 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 found I need a brake or something. When I stop on a slope i roll back down.

Last edited by gattispilot; 11-13-2016 at 09:52 PM.
gattispilot is offline   Reply With Quote
Old 11-14-2016, 12:06 PM   #101
jedidia
shoemaker without legs
 
jedidia's Avatar
Default

Quote:
its not perfect as sometimes the wheels are covered by the mesh.
Pretty much unavoidable without hooking the suspension up to an animation.
jedidia is offline   Reply With Quote
Old 11-14-2016, 01:17 PM   #102
gattispilot
Addon Developer
 
gattispilot's Avatar
Default

Quote:
Originally Posted by jedidia View Post
 Pretty much unavoidable without hooking the suspension up to an animation.
Oh I would think that the vessel would be at the surface.

I meant that because of 3 touchdown points there would be some coverage of the wheels. So maybe I need to increase the Y. So I am riding the surface?
gattispilot is offline   Reply With Quote
Old 11-14-2016, 01:20 PM   #103
Urwumpe
Certain Super User
 
Urwumpe's Avatar

Default

Quote:
Originally Posted by gattispilot View Post
 Oh I would think that the vessel would be at the surface.

I meant that because of 3 touchdown points there would be some coverage of the wheels. So maybe I need to increase the Y. So I am riding the surface?
Remember, Orbiter now simulates springs. How are those behaving, when you put weight on them?
Urwumpe is offline   Reply With Quote
Thanked by:
Old 11-14-2016, 01:25 PM   #104
gattispilot
Addon Developer
 
gattispilot's Avatar
Default

Quote:
Originally Posted by Urwumpe View Post
 Remember, Orbiter now simulates springs. How are those behaving, when you put weight on them?

So how would you add weight to the vessel? Besides coding it.
gattispilot is offline   Reply With Quote
Old 11-14-2016, 01:29 PM   #105
Urwumpe
Certain Super User
 
Urwumpe's Avatar

Default

Quote:
Originally Posted by gattispilot View Post
 So how would you add weight to the vessel? Besides coding it.
See here:

https://en.wikipedia.org/wiki/Mass_versus_weight


Remember also the following simple high school physics text book example:

http://www.4physics.com/phy_demo/Hoo...kesLawLab.html
Urwumpe is offline   Reply With Quote
Thanked by:
Reply

  Orbiter-Forum > Orbiter Space Flight Simulator > Orbiter SDK


Thread Tools

Posting Rules
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
Forum Jump


All times are GMT. The time now is 07:29 PM.

Quick Links Need Help?


About Us | Rules & Guidelines | TOS Policy | Privacy Policy

Orbiter-Forum is hosted at Orbithangar.com
Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright 2007 - 2012, Orbiter-Forum.com. All rights reserved.