Jump to content

gimbals and transforms


Recommended Posts

I decided I'm sick of gimbals going the wrong way on a Goddard-style rocket, and not dealing with roll, so I'm working on a smarter gimbal module. Only slight issue: I'm not entirely clear on exactly how to tell KSP to point the engine appropriately once I've calculated which way it should point.

So far what I've done is copied the LV-T45 and changed "ModuleGimbal" to "ModuleSmartGimbal".

I was assuming that inside that module, what I should do is find the gimbalTransformName transform and make its localRotation point according to what my math says it should point.

Here is what happens when the gimbals point at Euler angles (0,0,0), which I assumed was the neutral position:

6bSnmhq.jpg

So I am definitely setting the local rotation: the engines are pointing opposite each other, as you'd expect on a symmetric craft. When I apply pitch or yaw, they move accordingly (I haven't implemented roll yet). But (0,0,0) is not the rest pose. Am I changing the right transform? Or is the rest pose something else?

Link to comment
Share on other sites

Anyone want to test ModuleSMRTGimbal?

Usage: first, build. You'll need to edit the references to point to the appropriate place, and you might want to update my after-build custom step.

Afterwards, in any part.cfg, replace ModuleGimbal with ModuleSMRTGimbal.

Now you can fly rockets like this one (well, for the most part -- when the center of mass flips from being below to being above the T45s at the top, you lose control for a little bit):

l6ZEJJ0.jpg

Link to comment
Share on other sites

Nice, so i can soon use my abandoned "Lander with engines on top and bottom" designs, again? And is it safe&stable enough to use this Module for all Engines? I don't really like editing those configs and would prefer to replace the stock gimbal modules after loading the parts. I wonder if it is even possible to make the save file compatible.

ps: What about using the stock ModuleGimbal as base class? That way it might only be necessary to overwrite OnFixedUpdate and let the stock code handle everything else.

Edited by Faark
Link to comment
Share on other sites

Why not subclass is that there's too little worth reusing.

It should be equally safe for use on any engine. Your action groups to toggle the gimbals aren't likely to work out of the box, but other than that it's a drop-in replacement.

It isn't 100% for me in testing last night though. Sometimes it seems to reverse the controls. It'll be a few days before I can debug it.

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