Jump to content

Landing legs in 1.1


Recommended Posts

 

Yeah, from working with my legs, it looks like the suspensionDistance has to match the actual distance on the wheel collider's suspension distance in Unity (taking into account that the wheel radius also counts). Not the scaled distance, if the leg has scales other than "1", but the actual distance. This is assuming a target position of "1.0".

Link to comment
Share on other sites

1 hour ago, nli2work said:

alright... have to do it the hard way. The only value I changed is SuspensionDistance, in 0.25 increments. SuspensionOffset is same value as Distance but negative just to keep things consistent, it doesn't affect the actual suspensionHeight, only moves suspensionTransform up/down the suspensionLine. Yellow disc is center of WheelCollider

The leg arms are all 1m long; each tick on the green ruler is 0.2m. Red line marks bottom of Leg Foot, it's floating quite a lot with higher suspensionDistance. I'm not seeing any kind of pattern here... where, and in what direction, is suspensionDistance measured from??

MvkmPj8.jpg

Isn't this just a unity override?

Quote

From the unity docs: Suspension Distance - Maximum extension distance of wheel suspension, measured in local space. Suspension always extends downwards through the local Y-axis.

However, as I pointed out before, I think groundHeightOffset is this measurement. 

Link to comment
Share on other sites

1 minute ago, nli2work said:

believe it or not, the suspension Distance in unity collider is set to 0.

 

OK, I should amend it to say, that it looks like it needs to be the actual distance to barely protrude through the piston collider and make physical contact with the ground first. ;)

 

Link to comment
Share on other sites

groundHeightOffset adjusts how high the vessel is unpacked. It's added to the distance from what KSP figures is the lowest point on the vessel, to the surface of terrain. If you set it 0. vessel is unpacked on the terrain. if you set it to 5, vessel is unpacked 5m above terrain and dropped.

Link to comment
Share on other sites

1 minute ago, nli2work said:

groundHeightOffset adjusts how high the vessel is unpacked. It's added to the distance from what KSP figures is the lowest point on the vessel, to the surface of terrain. If you set it 0. vessel is unpacked on the terrain. if you set it to 5, vessel is unpacked 5m above terrain and dropped.

haha, sorry was looking at the wrong part of your screen grabs :o

Link to comment
Share on other sites

1 minute ago, nli2work said:

groundHeightOffset adjusts how high the vessel is unpacked. It's added to the distance from what KSP figures is the lowest point on the vessel, to the surface of terrain. If you set it 0. vessel is unpacked on the terrain. if you set it to 5, vessel is unpacked 5m above terrain and dropped.

 

Do you know if the unpacking height it chooses takes into account the actual deployed length of the legs? I'm wondering if that's the reason for having this variable.

Link to comment
Share on other sites

1 minute ago, NecroBones said:

 

Do you know if the unpacking height it chooses takes into account the actual deployed length of the legs? I'm wondering if that's the reason for having this variable.

as far as I could tell this only seems to be applied when legs are set to start extended state.

Link to comment
Share on other sites

Some great info here, guys. I wish I could help, but I don't have the steam version.

Just now, nli2work said:

groundHeightOffset adjusts how high the vessel is unpacked. It's added to the distance from what KSP figures is the lowest point on the vessel, to the surface of terrain. If you set it 0. vessel is unpacked on the terrain. if you set it to 5, vessel is unpacked 5m above terrain and dropped.

So this is what replaces the "bounds" object.

In your example above, did you move the visible representation of the leg to match the fully extended position in Unity when changing the suspensionDistance property?

Apologies if I'm getting confused about what you're struggling with, or there's a nuance of the new module I'm not aware of yet.

Link to comment
Share on other sites

8 minutes ago, NecroBones said:

 

Do you know if the unpacking height it chooses takes into account the actual deployed length of the legs? I'm wondering if that's the reason for having this variable.

if it's less than the height of deployed legs then legs take precedence. if higher, vessel spawns in the air and drops. It's only considered when the vessel is first unpacked in the game, afterwards the height must be saved somewhere and you don't see the effect of groundHeightOffset.

baMW2Oz.jpg

(presumably) the wheelCollider settings in the LT05 lander leg. not very close to the config settings.

 

