Jump to content

Rover wheel alignment.


Recommended Posts

The wheels look like they're straight on my Kethane mining rover but it has a pull to the right. Not so bad in testing on Kerbin but on Minmus it's difficult to keep it from doing spinouts.

Here's the wheel parts of the craft file. What do I change to make the wheels point perfectly straight ahead?


PART
{
part = wheelMed_4294377284
partName = Part
pos = 3.55579,33.96711,2.078393
rot = 0,0.7071068,0,0.7071068
attRot = 0,-0.5000001,0,0.8660255
mir = 1,1,1
istg = 0
dstg = 0
sidx = -1
sqor = -1
attm = 1
sym = wheelMed_4294377142
srfN = srfAttach,trussPiece3x_4294377304

PART
{
part = wheelMed_4294377142
partName = Part
pos = -3.617311,33.96711,-2.062999
rot = 0,0.7071068,0,-0.7071068
attRot = 0,-0.5000001,0,0.8660255
mir = 1,1,1
istg = 0
dstg = 0
sidx = -1
sqor = -1
attm = 1
sym = wheelMed_4294377284
srfN = srfAttach,trussPiece3x_4294377162

PART
{
part = wheelMed_4294377000
partName = Part
pos = 3.557416,33.96853,-2.063938
rot = 0,0.7372773,0,-0.6755905
attRot = 0,0.4617487,0,0.8870109
mir = 1,1,1
istg = 0
dstg = 0
sidx = -1
sqor = -1
attm = 1
sym = wheelMed_4294376858
srfN = srfAttach,trussPiece3x_4294377020

PART
{
part = wheelMed_4294376858
partName = Part
pos = -3.618935,33.96853,2.079332
rot = 0,-0.6755905,0,-0.7372772
attRot = 0,0.4617487,0,0.8870109
mir = 1,1,1
istg = 0
dstg = 0
sidx = -1
sqor = -1
attm = 1
sym = wheelMed_4294377000
srfN = srfAttach,trussPiece3x_4294376878

Edited by Galane
Figured out the right numbers. Amazed at the excessive precision.
Link to comment
Share on other sites

Awesome looking rover :D I'd personally make sure its weight is equally balanced first before mucking around with the CFG files, although by the looks of it you've done a pretty good job anyway.

You could also right click the wheels and lock steering? Might help :)

Link to comment
Share on other sites

I assume you built the whole thing in the VAB. Try building the rover section in the SPH, then copy the file into VAB and build the launcher there. The two buildings do symmetry differently.

Since you seem handy with manipulating files, you could redo the rover as above, then edit the file to replace it with the one already on Minmus.

Link to comment
Share on other sites

Updated the mission report thread with the redesigned Kleveland 2.

Need to get an orbital refinery expansion built and on its way to Mun, and a refinery on its way to Minmus. Expansion will just be one of the big converters and an orange tank with a couple of docking ports. If Kleveland 2 can get back off the Mun, another one will go to Mun and one to Minmus.

Next project, building a Kethane rover around an 8,000 unit Kethane tank. Would be nice if I could dummy load the Kethane tanks for better testing on Kerbin. I like overpowered landers and rovers. If they can lift on Kerbin they can lift anywhere with lower gravity.

Link to comment
Share on other sites

There is a Kethane Pack part that 'converts' Kerbals into an apparently large amount of Kethane instantly. I've never used it, but if you're determined enough to test your rovers more efficiently in the name of science, so be it :0.0:

qQHlEjC.jpg

Link to comment
Share on other sites

This answer brought to you by the numbers 0.7071068 -0.7071068 and 0,0,0,1

I made a very simple test rover using editor extensions vertical snap to ensure the wheels would be attached straight.

These are the numbers to align the wheels of a four wheel rover, turned sideways in the VAB so that when KSP spins the entire ship 90 degrees onto the pad (WTH does it do that?) the wheels will be aligned straight in case you want to drive off the pad without having to drive back and forth to turn.

pos = 3.55579,33.96711,2.078393 <-Position coordinates. The middle number is the vertical position in the VAB, NOT relative to any other part of the rocket. To have all your wheels in the same plane, change all the middle numbers to be identical. Choose it from one wheel and copy it to all the other wheels.

rot = 0,0.7071068,0,0.7071068 <-This wheel happens to be perfectly aligned!

attRot = 0,-0.5000001,0,0.8660255 <-Change this for ALL the wheels to 0,0,0,1 I'd think there should be a - in there for one side or the other but the test rover came off the build floor with all four wheels set to 0,0,0,1 and in proper left-right orientation.

pos = -3.617311,33.96711,-2.062999

rot = 0,0.7071068,0,-0.7071068 <-Another perfectly aligned wheel!

attRot = 0,-0.5000001,0,0.8660255

pos = 3.557416,33.96853,-2.063938

rot = 0,0.7372773,0,-0.6755905 <-Ah, now I see the problem. Symmetry and angle snap didn't *quite* snap it right.

attRot = 0,0.4617487,0,0.8870109

pos = -3.618935,33.96853,2.079332

rot = 0,-0.6755905,0,-0.7372772 <-Oh, symmetry, you mischievous minx, you've turned this wheel ever so slightly off too. Shame on you.

attRot = 0,0.4617487,0,0.8870109

I yanked the launcher out from under Krover, twiddled these numbers and now it drives straight, and I put all the wheels at the same height. Now to make these alterations in the full-up .craft with launcher - or possibly I'll just delete it since I won't be using it again. I may make the changes to the original Kleveland since with a bit more electrical generation added and lowering the wheels to match Kleveland 2's ground clearance it'd be good for Minmus and other small moons.

Kleveland 2 appears to drive straight but I'll check its .craft to see if the rotations need tweaked.

Link to comment
Share on other sites

Here's my test rover. I tried to compare Kleveland 2's numbers to Krovers but couldn't figure out which wheel was on which corner, and it also looked like they were in a different order in the .craft file. That's when the idea hit me (ow!) to make a very simple rover to look at.

What still bugs me is WTF the rotation and position mumbers have so many decimal positions? Some here go so far as to require scientific notation! I bet there could be a significant performance increase if the position and rotation numbers of all the parts were limited to only 3 or 4 digits after the decimal point.

And why is a 90 degree rotation from the default orientation 0.7071068 or -0.7071068 (or close to it, the final digit was 7, 8 or 9 in Kleveland 2 but all 8 in the test .craft)? Is KSP using radians instead of degrees?

Scientific notation to specify the rotation of a component in a simulation *game*? Sheesh. Why rot = -2.000552E-17,-0.7071068,2.000552E-17,-0.7071068 when rot = 0,-0.7071068,0,-0.7071068 does exactly the same thing? I bet rot = 0,-0.7071,0,-0.7071 would be just as good, would reduce the size of .craft files AND reduce the calculation load on the CPU.


ship = rover-cfg-test
version = 0.21.1
description =
type = VAB
PART
{
part = roverBody_4294125302
partName = Part
pos = 1.676209E-07,5,2.770103E-07
rot = 0,-0.7071068,0,0.7071068
attRot = 0,-0.7071068,0,0.7071068
mir = 1,1,1
istg = 0
dstg = 0
sidx = -1
sqor = -1
attm = 0
link = trussPiece1x_4294123334
link = trussPiece1x_4294123268
EVENTS
{
}
ACTIONS
{
}
MODULE
{
name = ModuleTripLogger
isEnabled = False
EVENTS
{
}
ACTIONS
{
}
Surfaced
{
}
Flew
{
}
FlewBy
{
}
Orbited
{
}
SubOrbited
{
}
}
}
PART
{
part = trussPiece1x_4294123334
partName = Part
pos = 1.295976,5,3.209211E-07
rot = 0.5000001,0.5000001,-0.5000001,0.5000001
attRot = 0,0,0,1
mir = 1,1,1
istg = 0
dstg = 0
sidx = -1
sqor = -1
attm = 1
link = wheelMed_4294118110
link = wheelMed_4294117472
sym = trussPiece1x_4294123268
srfN = srfAttach,roverBody_4294125302
EVENTS
{
}
ACTIONS
{
}
}
PART
{
part = trussPiece1x_4294123268
partName = Part
pos = -1.295975,5,3.463971E-07
rot = -0.5000001,0.5000001,-0.5000001,-0.5000001
attRot = 0,0,0,1
mir = 1,1,1
istg = 0
dstg = 0
sidx = -1
sqor = -1
attm = 1
link = wheelMed_4294117970
link = wheelMed_4294117288
sym = trussPiece1x_4294123334
srfN = srfAttach,roverBody_4294125302
EVENTS
{
}
ACTIONS
{
}
}
PART
{
part = wheelMed_4294118110
partName = Part
pos = 1.295976,5,-0.3245719
rot = 0,0.7071068,0,-0.7071068
attRot = 0,0,0,1
mir = 1,1,1
istg = 0
dstg = 0
sidx = -1
sqor = -1
attm = 1
sym = wheelMed_4294117970
srfN = srfAttach,trussPiece1x_4294123334
EVENTS
{
}
ACTIONS
{
}
MODULE
{
name = ModuleWheel
isEnabled = True
brakesEngaged = False
steeringLocked = False
isDamaged = False
invertSteering = False
motorEnabled = True
EVENTS
{
UnLockSteering
{
active = True
guiActive = False
guiIcon = Unlock Steering
guiName = Unlock Steering
category = Unlock Steering
guiActiveUnfocused = False
unfocusedRange = 2
externalToEVAOnly = True
}
LockSteering
{
active = True
guiActive = False
guiIcon = Lock Steering
guiName = Lock Steering
category = Lock Steering
guiActiveUnfocused = False
unfocusedRange = 2
externalToEVAOnly = True
}
EnableMotor
{
active = True
guiActive = False
guiIcon = Enable Motor
guiName = Enable Motor
category = Enable Motor
guiActiveUnfocused = False
unfocusedRange = 2
externalToEVAOnly = True
}
DisableMotor
{
active = True
guiActive = False
guiIcon = Disable Motor
guiName = Disable Motor
category = Disable Motor
guiActiveUnfocused = False
unfocusedRange = 2
externalToEVAOnly = True
}
InvertSteering
{
active = True
guiActive = False
guiIcon = Invert Steering
guiName = Invert Steering
category = Invert Steering
guiActiveUnfocused = False
unfocusedRange = 2
externalToEVAOnly = True
}
RepairWheel
{
active = True
guiActive = False
guiIcon = Repair Wheel
guiName = Repair Wheel
category = Repair Wheel
guiActiveUnfocused = True
unfocusedRange = 4
externalToEVAOnly = True
}
}
ACTIONS
{
InvertSteeringAction
{
actionGroup = None
}
LockSteeringAction
{
actionGroup = None
}
UnlockSteeringAction
{
actionGroup = None
}
ToggleSteeringAction
{
actionGroup = None
}
ToggleMotorAction
{
actionGroup = None
}
BrakesAction
{
actionGroup = Brakes
}
}
}
MODULE
{
name = FXModuleConstrainPosition
isEnabled = True
EVENTS
{
}
ACTIONS
{
}
}
}
PART
{
part = wheelMed_4294117970
partName = Part
pos = -1.295976,5,0.3245727
rot = -2.000552E-17,-0.7071068,2.000552E-17,-0.7071068
attRot = 0,0,0,1
mir = 1,1,1
istg = 0
dstg = 0
sidx = -1
sqor = -1
attm = 1
sym = wheelMed_4294118110
srfN = srfAttach,trussPiece1x_4294123268
EVENTS
{
}
ACTIONS
{
}
MODULE
{
name = ModuleWheel
isEnabled = True
brakesEngaged = False
steeringLocked = False
isDamaged = False
invertSteering = False
motorEnabled = True
EVENTS
{
UnLockSteering
{
active = True
guiActive = False
guiIcon = Unlock Steering
guiName = Unlock Steering
category = Unlock Steering
guiActiveUnfocused = False
unfocusedRange = 2
externalToEVAOnly = True
}
LockSteering
{
active = True
guiActive = False
guiIcon = Lock Steering
guiName = Lock Steering
category = Lock Steering
guiActiveUnfocused = False
unfocusedRange = 2
externalToEVAOnly = True
}
EnableMotor
{
active = True
guiActive = False
guiIcon = Enable Motor
guiName = Enable Motor
category = Enable Motor
guiActiveUnfocused = False
unfocusedRange = 2
externalToEVAOnly = True
}
DisableMotor
{
active = True
guiActive = False
guiIcon = Disable Motor
guiName = Disable Motor
category = Disable Motor
guiActiveUnfocused = False
unfocusedRange = 2
externalToEVAOnly = True
}
InvertSteering
{
active = True
guiActive = False
guiIcon = Invert Steering
guiName = Invert Steering
category = Invert Steering
guiActiveUnfocused = False
unfocusedRange = 2
externalToEVAOnly = True
}
RepairWheel
{
active = True
guiActive = False
guiIcon = Repair Wheel
guiName = Repair Wheel
category = Repair Wheel
guiActiveUnfocused = True
unfocusedRange = 4
externalToEVAOnly = True
}
}
ACTIONS
{
InvertSteeringAction
{
actionGroup = None
}
LockSteeringAction
{
actionGroup = None
}
UnlockSteeringAction
{
actionGroup = None
}
ToggleSteeringAction
{
actionGroup = None
}
ToggleMotorAction
{
actionGroup = None
}
BrakesAction
{
actionGroup = Brakes
}
}
}
MODULE
{
name = FXModuleConstrainPosition
isEnabled = True
EVENTS
{
}
ACTIONS
{
}
}
}
PART
{
part = wheelMed_4294117472
partName = Part
pos = 1.295976,5,0.3253658
rot = 0,-0.7071068,0,-0.7071068
attRot = 0,0,0,1
mir = 1,1,1
istg = 0
dstg = 0
sidx = -1
sqor = -1
attm = 1
sym = wheelMed_4294117288
srfN = srfAttach,trussPiece1x_4294123334
EVENTS
{
}
ACTIONS
{
}
MODULE
{
name = ModuleWheel
isEnabled = True
brakesEngaged = False
steeringLocked = False
isDamaged = False
invertSteering = False
motorEnabled = True
EVENTS
{
UnLockSteering
{
active = True
guiActive = False
guiIcon = Unlock Steering
guiName = Unlock Steering
category = Unlock Steering
guiActiveUnfocused = False
unfocusedRange = 2
externalToEVAOnly = True
}
LockSteering
{
active = True
guiActive = False
guiIcon = Lock Steering
guiName = Lock Steering
category = Lock Steering
guiActiveUnfocused = False
unfocusedRange = 2
externalToEVAOnly = True
}
EnableMotor
{
active = True
guiActive = False
guiIcon = Enable Motor
guiName = Enable Motor
category = Enable Motor
guiActiveUnfocused = False
unfocusedRange = 2
externalToEVAOnly = True
}
DisableMotor
{
active = True
guiActive = False
guiIcon = Disable Motor
guiName = Disable Motor
category = Disable Motor
guiActiveUnfocused = False
unfocusedRange = 2
externalToEVAOnly = True
}
InvertSteering
{
active = True
guiActive = False
guiIcon = Invert Steering
guiName = Invert Steering
category = Invert Steering
guiActiveUnfocused = False
unfocusedRange = 2
externalToEVAOnly = True
}
RepairWheel
{
active = True
guiActive = False
guiIcon = Repair Wheel
guiName = Repair Wheel
category = Repair Wheel
guiActiveUnfocused = True
unfocusedRange = 4
externalToEVAOnly = True
}
}
ACTIONS
{
InvertSteeringAction
{
actionGroup = None
}
LockSteeringAction
{
actionGroup = None
}
UnlockSteeringAction
{
actionGroup = None
}
ToggleSteeringAction
{
actionGroup = None
}
ToggleMotorAction
{
actionGroup = None
}
BrakesAction
{
actionGroup = Brakes
}
}
}
MODULE
{
name = FXModuleConstrainPosition
isEnabled = True
EVENTS
{
}
ACTIONS
{
}
}
}
PART
{
part = wheelMed_4294117288
partName = Part
pos = -1.295976,5,-0.3253652
rot = 0,-0.7071068,0,0.7071068
attRot = 0,0,0,1
mir = 1,1,1
istg = 0
dstg = 0
sidx = -1
sqor = -1
attm = 1
sym = wheelMed_4294117472
srfN = srfAttach,trussPiece1x_4294123268
EVENTS
{
}
ACTIONS
{
}
MODULE
{
name = ModuleWheel
isEnabled = True
brakesEngaged = False
steeringLocked = False
isDamaged = False
invertSteering = False
motorEnabled = True
EVENTS
{
UnLockSteering
{
active = True
guiActive = False
guiIcon = Unlock Steering
guiName = Unlock Steering
category = Unlock Steering
guiActiveUnfocused = False
unfocusedRange = 2
externalToEVAOnly = True
}
LockSteering
{
active = True
guiActive = False
guiIcon = Lock Steering
guiName = Lock Steering
category = Lock Steering
guiActiveUnfocused = False
unfocusedRange = 2
externalToEVAOnly = True
}
EnableMotor
{
active = True
guiActive = False
guiIcon = Enable Motor
guiName = Enable Motor
category = Enable Motor
guiActiveUnfocused = False
unfocusedRange = 2
externalToEVAOnly = True
}
DisableMotor
{
active = True
guiActive = False
guiIcon = Disable Motor
guiName = Disable Motor
category = Disable Motor
guiActiveUnfocused = False
unfocusedRange = 2
externalToEVAOnly = True
}
InvertSteering
{
active = True
guiActive = False
guiIcon = Invert Steering
guiName = Invert Steering
category = Invert Steering
guiActiveUnfocused = False
unfocusedRange = 2
externalToEVAOnly = True
}
RepairWheel
{
active = True
guiActive = False
guiIcon = Repair Wheel
guiName = Repair Wheel
category = Repair Wheel
guiActiveUnfocused = True
unfocusedRange = 4
externalToEVAOnly = True
}
}
ACTIONS
{
InvertSteeringAction
{
actionGroup = None
}
LockSteeringAction
{
actionGroup = None
}
UnlockSteeringAction
{
actionGroup = None
}
ToggleSteeringAction
{
actionGroup = None
}
ToggleMotorAction
{
actionGroup = None
}
BrakesAction
{
actionGroup = Brakes
}
}
}
MODULE
{
name = FXModuleConstrainPosition
isEnabled = True
EVENTS
{
}
ACTIONS
{
}
}
}

Link to comment
Share on other sites

LOL, why the heck aren't the VAB and SPH orthogonal with the coordinate system in the first place? One would really think that when a part is attached to a "default orientation" fuselage, then it's rotation should be 0.

And when you go from the SPH to the runway, your vehicle *isn't* rotated 90 degrees. For the actual game physics they probably really aren't from VAB to pad, unless what's seen through the VAB door is actually the exact same 3D space you see from outside on the pad...

It's just... aaaaaaahhhhghhh... the default rotation in the VAB is correct per the visuals. Pop in the rover body, attach wheels and it looks ready to roll out the door and up the ramp... but it appears on the pad sideways. To have the position on the pad be 'right' the vehicle has to be built 90 degrees rotated in the VAB, and even then it's 180 off because pressing W has your vehicle driving off the back end of the pad. I should rotate that test rover 180 degrees, sideways the other way, and see if it puts the front end towards the ramp.

I never caught that 90 degree rotation building rockets where rotation of the entire vehicle made no difference. Rockets go up. Rockets going sideways not good.

And why is it always daylight in the VAB, even in the middle of the night?

KSP couldn't change the coordinate system without breaking all previous .craft files, but the number of digits after the decimal on things that don't need so many digits shouldn't be a problem. Just ignore the superfluous digits on old files when loaded and flown and truncate (without rounding!) them when re-saving. Any of them in scientific notation, truncate and convert to normal numbers. If not so easy to ignore the extra, pop up a dialog saying the file needs to be re-saved before it can be loaded/edited/flown.

Link to comment
Share on other sites

.707 (etc) is root 2 on 2, so yeah.

Do you think I could edit all those to .707 or .7071 and it'd still work? If it does then a .craft processor to remove unnecessary over-precision on part rotations could be a useful utility to help KSP perform better. If it could also process the persistence and quicksave files to do that, it would be an extremely useful utility.

What would be a very useful plugin is an alignment shop. Use it to select two or more parts (possibly upper limit of 8) then click a button to vertically align them all to an average of their various positions. Since vertical position in the VAB appears to be calculated from the floor at zero, that would have to stay with the large numbers.

I wonder what KSP does with the vertical position numbers in flight? The reference point would have to change.

Another trick for the alignment shop would be perfect angle snaps, especially to 90, 45, 60, 30 and 21.5 degrees, with the decimal positions capped at 4, or 3 if the precision is good enough.

The building system has some issues with that. Try rotating an ox-stat around a round fuel tank while looking on from above. Note how the angle of the panel doesn't always stay tangent to the surface of the tank. It tilts back and forth. Is it aligning to the faces of the part rather than tracking perpendicular to the radius? If an alignment shop plugin could have a button to do that, it might be a good feature but not if it blows rotation numbers into scientific notation territory.

Programming such a plug in is beyond my skills. I know the *what* but not the *how*.

At least I figured out how to manually align the wheels. :) Now I need to look up how to swap the wheel aligned and leveled Krover for the one orbiting Minmus, without losing its load of Kethane or increasing or reducing its fuel level. Perhaps I'll wait till I get a refinery there and top off its tanks.

Link to comment
Share on other sites

I don't think removing least significant digits will make much difference in terms of performance. The game will still be storing all the values as the same datatype (floats, doubles, whatever), more of the digits will just be zeros.

Link to comment
Share on other sites

Could it be that the obscure numerical notations for rotation and alignment and whatnot are in terms of radians? It would make sense, given the polygonal geometry.

... No, I just plugged it into a calculator. A 90 degree rotation would effectively be half-pi, .8976... ish, nowhere near your number. It is, however, exactly half of 2^.5, so... Sorry.

Link to comment
Share on other sites

  • 5 weeks later...

There's 2Pi radians in a circle, or 6 and a bit. The whole radians thing is a recipe for crazy math full of irrational numbers. ;)

If the rotations in KSP were calculated in degrees, of which there are always 360 in a circle, no more, no less (unless you live in a universe where spacecraft are made of wood and Pi = exactly 3) it would be far easier on we who aren't extreme math geniuses to edit these files.

Link to comment
Share on other sites

  • 2 months later...
  • 10 months later...

For future reference, the reason why the numbers in the files don't really make sense in regards to the rotation (it has 4 elements, instead of 3 for x,y,z), is because object rotations in Unity is handled with http://unity3d.com/learn/tutorials/modules/intermediate/scripting/quaternions

If I remember correctly, though, they are measured in radians, though.

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...