Rudolf Meier

[WIP] Infernal Robotics - Next

Recommended Posts

Mj82gWX.png

 

We all use and love infernal robotics. It offers great possibilities and adds a very important part of space exploration to the game: robotics. But we all know that there are also limitations and problems with the project. The idea of this project is to solve all those problems and take it to a new level.

Main points of the project:

  • major parts of the code will be re-written, made more robust, more efficient and easier to understand
  • correct handling of reversals of servos
  • enabling collisions of parts connected with servos
  • minor bugfixes in gui
  • adding ik for robotic arms (maybe in an other project)
  • ...

One thing that will not work is backwards compatibility. The new version will offer almost the same functionality and almost the same interfaces. But it is already clear, that it cannot offer exactly the same. This is also why a parallel installation of the new version with the old one is planed.

If you do have comments on this, ideas, things you think someone should look into, then please write it in this thread.

This project needed some modifications in KJR (Kerbal Joint Reinforcement). There is also a KJR version included in the downloads. This version has a lot of modifications in it to support all kind of moving parts.

 

The latest beta (almost rc) versions can be found here

https://github.com/meirumeiru/InfernalRobotics/releases

https://github.com/meirumeiru/InfernalRobotics   (source code)

 

It is recommended to use the improved version of KJR if you use KJR. This version is improved in many ways, not only for Infernal Robotics. You should profit from it also if you don't use Infernal Robotics.

https://github.com/meirumeiru/Kerbal-Joint-Reinforcement/releases

https://github.com/meirumeiru/Kerbal-Joint-Reinforcement   (source code)

 

the Infernal Robotics Sequencer can be found here

https://github.com/meirumeiru/IR-Sequencer/releases

https://github.com/meirumeiru/IR-Sequencer   (source code)

 

the Infernal Robotics Active Struts (a new project using the old models) can be found here

https://github.com/meirumeiru/Active-Struts/releases

https://github.com/meirumeiru/Active-Struts   (source code)

 

 

This project wouldn't have been possible without the support and help of @ZodiusInfuser

 

Meiru

 

Edited by Rudolf Meier
  • Like 33

Share this post


Link to post
Share on other sites

Ball joints please. Has two settings, rotation and pitch.

Stronger joints. I assume they just use Unity's joints, so not sure how much wiggle room there is there.

Seconded on reverse servos and collisions.

I'm down to help in any way possible, got the IK stuff going already.

 

Edited by VR_Dev
  • Like 6

Share this post


Link to post
Share on other sites
3 hours ago, VR_Dev said:

Ball joints please. Has two settings, rotation and pitch.

Stronger joints. I assume they just use Unity's joints, so not sure how much wiggle room there is there.

Seconded on reverse servos and collisions.

I'm down to help in any way possible, got the IK stuff going already.

Thanks for the input...

I did think on ball joints too. From a programming standpoint it's possible... I would have to think about it a bit though. Because unity joints do have 1 very flexible axis and 2 less flexible ones. And we would need models for it. I'm not the model maker and I'd need help from someone for this. But we should continue to talk about that. Do you have good exmaples from real life joints?

What do you mean with stronger joints? Are you talking about the fact that joints start to separate when there's too much load on them (they are not breaking, but you can see a huge gap between the parts)? That's something that should be solved, because I'm already using the unity joints differently than in the original IR.

What's something I'm still experimenting with is the spring forces and torque. We could make some experiments when the first beta is out.

I did program an IK solution for SSRMS like robotic arms (2 in fact, the easier one works, but is not very accurate, the optimized one is implemented, but not tested). But I'd likie to compare what you have with my solution. Maybe we can learn from each other.

 

  • Like 1

Share this post


Link to post
Share on other sites
4 hours ago, Rudolf Meier said:

Thanks for the input...

I did think on ball joints too. From a programming standpoint it's possible... I would have to think about it a bit though. Because unity joints do have 1 very flexible axis and 2 less flexible ones. And we would need models for it. I'm not the model maker and I'd need help from someone for this. But we should continue to talk about that. Do you have good exmaples from real life joints?

What do you mean with stronger joints? Are you talking about the fact that joints start to separate when there's too much load on them (they are not breaking, but you can see a huge gap between the parts)? That's something that should be solved, because I'm already using the unity joints differently than in the original IR.

What's something I'm still experimenting with is the spring forces and torque. We could make some experiments when the first beta is out.

I did program an IK solution for SSRMS like robotic arms (2 in fact, the easier one works, but is not very accurate, the optimized one is implemented, but not tested). But I'd likie to compare what you have with my solution. Maybe we can learn from each other.

 

