Jump to content

BaryonicMan

Members
  • Posts

    15
  • Joined

  • Last visited

Posts posted by BaryonicMan

  1. Here is the video where I explain how I automatically land a rocket stage with kRPC (still 0.3.11 though. Not 0.3.9 as I say in the video.). I go through the whole code I've written so that could either be interesting for you, or extremely boring. In the second case, go to 22:30 to see the glorious splashdown.

    Isn't it wonderful how you find your own stupid bugs while describing how your code works? :)

    Comments and ideas are welcome.

     

  2. I've done it: I've managed to land the first stage of a rocket automatically in KSP with Python. The program launches the rocket, releases the second stage and quickly switches to the second stage to start the engine. Then the program quickly switches back to the first stage, does a reentry burn. At 20 km it deploys the air brakes and later does a "near-suicide burn" before it splashes down.

    Python code:

    https://github.com/Marcel-Jan/KSP-kRPC-Python/blob/master/kRPC_falkon5_git_01.py

    .craft file:

    https://github.com/Marcel-Jan/KSP-kRPC-Python/blob/master/Falkon-5A.craft

    I'm going to do a Youtube video where I explain how the code works later on.

     

  3. I was laughing out loud when it went of as a boat. Never occurred to me in KSP before.

    9 hours ago, artwhaley said:

    I don't know if it helps with your approach at all, but in the library at https://github.com/krpc/krpc-library/tree/master/Art_Whaleys_KRPC_Demos my landing script has a python port of the mechjeb suicide burn algorithm (with a couple of changes.  I think I do a better job of clearing terrain obstacles because I test them along the descent path, not just at the projected landing site...  and I make my calculations and fly my landings assuming 95% of max thrust, but with the loop testing if we're ever over speed and boosting to full power when necessary, for an extra safety factor.)   It works pretty reliably for automated landings on the mun, but that's the only test case I'd done with it.   It doesn't consider atmospheres at all, but still could be useful to you in that final landing burn phase.

    I have come across your github library yesterday, but I wanted to try to program this myself first. I'll have a look at it now. Your code looks a lot neater than mine :)

    9 hours ago, artwhaley said:

    It looks like you're chasing the retrograde bug there at the end, and an over correction takes you too far from vertical?   Perhaps a final phase is in order where if the horizontal speed is less than some threshhold, it simply locks vertical instead of trying to chase down those last few meters per second and landing on it's side?

    Good idea on passing spacecenter.ut to the pid instead of just time.now() which IS totally what I've been using in my PID loops!  I'll look at rewriting it this way so it adjusts for lag!  

    Yes, I've seen the same behaviour in previous attempts. I might turn off retrograde and tell it just to pitch up 0% for the last meters.

    There's still a lot to be done, before I get my rockets nicely land on that island east of the KSC. But step by step I get further.

     

  4. Thanks @djungelorm for answering my previous questions. I indeed wanted to deploy landing legs and thanks to your help this now works. I also got the air brakes working. I'm getting closer to a crude self landing rocket.

    I have to ask one more question, because I just don't get reference frames. I want to get the speed of my rocket stage and I get zero's on vessel.flight().speed, velocity and such. I understand I need to use a reference frame, but I'm not sure how to apply that. I've tried this:

    print str(vessel.flight().speed(Vessel.surface_reference_frame))

    and this:

    vessel.flight().surface_reference_frame = True

    print str(vessel.flight().speed)

    But that all doesn't work or gives errors.

    I think I need a hint to go further.

  5. I'm currently working on a self landing first stage, programmed with Python, and one of the many hurdles is how to get the landing gear and the airbreaks deployed.

    For the landing gear I thought this would do it, but I only hear a click and then nothing happens.

    for landing_leg in vessel.parts.legs:
        landing_leg.deployed=True

     

    I've put the airbreaks on the first action key, but I can't seem to find how to activate them.

    As you can see, at this stage there is lots of programming to do :0.0:

    I'll place the Python code online as soon as I get this working. The idea is to land automatically on one of the islands east of the KSC.

  6. CzzDdh-XUAAxHGp.jpg:large

    I'm giving my oldest nephew KSP for christmas this year, but what to put in the giftwrap? A letter "here is your Steam code"? That's no fun at all.

    So I wanted to buy one of those Kerbal plushies, but could not find them. So at last I decided to create my first plushie ever: it's a screaming Kerbal head. It's screaming, because he thinks of the many crashes ahead.

  7. I've done it! I managed to get to orbit with kRPC and Python.

    What a lot of fun this is. The rocket completely launches automated and on screen I can follow how my apoapsis and periapsis are doing in the critical phases.

    It isn't the most efficient launch I've ever done, but step by step it's getting better.

    I've placed the Python code and the craft file online if you want to try it or tinker with it.

     

  8. Did it look like this?

    This is the result I got on a PC with Windows 7 64-bit.

    Intel i7

    8GB RAM

    NVIDIA GeForce GTS 450

    1920 X 1080 X 60Hz and other resolutions (tried different resolutions: the result is the same everytime.)

    (On a Windows 7.1 64-bit, two addons: Kerbal Alarm Clock 3.2.2.0 and Lazor Docking Camera (last version))

    After removing of addons: same result.

    Reinstalling KSP 1.0 solved this problem for me.

  9. Did it look like this?

    This is the result I got on a PC with Windows 7 64-bit. Tried different resolutions: the result is the same everytime.

    (On a Windows 7.1 64-bit, two addons: Kerbal Alarm Clock 3.2.2.0 and Lazor Docking Camera (last version))

    - - - Updated - - -

    Tried it once more, without addons. Same result. This should be in unmodded installs then actually.

×
×
  • Create New...