Jump to content

[PART, 1.0.2] Anatid Robotics / MuMech - MechJeb - Autopilot - Historical thread


r4m0n

Recommended Posts

Quite easy :


// First you get the "master" MJ module for a vessel :
MechjebCore mj = vessel.GetMasterMechJeb()

//vessel will be FlightGlobals.activeVessel if you want to control the current vessel.

// Then you get the module you need
MechJebModuleSmartASS sass= mj.GetComputerModules<MechJebModuleSmartASS>();

// and then set the mode you need and engage the sass

sass.mode = Mode.ORBITAL;
sass.target = Target.PROGRADE;
sass.Engage();

Have a look at MechJebModuleSmartASS.cs to see the available mode.

Link to comment
Share on other sites

Yes 99.99% of the time it's only the DLL. Last time an other file was changed it was the new icons for the toolbar and the previous time the "new" pod.

Starwaster : my bad. I had a look and saw nothing strange to. It's crashed on transition to flight mode, which is one of the common time for a memory crash.

Is the pod supposed to have that eyeball thingy? I had a look at it (for the first time ever) the other day but couldn't figure out how to make the eyeball work. Is it broken and it requiring config work?

Link to comment
Share on other sites

The eye should open when you ask MJ to do something (try the sass)

It will look in the direction MJ want to turn the ship. If you don't ask MJ to turn the ship then it should look at you and judge you for crashing many of his peers. Then he might go back to sleep while you may never find rest again.

Link to comment
Share on other sites

Is the pod supposed to have that eyeball thingy? I had a look at it (for the first time ever) the other day but couldn't figure out how to make the eyeball work. Is it broken and it requiring config work?

Just out of curiosity, when did the word "broken" stop meaning "something that does not work and needs repair" and start meaning "something that doesn't do what I expect it to do"?

Link to comment
Share on other sites

I did add this to the GitHub site, but I figured I'd open it up for forum discussion.

Action groups and staging based on user defined parameters such as going above or below an altitude or simply time. User defines which action group or stage and what the trigger is.

Triggers might include: Time(countdown), Time(universal), Altitude(Above/Below/At), Atmospheric Pressure, Orbital Stats, Electricity Level, Fuel Level. Pretty much any value (or percent of one!) that you can show could be a relevant trigger. The more available actions we can control using these triggers opens up a very large list of possibilities.

Specifically, the issue I am trying to solve is staging at a specific altitude in my descent.

Dev routes that may ease transition while allowing people to use this quickly would be simple scripting <trigger><action>. For example <altLessThan:200m><actionGroup:1> or <electricChargeLessThanVal:20><actionGroup6>. This could eventually turn into drop down menus and custom windows/buttons all doing preprogrammed actions allowing people to customize MechJeb for specific vessels or import created functions from other users?

I just see a very large potential for this as a customizable feature that would set MechJeb on a whole new level of functionality.

I am aware there are other mods out there that have accomplished this, but I don't want to add anymore parts to my rockets when I have MechJeb!

Link to comment
Share on other sites

Sarbian,

Dev 232...

I'm setting up a rendezvous from 150 km to 300 km, crew ship to station. Should be somewhere between 75 and 150 m/s for each burn. RAP just tried to do a 900 m/s initial burn.

Near the end of the logfile I find this:

[ERR 20:15:44.657] MechJeb module MechJebModuleRendezvousAutopilot threw an exception in Drive: System.ArgumentException: OrbitExtensions.NextApoapsisTime cannot be called on hyperbolic orbits

at MuMech.OrbitExtensions.NextApoapsisTime (.Orbit o, Double UT) [0x00000] in <filename unknown>:0

at MuMech.MechJebModuleRendezvousAutopilot.Drive (.FlightCtrlState s) [0x00000] in <filename unknown>:0

at MuMech.MechJebCore.Drive (.FlightCtrlState s) [0x00000] in <filename unknown>:0

For reference, I set up the RAP with a 100 m final distance and zero phasing orbits.

I think the 900 m/s value was being taken from the Maneuver Node Editor, because I have been sending ships out to the other planets, and I've been using the editor to set up the escape burns.