I know Unity and c#, and even how to rig models, but I'm no modeler either. So its a dead end there. I assume you've reached out to @ZodiusInfuser already?

I tried to rig up what my idea for a ball joint would be. Essentially we just need a pivatron with a rotating base, as condensed as possible. 

Here are a couple ideas I found. Usually ball joints are not servos, but hey, thats what ksp is for.

This is an interesting idea.

e3266128263b4e56bb9c1424bd3d0197--robot-

Your standard ball joint. Think of how your shoulder works.

71rMYL1xczL._SL1341_.jpg

 

And that's exactly what I mean when I talk about joint strength. If you look at the feet in my video, the blue ball is where the foot is according to the servo angles. The yellow circle you can often see is where the foot actually is. You obviously already understand this problem, and know how much worse it gets under heavy load.

  • Like 2

Share this post


Link to post
Share on other sites
9 hours ago, VR_Dev said:

This is an interesting idea.

e3266128263b4e56bb9c1424bd3d0197--robot-

If you want this mechanism then the two uncontrolled pivotron variants placed back-to-back would achieve that, and I'm sure could be adapted to a single part if the functionality exists.

Share this post


Link to post
Share on other sites
3 hours ago, ZodiusInfuser said:

If you want this mechanism then the two uncontrolled pivotron variants placed back-to-back would achieve that, and I'm sure could be adapted to a single part if the functionality exists.

Yeah it would be nice if they were controlled. I guess I'm just interested in multi axis controllable servos for more compact designs. Anything that requires new models will be the most challenging however. I'm down to prioritize internal improvements. I've been meaning to take a look at the IR code, maybe I'll do that this weekend.

Share this post


Link to post
Share on other sites
30 minutes ago, VR_Dev said:

Yeah it would be nice if they were controlled. I guess I'm just interested in multi axis controllable servos for more compact designs. Anything that requires new models will be the most challenging however. I'm down to prioritize internal improvements. I've been meaning to take a look at the IR code, maybe I'll do that this weekend.

I'm planing to upload the new code this weekend (if I can fix the last obvious bugs). It is almost completely new... just to mention that (I'm working on this for many weeks now).

The idea with the uncontrolled joints is interesting. I'll make some tests... maybe it's an option to build it without the need of new models. On the other side I'm asking myself, if something like a ball-joint does have to be one single joint or if it's ok if it's build from two separate joints... it would be easier for IK, sure... but there are other solutions for that.

 

Edited by Rudolf Meier

Share this post


Link to post
Share on other sites
23 hours ago, Rudolf Meier said:

enabling collisions of parts connected with servos

Small request, if possible, while you already rewriting large piece of IR code, is i tpossible to expose jointSpring and jointDamping values to right click menu of IR part ? Reasons for that is in discussion in IR Model rework thread, jsut as reminder if you missed it:

You might also benefit from other WIP mod from @whale_2, as described in this thread:

Can't help you much more than posting links to other mods that share similar ideas.

  • Like 1

Share this post


Link to post
Share on other sites
48 minutes ago, kcs123 said:

Small request, if possible, while you already rewriting large piece of IR code, is i tpossible to expose jointSpring and jointDamping values to right click menu of IR part ? Reasons for that is in discussion in IR Model rework thread, jsut as reminder if you missed it:

Sure... those two values are currently still under investigation (if needed and how they should be set). In case they become important, I will for sure add them to this menu. The behaviour of the joints was sometimes very strange when those values are set wrong. In combination with the internal motor-timing that is used to control the speed I sometimes had massive problems. I do have 2 ideas on how to solve that... but not yet decided which one is the better. Maybe we can figure this out together, when the beta is out (I could implement both ways and testers chan choose the one they like better?).