another caveat... according to the last devnote wheel suspension is getting changed... so all this maybe for naught.

Edited by nli2work
Link to comment
Share on other sites

39 minutes ago, lo-fi said:

Some great info here, guys. I wish I could help, but I don't have the steam version.

So this is what replaces the "bounds" object.

In your example above, did you move the visible representation of the leg to match the fully extended position in Unity when changing the suspensionDistance property?

Apologies if I'm getting confused about what you're struggling with, or there's a nuance of the new module I'm not aware of yet.

Spring/Damper are all constant in the 5 screencaps. you can see the suspension is compressed the same distance in all of them. 

I'm just not seeing any easy relationship between the suspensionDistance setting to the actual suspension height in game; except when it's 0 in the first screencap. the blue/yellow marker line, half way down the leg goign through the disk marks the pivot of the suspensionTransform that is moved by the wheelCollider physics... just like earlier KSP versions.

with suspensionDistance 0; it sits on the ground. as expected.
with suspensionDistance 0.25; it's sitting about 1m above the launch pad collider(which is slightly lower than the visible mesh)
with suspensionDistance 0.5; it's sitting about 1.8m above the launch pad
with suspensionDistance 0.75; it's sitting ~2.8m above

I guess there's a factor of 4 going on here... but where is it coming from?

 

 

Here's what groundHeightOffset does, so yeah lo-fi sums it up nicely, it replaces Bounds collider

 

Edited by nli2work
Link to comment
Share on other sites

Oh, I see! Yes, that's rather puzzling. Honestly, the entire reason I gave up with the Squad modules and wrote my own was because I got fed up with battling odd issues like that. Mine may not have been perfect, but at least I had some idea of what I'd stuffed up.

A nice gotcha with Unity is the of the scale of a parent object affects the translation of a child. Have you checked the scale of all your GO's in that model? They can come through real funny, particularly from FBX. Unless it's scale 1.0 throughout, you're going nowhere. In old money, I'd immediately be looking up the chain from the WC or the WC GO itself. You may have covered this base already, but it's easy to miss or forget about (wood for trees - haven't we all been there).

Link to comment
Share on other sites

39 minutes ago, nli2work said:

if it's less than the height of deployed legs then legs take precedence. if higher, vessel spawns in the air and drops. It's only considered when the vessel is first unpacked in the game, afterwards the height must be saved somewhere and you don't see the effect of groundHeightOffset.

 

Ah, awesome. Thanks!

 

39 minutes ago, nli2work said:

another caveat... according to the last devnote wheel suspension is getting changed... so all this maybe for naught.

 

Yeah, I thought about that too. If it's just the scaling of the suspension strength, then all of the springRatio and damperRatio values may have to change, but maybe nothing else. We'll just have to wait and see.

 

Link to comment
Share on other sites

7 minutes ago, lo-fi said:

Oh, I see! Yes, that's rather puzzling. Honestly, the entire reason I gave up with the Squad modules and wrote my own was because I got fed up with battling odd issues like that. Mine may not have been perfect, but at least I had some idea of what I'd stuffed up.

A nice gotcha with Unity is the of the scale of a parent object affects the translation of a child. Have you checked the scale of all your GO's in that model? They can come through real funny, particularly from FBX. Unless it's scale 1.0 throughout, you're going nowhere. In old money, I'd immediately be looking up the chain from the WC or the WC GO itself. You may have covered this base already, but it's easy to miss or forget about (wood for trees - haven't we all been there).

yeah I'm particularly careful about scale, they're all 1,1,1. Anything other than that you get odd compressions and stretches when GOs get animated.

Link to comment
Share on other sites

 

@Bonus Eventus Should be the same, I'll have to check. It's not really all that important though. the only value I changed was suspensionDistance, to see how it's change affected actual suspension in game, whether it's a 1:1 relation (as one would expect) or something else. 

well, the last test was trash... I had rescaleFactor = 0.5 in the config for some forgotten reason. will redo it later today with that set to 1. will post pics

Edited by nli2work
Link to comment
Share on other sites

16 minutes ago, nli2work said:

 

@Bonus Eventus Should be the same, I'll have to check. It's not really all that important though. the only value I changed was suspensionDistance, to see how it's change affected actual suspension in game, whether it's a 1:1 relation (as one would expect) or something else. 

