Jump to content

[1.9.*, 1.10.*, 1.11.*] DockRotate - lightweight robotics - rotational control on docking ports (plus NodeRotate, make any part rotate)


peteletroll

Recommended Posts

5 minutes ago, peteletroll said:

@Geonovast, could you please post the KJR configuration that makes DockRotate work? I'd like to send a pull request (a request for modification in github speak) to the KJR developers.

 

Certainly.  It seems I forgot to set up SSH access with my new router, so it'll have to wait until I get home.

Link to comment
Share on other sites

@peteletroll


    <string name="exemptModuleType0">WingManipulator</string>
    <string name="exemptModuleType1">SingleGroupMan</string>
    <string name="exemptModuleType2">KerbalEVA</string>
    <string name="exemptModuleType3">MuMechToggle</string>
    <string name="exemptModuleType4">ModuleKerbetrotterHitch</string>
    <string name="exemptModuleType5">ModuleGrappleNode</string>
    <string name="exemptModuleType6">ModuleDockRotate</string>

 
 

The top bold line I added to allow the Klaw to pivot again, the second was to fix the dock rotating problem.

You need to add the bold lines to GameData\KerbalJointReinforcement\Plugin\PluginData\KerbalJointReinforcement\config.xml

Adjust the underlined numbers as needed, make sure they're sequential.

Edited by Geonovast
Link to comment
Share on other sites

@peteletroll

I really wanted to thank you for creating this mod.  Since I started playing the game I’ve tried experimenting (and usually failing) with multi-point docking.  And time after time the thing that always messes it up is that little misalignment that you have in one of the dock-connections.  I still can’t fathom why a feature like this isn’t in the stock game.

I haven’t tried the mod yet, but thanks again for taking the time.  I’m sure this will be super useful.

Edited by PTNLemay
Link to comment
Share on other sites

Ooh! I was really having a bear of a time getting a space station module aligned using the MechJeb docking autopilot the other day, and I remember thinking that if a simple LKO space station is this fickle I'm going to have fun when I get to building interplanetary ships and stations. This is one of those things where KSP gets in its own way and you just need a mod to fix it.

This probably saved me a lot of headaches. Thanks a ton!

EDIT: Crap, I just realized this is so new it only supports 1.3.1. Well, we're going to see if it works in 1.2.2! This could get interesting.

Edited by saxyomega90125
Uh-oh
Link to comment
Share on other sites

An idea just came to me.  Not saying that OP needs to implement it (because quite frankly it sounds kind of hard to do) but it's a way that Squad could feasibly integrate the mods features into the vanilla game.  One argument that might be made against these super rotating docking ports is that they are too sophisticated.  Especially earlier on in the tech tree when you first unlock docking ports.  It's a fairly complex system, because it can lead to thing like robotic arms.  It's sort of like introducing Canadarm2 technology during the Apollo era.

So, have the different docking port capabilities be unlocked as you move up the tech tree.  You'd start off with docking ports as they are now.  Dumb ports that just get drawn towards one another via magnets, and they snap together at whatever alignment they were at when you snapped them.  A bit later on you unlock the ability to give rough rotation.  No finer than 15 degree increments, and only at low speeds.  And we could say that if you stack more than three such pairs of ports together, the rotation doesn't work (limiting the complexity of robotic arms).  Then closer to the end of the tech tree, you unlock the full capability.  Fine rotation, as many dock pairs as you want.

I'm not sure when you'd introduce rotate with "snap to" feature, because I find that to be one of the most useful features (even more useful than fine rotation).  So I wouldn't want it to be too high up the tech tree.  Anyway, it's just me thinking out loud.

Edit:

For reference, Canadarm2 is the real-life insane robotics gizmo they have on the ISS to move things around.  It can detach on either end and do all sorts of fun manipulations:  

 

Edited by PTNLemay
Link to comment
Share on other sites

@peteletroll So doing some testing, I think the problem I am seeing is only the 1st (therefore primary) port to be docked correctly is granted the rotate ability by the mod. secondary ports that are docked are not given the ability. This means you can make multi-dockings work if they are all docked as primary and then strutted together to make a single cohesive unit with standard struts, but not if they are already built as a single unit with 1 main, and 1 or more secondary ports. This explains why i was able to strut my two rotating wings on my vtol together to stabilize them without issue, but not make a lift.