(the main problem is, that we do have 2 types of movements... the "move to" (e.g. move to 56°) and the "move" (e.g. move right)... if you want to control the acceleration and the speed plus the slowdown in front of a limit (end point)... then it's easier to do this with you own code... but in this case you cannot use the spring/damping values... or they are at least difficult to set)

 

Edited by Rudolf Meier
  • Like 1

Share this post


Link to post
Share on other sites

Wow, that's sounds really exciting! IR is fantastic, but there's really much space for improvement.

18 hours ago, Rudolf Meier said:

I'm already using the unity joints differently than in the original IR.

Can you please elaborate? The fact the joints behave like rubber also bugs me - they should not do so and I tried to tweak joint parameters to no avail.

 

23 hours ago, Rudolf Meier said:

enabling collisions of parts connected with servos

That's something I'm already doing, however I want to warn that enabling collisions en masse could be CPU-costly and not very convenient. I thought it would be more convenient if there would be a special part like placeholder for internal collisions.

Share this post


Link to post
Share on other sites
19 minutes ago, whale_2 said:

Wow, that's sounds really exciting! IR is fantastic, but there's really much space for improvement.

Can you please elaborate? The fact the joints behave like rubber also bugs me - they should not do so and I tried to tweak joint parameters to no avail.

 

That's something I'm already doing, however I want to warn that enabling collisions en masse could be CPU-costly and not very convenient. I thought it would be more convenient if there would be a special part like placeholder for internal collisions.

Joints in unity do have 3 axis. You can set them by defining the axis and secondaryaxis. Along those axis you can have a translation (along all 3) and you can have rotations around them. But only for 1 axis (x) you can set the whole set of rotational settings. The other 2 are a little bit restricted. The old code did set the rotation/translation on all axis to "free" or "possible". The new code does set up the configuration differently and does only set 1 of those 6 things to "free". This is more the way it's intended in unity.

The collisions are activated only where needed. The idea is, that you have the same amount of active collision-pairs, that you also have when 2 ships are flying next to each other (while dockign for example). But sure, we have to test it for large configurations.

 

Share this post


Link to post
Share on other sites
1 hour ago, Rudolf Meier said:

The behaviour of the joints was sometimes very strange when those values are set wrong. In combination with the internal motor-timing that is used to control the speed I sometimes had massive problems. I do have 2 ideas on how to solve that... but not yet decided which one is the better. Maybe we can figure this out together, when the beta is out (I could implement both ways and testers chan choose the one they like better?).

Yep, I understand that there will be always some kind of game/engine limits. Having those on motorized parts might still be impossible/hard to achieve. However, I already experiment with free rotating parts where is no big issue. Except that I need to change values in config files to adjust it for craft that I currently build. Not very convinient for full public release of mod.

Maybe some kind of tweakable module in part config file ? To be able to choose on what part it can be enabled and on what part not. Free rotating parts would be safe to have such option, with default values of zero, for both values, like it is now in part config file, but optional to have in game menu slider to experimet with. After some beta testing, limits for those can be suggested.

1 hour ago, Rudolf Meier said:

The collisions are activated only where needed.

Pretty much this. I already have two possible scenarios. In one where collisions is not wanted, for example in creating aircraft with variable sweep wings, where you clip extendatrons or rotatrons/hinges within wing and hull parts. In other scenario, you may want to restrict movement of othewise free moving parts, without using motors of some kind. Being able to deceide in game should some part is allowed to collide or not and should it collide with only specific other part of craft will be nice to have.

Share this post


Link to post
Share on other sites

One solution for the wobbliness problem would be to allow multiple servos in one part. So a whole arm would be one part that holds a kinematic chain with several elements. Each degree of freedom in that chain is governed by a servo module. I think Sirkut (the creator of IR) had an unfinished prototype for this. I only remember a screenshot, at a time when we did the last code overhaul and he was not very active anymore.

Roverdude's Konstruction pieces are also quite close to this, just with a simpler interface and without the ability to move attached parts.

Since this would need quite a reorganisation of the code (separating the servo from the kinematics-logic), it might fit here.

Share this post


Link to post
Share on other sites
3 hours ago, kcs123 said:

Pretty much this. I already have two possible scenarios. In one where collisions is not wanted, for example in creating aircraft with variable sweep wings, where you clip extendatrons or rotatrons/hinges within wing and hull parts. In other scenario, you may want to restrict movement of othewise free moving parts, without using motors of some kind. Being able to deceide in game should some part is allowed to collide or not and should it collide with only specific other part of craft will be nice to have.

Ok, that's something I didn't think about (e.g. F-14 wings), but you're right. Maybe there should be a possibility to disable the 'collision re-enabling' for some servos. My initial goal was always to build a Canadarm-2 and so all my thoughts come from this example. In this case you want the collisions (e.g. when you're moving a space station part towards a docking port... then you want it to collide and dock with this docking port and not move through it).

 

Share this post


Link to post
Share on other sites

Hey, looking forward to seeing what you have. Once the code is out I'll take a look and maybe help make some parts (i've done the first ones before ZodiusInfuser came along and did the Reworks).

 