Link to comment
Share on other sites

I set up the RAP with a 100 m final distance and zero phasing orbits.

Don't put 0 in the "max # of phasing orbits" field. Some phasing is always necessary to establish the proper timing for the Hohmann intercept. I wouldn't put anything below 5. 5 was the value that was being used internally before I added the new input field in build #231. The point of the field is that if you want to rendezvous with less dV, you can set this to a higher number like 20 or 100. A higher number means you are willing to wait more orbits before the Hohmann transfer burn that establishes the intercept. A low number means you are impatient and makes MJ more likely to first establish an intermediate orbit at a higher or lower altitude to increase the phasing rate.

Edited by The_Duck
Link to comment
Share on other sites

A higher number means you are willing to wait more orbits before the Hohmann transfer burn that establishes the intercept. A low number means you are impatient and makes MJ more likely to first establish an intermediate orbit at a higher or lower altitude to increase the phasing rate.

OK, that makes sense. Always use a value of no fewer than 1 (sorry, spotted the value 5 in your code, so will stay 5 or better), but better to use a higher number to keep dV as low as possible (fine-tuning the transfer).

Thanks!

Follow-up: You're saying a low number of orbits is a likely cause for the RAP to swing out to a much higher phasing orbit (4-step rendezvous) instead of a simple arrival at the target (two-step rendezvous with no phasing required)?

Edited by BARCLONE
Link to comment
Share on other sites

Duck,

I just tried the 233 RAP and it worked beautifully! I set the orbit number to 25, but it was able to accomplish the rendezvous in less than three, and did a two-step! Congratulations, you've taught MechJeb how to dance!

Seriously, it was a very smooth maneuver.

Sarbian,

Those bounding boxes are nice. I just got my first chance to try them out. It's a big help when trying to dock in the shadows, I can see the alignments now.

Big thanks to both of you!

Link to comment
Share on other sites

The eye should open when you ask MJ to do something (try the sass)

It will look in the direction MJ want to turn the ship. If you don't ask MJ to turn the ship then it should look at you and judge you for crashing many of his peers. Then he might go back to sleep while you may never find rest again.