Also a better way to force back to true 0/90/whatever (action groupable?) would be nice i notice with my VTOL the wings never get back quite right, and you cant really right click in flight each port to reset to 0 very easily,

Link to comment
Share on other sites

I've been experimenting with the multidocking myself, and while I'm not sure the issue I'm experiencing is the same as that of others, if it is I don't think the problem lies with the mod.  It's more an issue of the way the game makes the docking happen.  In the following links you can see a basic square structure with a total of 8 ports.  All identical to one another.  I started by connecting them in pairs (using the mod to get the angles perfect), then brought the two together.

https://i.imgur.com/yOVv2I4.png

I bring them together as best I can, and end up with a misalignment of about 7 degrees.  Once again, I use the rotation function at the recent connection point to correct.

https://i.imgur.com/aD30XMd.png

What happens next is that the game will establish a connection before those last two docking ports are properly aligned.  The two lock, thus preventing the rotation from completing.  With the arms at this length, the final misalignment is 0.12 degrees.  The controls to initiate a rotation appear on all the ports, except for that last crooked one.  The only way I can finish correcting the alignment is to undock that crooked one.  Then the connection that's off by 0.12 degrees can fix itself.  But then, the structure is no longer a closed loop.  That last joint has been disconnected and it stays disconnected.  You need to separate two docking ports by a certain distance before the connection can be restablished.  On a (mostly) rigid body like this, the ports can never be separated enough for that to happen.

https://i.imgur.com/ZKSuAqt.png

So, the only way I can see this being solved is either to create a delay that makes is so that the last docking ports to touch don't prematurely establish the connection.  Or remove that minimum separation distance that two ports need in order for the connection to be restablished.

EDIT:
Another way would be to add some sort of telescoping arm at the last connection (which would require another mod,  but there we have it).  This way the arm could secure itself solidly at one point, and extend itself out to close the loop.

Edited by PTNLemay
Link to comment
Share on other sites

A few updates, after @Yargnit and @PTNLemay's insightful observations:

The rotation of same vessel docking joints is solved, I just need a little more testing before release. @Yargnit's lift should work fine (of course you have to be careful  with the speed/step settings of the rotating joints).

@PTNLemay's multi-docking alignment issue is more complex. Basically, any docking or undocking event during rotation is hard to handle. I have some ideas to put to the test, but even if it works, it probably won't be pretty.

Edited by peteletroll
Link to comment
Share on other sites

If you, like me, wish to have rotation on construction ports (so that they're easy to adjust to perfection before welding) but prefer regular ports to be handled by KJR (see fix that makes them play together above) and don't care quite as much about their alignment, here's a patch for you.

// DockRotate is very sweet, but I *only* want it on the construction ports:
// I would rather KJR act on the docking joints.
// So taking it off every other port.

@PART:HAS[@MODULE[ModuleDockingNode],@MODULE[ModuleDockRotate],!MODULE[ModuleWeldablePort]]:FINAL
{
	!MODULE[ModuleDockRotate] {}
}

 

Link to comment
Share on other sites

9 hours ago, peteletroll said:

A few updates, after @Yargnit and @PTNLemay's insightful observations:

The rotation of same vessel docking joints is solved, I just need a little more testing before release. @Yargnit's lift should work fine (of course you have to be careful  with the speed/step settings of the rotating joints).

@PTNLemay's multi-docking alignment issue is more complex. Basically, any docking or undocking event during rotation is hard to handle. I have some ideas to put to the test, but even if it works, it probably won't be pretty.

Sweet, i'll be glad to stress test (aka break) it for you if you'd like ;P I already have plans to make a push/pull rod out of it as well. And the lift was just a test model to lay out the mechanics for a lift for my aircraft carrier. Maybe something like a spiderbot in the future? Who knows

 

I may be read it wrong, but I didn't think @PTNLemay issue had anything to do with undocking during rotation? I was reading it as just the inaccuracies of the mechanisms hitting precise angles. (like even using the reset button I'll often find it off .5-1 degree) And needing a way to more precisely make sure it hits absolute 0,90, whatever.