I have certainly been inactive for quite some time but I'm very interested in seeing what you accomplished!

  • Like 5

Share this post


Link to post
Share on other sites

A small question (Sorry if its already been answered). If I were to delete the original infernal robotics. Then install this one (When it is released) Will my craft that had the old IR parts still work. As I am liking the development of this mod, but also want to still use my craft. ^^ Edit: I'm guessing that's the backwards compatibility post?

Edited by Sebastiaz

Share this post


Link to post
Share on other sites

wouha!!! new updates for IR!?! you are my hero! thanks x 10000000000!!!!:D 

Share this post


Link to post
Share on other sites
5 hours ago, Sebastiaz said:

A small question (Sorry if its already been answered). If I were to delete the original infernal robotics. Then install this one (When it is released) Will my craft that had the old IR parts still work. As I am liking the development of this mod, but also want to still use my craft. ^^ Edit: I'm guessing that's the backwards compatibility post?

Unfortunatelly not. The changes are too big. At least the way it is built now. But you can install both mods side-by-side.

I'm investigating a way to either convert the save in the game or with a tool (outside the game). But because of the modifications on how the internal joint axis are set, I don't know if that's easily possible.

Maybe it's possible to convert joints when they are in the default position... I will try that as soon as possible.

Edited by Rudolf Meier

Share this post


Link to post
Share on other sites
5 hours ago, Rudolf Meier said:

Unfortunatelly not. The changes are too big. At least the way it is built now. But you can install both mods side-by-side.

I'm investigating a way to either convert the save in the game or with a tool (outside the game). But because of the modifications on how the internal joint axis are set, I don't know if that's easily possible.

Maybe it's possible to convert joints when they are in the default position... I will try that as soon as possible.

Ah okay. Thanks for the help!

Share this post


Link to post
Share on other sites

here it is... a very early alpha version can be found here

http://meiru.square7.ch/reg554ui9wert/GameData131.zip

http://meiru.square7.ch/reg554ui9wert/GameData122.zip

ZodiusInfuser helped to find bugs in the file structures and made an early review... thanks for that

 

it should be possible to install it side-by-side with the current IR... but at your own risk

in the next days I will add the missing functionality to it and I will upload the source code to github

 

Edited by Rudolf Meier
  • Like 2

Share this post


Link to post
Share on other sites

Well would you look at that. Just two weeks ago I was so bummed this configuration wouldnt work with the old servos. Dream come true. Thanks man.

Works in combo with the old IR, just let it overwrite the files.

 

Edited by VR_Dev
  • Like 2

Share this post


Link to post
Share on other sites
On ‎15‎.‎02‎.‎2018 at 5:51 PM, kcs123 said:

Small request, if possible, while you already rewriting large piece of IR code, is i tpossible to expose jointSpring and jointDamping values to right click menu of IR part ? Reasons for that is in discussion in IR Model rework thread, jsut as reminder if you missed it:

I found out, that we cannot use limits... that's why we cannot use jointSpring and jointDamping. This is because of the fact that unity doesn't allow values larger than 177° to set a limit and when a joint is loaded in an already turned position you might have to set them to much larger values (e.g. -2 and 350) ... so... I'd have to find other solutions for that.

My question here is (to all): what should a "spring" and "damping" value do on a joint? any ideas what we want here? only on uncontrolled joints?

 

Share this post


Link to post
Share on other sites
1 minute ago, Rudolf Meier said:

I found out, that we cannot use limits... that's why we cannot use jointSpring and jointDamping. This is because of the fact that unity doesn't allow values larger than 177° to set a limit and when a joint is loaded in an already turned position you might have to set them to much larger values (e.g. -2 and 350) ... so... I'd have to find other solutions for that.

My question here is (to all): what should a "spring" and "damping" value do on a joint? any ideas what we want here? only on uncontrolled joints?

 

Add to the strength of the joint, the rigidness? ^^

Share this post


Link to post
Share on other sites
35 minutes ago, Rudolf Meier said:

My question here is (to all): what should a "spring" and "damping" value do on a joint? any ideas what we want here? only on uncontrolled joints?

Those values in original IR control the internal spring of the joint. By default we only ever used values that meant the spring was at it's extreme (so the servo always matched its target) or at its minimum (so it became uncontrolled). Members did do tested thought of other values and it made things like shock absorbers possible. One idea kcs123 and I discussed was variable elastic actuators, which are special servos IRL that can dynamically adjust their stiffness, hence his suggestion of having the spring values exposed in the VAB (either for all parts or a specific subset)

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now