Hey! That was NOT my fault. That could have happened to anyone :(

I never saw snacks explode before either...

Link to comment
Share on other sites

Just wondering if you can add a lock roll option to the ascent stage of mechjeb? Kinda like how you have on docking autopilot, it had been bugging me for a while that my space plans would randomly roll to one side as they flew upward, and also during orbital maneuvers have it to were it is locked into a certain roll also. All a optional check box for those that wish to do it also.

Also I wish to state that the space-plane guidance is working really nice and I've landing quite a few space-planes with it with little trouble. It was also able to clear the highlands ridge some 30-50km from the runway, I skimmed over it once so low that had I parked a rover atop it they would have hit.

Keep up the great work!

Link to comment
Share on other sites

Yes, I'd love to have something like a horizon sensor that allows a "roll to horizon" type attitude adjustment in the options. I do realize that in space, horizon doesn't matter, and several of the modules have the ability to adjust the roll, but I have a bit of OCD, and like my craft to be "upright" if possible.

The landing module is a prime example. It does a great job, but it feels weird to be in a braking maneuver with the cockpit oriented upside down from "normal".

Just wondering if you can add a lock roll option to the ascent stage of mechjeb?
Link to comment
Share on other sites

Sarbian,

Those bounding boxes are nice. I just got my first chance to try them out. It's a big help when trying to dock in the shadows, I can see the alignments now.

Big thanks to both of you!

I built them as a debug tool. If people find them nice I ll change the code so they don't slow down the game as much ( now they are calculated for each frame )

Damaske : I'll add it sooner or later. I want to work on the ascent AP since people using FAR and/or RSS have a need for different ascent profiles.

I m really interested as how you used the space plane AP to land. I never managed to do it properly ^^

Edited by sarbian
Link to comment
Share on other sites

The bounding box ? When I reworked the Docking AP I added some logic to see how big the ship and the target are, so the ship could move from one side to an other of the target without colliding with it by keeping a "safe distance". The first code did not compute that size correctly ( well it did, but it did but I got lazy and used it in a wrong way ). When I worked on fixing it I wanted to check if the size were right so I added a display of the computed size, and added an option so people could report wrong size with a screenshot.

The next step would be to be more intelligent with the "safe distance" and compute it with the relative positions of the ship and target "cube". I looked into the literature to do that and it's not as easy as it sounds so I'm not sure if I'll go there.

What I could add is cubes that display the docking port only, as a HUD docking help.

Link to comment
Share on other sites

Sarbian,

I use the landing autopilot to land at the launchpad, I've also used land at target and place it just before KSP. Allow the craft to deorbit, aborting it before it enters Kerban. Then I enable the target guidance and fly it manually some till I get over the large mountains, In the past I've had troubles with the plan trying to tunnel though em. Once clear of the mountains I enable the spaceplane autoland at 5% and it take over and lands. After touchdown I abort, enable SAS and brakes to stop. I've also used it a few times as an abort landing on the island after breaking engines off my plane on takeoff. It works for me in both directions over the land on heading 90, and then again over the sea at heading um 270 I think it was.

I've not had luck with it 100% land from space as it drops too low to fast and tries to tunnel though the highland mountain range, or lose glide power and crash waaaaay tooo soon. Its not perfect from orbit, but I've found that around 10,000 meters up and around 100km to 50km from the runway it works best. Too close and too high it will overshoot or try to land at an extreme angle that it just craters into the runway.

If you like I can pay more attention to how I use it to land and write it up better than the above.

Link to comment
Share on other sites

Quite easy :

Have a look at MechJebModuleSmartASS.cs to see the available mode.

Thank you very much for your quick and helpful reply. More people on this forum should be like you!

Link to comment
Share on other sites

Does anyone know what happened to AutoM8?

It's one of those core things that I needed for my sim... and I have been patiently waiting. I just want to be able to remotely link to the MJ modules you see.

Link to comment
Share on other sites

Damaske : I'll add it sooner or later. I want to work on the ascent AP since people using FAR and/or RSS have a need for different ascent profiles.

Totally wasn't going to ask/bug you about it since, well, look at thread. But do want. ;)

Link to comment
Share on other sites

MJ is too accurate. I'm getting too lazy to land all my munbase ships in place. So MJ gets to do it for me while I make coffee or raid the fridge etc. If I tell MJ to "land at target" it gets an attitude problem and says " sure I'll land ON that target while you're not looking". I've come back to the PC to find some pretty funny MJ creations involving several conjoined ships or double/triple decker landers. Now i'm all for accuracy, but is MJ just taking the **** or what? Now to get all my ships uncoupled and a SAFE distance apart.

Link to comment
Share on other sites

MJ is too accurate. I'm getting too lazy to land all my munbase ships in place. So MJ gets to do it for me while I make coffee or raid the fridge etc. If I tell MJ to "land at target" it gets an attitude problem and says " sure I'll land ON that target while you're not looking". I've come back to the PC to find some pretty funny MJ creations involving several conjoined ships or double/triple decker landers. Now i'm all for accuracy, but is MJ just taking the **** or what? Now to get all my ships uncoupled and a SAFE distance apart.

Speaking for those of us who don't have time to play KSP much, I love MJ. I don't mind failing but when you get less than an hour a day to play MJ REALLY helps.

Link to comment
Share on other sites

MJ is too accurate.

At times it's also been rather inaccurate, missing targets by up to a couple of kilometers. When it's deciding to land on a dime from high orbit, simply do a manual edit of one number in the coordinates to slightly miss the target.

Would be nice to have a "landing doughnut" option where MJ is commanded to land no closer than X but no farther than Y from the target, or at least a minimum keep away distance.

Another option is to first land a beacon rover with some OKTO2 pods on docking ports. Don't need anything but the pods, they can be targeted even when out of power. Roll over to where you want to land the next ship, drop a pod then roll off to a safe distance.

I mounted a couple of them under one of the rovers for my Eve mission. It will land first then drop the pods for the other rover and manned lander to set down on.

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
×
×
  • Create New...