Edited by Yargnit
Link to comment
Share on other sites

@Yargnit

None of the ports were undocking, not until I undocked it myself to allow the alignment to complete.   The reason I know it was off (aside for the 0.12 degree misalignment and the visably crooked docked ports) was that I couldn't summon the rotation function on those last joints.  The game can tell something is off with that connection point.  I'll start up the game and get more screenshots to show what I mean.

Also, for hypothetical really large structures, that 0.12 degree misalignment could lead to big problems down the road.  

Just to be clear, these are fringe problems that are only likely to pop up when building huge ring stations around asteroids or the like.  And having a pseudo-ring where the last joint is aligned by not actually connected is still LOADs better than how it used to be.  With nearly every dock connected almost right but still not right.  Which in the end compounded to a huge misalignment when you tried to close the ring station.  With this mod, you can guarantee all of the joints are perfect, except for the last one.  Going from 1/10 perfect connections to 9/10 perfect connections is a hell of an improvement.

And the mod is still perfect for "Christmas-tree" structures without loops where you just want all of the station-parts to be aligned so that it's aesthetically pleasing.  I just wanted to get that out there, I don't want it to sound like I'm complaining about a nitpick.


EDIT:
So here's a "real world" example of a ring-station.  I built it entirely in the VAB, so all of the connections started out pretty perfectly.

https://i.imgur.com/i8JFTAb.png

I then separated the right-side arm, and nudged back towards it, to simulate what it would be like to try and build it in pieces.  I missed the screengrab, but interestingly, on the first attempt the top connection was able to use the rotation function.  But the bottom one wasn't.  On the second attempt, neither was able to.

https://i.imgur.com/IqwURVA.png

Like I was saying earlier, I think that what's happening is that the game initiates the connection before things have stopped moving.  Resulting in these wonky connections.  My previous post showed examples where misalignments were evident.  But even here, the game can tell something's off.

Edited by PTNLemay
Link to comment
Share on other sites

I had an observation from earlier this week that you may or may not be aware of.

I had 2 Mk1-2 Command Pods docked nose-to-nose, but flipped 180-degrees from each other. I used the mod to rotate so they lined up with each other, and it worked almost perfectly. The only issue I had was the IVAs did not rotate with the external models. When you use the button that toggles the IVAs on, the command pod that rotated did not have the IVA showing correctly. When switching to the first-person IVA view, looking out the window should have been looking into the window of the other command pod, but was looking at the side that it was facing when originally docked. The pod that didn't rotate would look out the window and see the window on the other one since the external model was fine.

Link to comment
Share on other sites

13 hours ago, peteletroll said:

New release!

@Yargnit, your lift can work now, but you have to fix a joint rotation orientation in action group 2. It took me a while to figure out that the bug wasn't in my code :)

Wow, really? in the video I posted they are all moving identically and I literally grabbed the same craft file, so not sure how that happend... whoopsy. Too many joints to keep track of I guess. Thanks man

 

Just tested it, and it works great. Yeah, I see which one was screwed up now. oopsy 

Edited by Yargnit
Tested
Link to comment
Share on other sites

6 hours ago, Yargnit said:

Too many joints to keep track of I guess.

Yeah, it becomes a puzzle very quickly. By the way, are the "rotate clockwise/rotate counterclockwise" labels useful as they should in designing sophisticated machinery?

Link to comment
Share on other sites

On 3/4/2018 at 12:52 AM, peteletroll said:

Yeah, it becomes a puzzle very quickly. By the way, are the "rotate clockwise/rotate counterclockwise" labels useful as they should in designing sophisticated machinery?

Honestly, I just use it as A/B, if i want two hinges to go in the same direction I set them both to one or the other, and if i need them opposite I pick opposing directions. I'm not even completely sure which perspective it measures the direction of rotation from. It's faster for me to launch the craft and just test the rotation that to figure out which direction is clockwise/counterclockwise. And then once I know the 1st one I just orient the others based off of it as needed.

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