well, the last test was trash... I had rescaleFactor = 0.5 in the config for some forgotten reason. will redo it later today with that set to 1. will post pics

Oh snap! That's too bad. Appreciate you sharing these tests and analysis with all of us!

Actually I did some tests this morning and it seemed that increasing the radius would add to suspension distance, just trying to cancel out variables. 

 

Unity Setup (4.22)

9u0K34U.png

540S8yM.png

 

E13tZKw.png

CFG Settings

(copied from LT-2 and then adjusted)

MODULE
	{
		name = ModuleWheelBase
		
		wheelColliderTransformName = wheelCollider		
		
		wheelType = LEG

		// setting this to true will override the radius and center parameters
		FitWheelColliderToMesh = False		
		radius = 0.0
		center = 0,0,0
		mass = 0.040
		autoFrictionAvailable = False
				
		TooltipTitle = Landing Leg
		TooltipPrimaryField = 
		
		groundHeightOffset = 0.77168625
	}
	MODULE
	{
		name = ModuleWheelSuspension
		baseModuleIndex = 0
		suspensionTransformName = piston
		
		//suspensionDistance = 0.83
		suspensionDistance = 4
		suspensionOffset = -0.83
		
		targetPosition = 1.0			
		springRatio = 3
		damperRatio = 1.0
		boostRatio = 0.1
	}
	MODULE
	{
		name = ModuleWheelDeployment
		baseModuleIndex = 0
		
		animationTrfName = legTest
		animationStateName = leg
		deployedPosition = 1
		deployTargetTransformName = foot
		
		TsubSys = 0.83
	}
	MODULE
	{
		name = ModuleWheelLock
		maxTorque = 500
	}
	MODULE
	{
		name = ModuleWheelBogey
		baseModuleIndex = 0
		
		bogeyTransformName = foot
		deployModuleIndex = 2
		
		maxPitch = 160
		minPitch = -160
		restPitch = 0
		pitchResponse = 100
		
		bogeyAxis = 0, 0, 1
		bogeyUpAxis = -1, 0, 0
	}

KSP Test

4jpIpv4.png

suspensionDistance = 0.83 (just like in unity) (these screens were captured at vehicle launch, legs started in the extended position)

1AfiuRu.png

suspensionDistance = 4 

Oddly, this had the effect of submerging the craft on unpack, but then when the legs were retracted and then extended again they work like normal and there was no appreciable difference. I'm wondering if this has anything to do with my wheelCollider orientation.

I noticed that what seemed to have the biggest effect on the suspension was the spring, slip, and damper settings in unity. I plan to do some more tests throughout the day.

 

Link to comment
Share on other sites

here we go.. this makes more sense. SuspensionDistance. linear progression, in the direction -Y of wheelCollider local space, as per Unity docs.
E9kYjaO.jpg

 

And suspensionOffset, purely cosmetic.... except maybe if there's a collider on the lower leg. 

DPHxpvf.jpg

Link to comment
Share on other sites

 

As of 1209, my MRS landing legs aren't considering themselves to be "landed" when they're on the ground, for purposes of science and leaving the scene, etc. An easy test is to spawn something on the pad with clamps, release the clamps, and sure enough, it doesn't let you recover vessel. The suspension is working great, feet are on the ground, but it's still not in a landed state.

 

I haven't checked to see if this is affecting my other legs. No idea what changed in KSP. I may play with Sarbian's debug tool a little and see if there's anything noticeable.

Link to comment
Share on other sites

1 minute ago, nli2work said:

I've noticed in earlier version, but it was sporadic. is it consistently occuring now?

 

With that one set of legs, yes. Ironically, they're the ones that have been working the best, in terms of suspension. The other legs all seem to detect landing correctly. I can't find anything functionally different.

Link to comment
Share on other sites

 

Yeah, I don't think it's a jitter problem though. I tightened up the ratios and it doesn't seem to make a difference (I didn't try loosening it though). What did seem interesting was that if I folded and unfolded the legs, occasionally they would be recognized as landed. But standing in any given position, it was more likely to not work correctly.

Link to comment
Share on other sites

This thread is quite old. Please consider starting a new thread rather than reviving this one.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...