Jump to content

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


r4m0n

Recommended Posts

Seriously. Super easy to do. You don't need to remove anything from your ship.

Phase 1:

Open up the cfg of the part you want to edit using Notepad or some other text editor. Scroll to the bottom, where you see things similar to:

Now paste that at the end. Grats, you just gave that part MechJeb 2.0 functionality.

Phase 2: If you also want to remove earlier versions, go to the top of the cfg and look for the line that says

or

and change it to

The AR202 has a different line, iirc, but that's an easy fix. Just delete the old AR202 folder and install the new one.

You should only do phase 2 to things that had MuMechJeb etc in that line, like command pods and the radial MechJeb parts. I don't know what all that line does, but I'm fairly certain it could do some wonky things if you just went around throwing it into engines and things like that. Depending on how many parts you want to add it to, this can take as little as 30 seconds, doesn't require changing any of your designs, and lets you add MechJeb to any part on any ship you've already launched.

I've been fooling around with this, and every time I try it, my mechjeb_settings_global.cfg file gets corrupted and a bunch of the windows don't show up in the main list, such as the vehicle info in the VAB, delta V stats, etc. So, what's the trick? I've tried several ways to change the cfg file, but since there isn't much to change, there's not much else I can try. This isn't the first time I've fooled around in the configs, so I know a bit what I'm doing. Mind posting a config that works so I can compare?

Link to comment
Share on other sites

So I just found the mod MechJeb Command Pods & Probes although I had to go into the part.cfg files and integrate the changes manually into my parts because of another mod is already using the command pods. But something I noticed while I was doing so, is that the only change it seemed to make to the parts was changing the general parameter setting called "module" from "CommandPod" to "MuMechJebPod" and well, I was wondering if this can just be done normally or if I need that mod in order to actually make the command pods work as MechJeb units? The reason I'm curious about this is because the mod has no dll's with it, so I can only assume MechJeb has this functionality built in already?

EDIT: So after some reading and some testing I found out that the mod doesn't actually work with MechJeb 2.0.7, but also along the way found out that by leaving the module as "CommandPod" and adding this to the bottom of the part.cfg for the command pods I can activate MechJeb with the pods.

MODULE
{
name = MechJebCore
}

I would assume this should work with any part.

Edited by CoriW
Link to comment
Share on other sites

PLEASE, can the closest approach in rendezvous be made user defined or at least make it 80-100m away from the target ship/station...

I just blew up my latest station for the 3rd time cause rendezvous is causing my ship to collide with the bits of station I have already put up into orbit.

The way rendezvous is now would be great for 2 ships docking with each other, but for Space Stations it is a real pain in the butt more than anything else. (as we all know, most stations are NOT small :P

Link to comment
Share on other sites

I've been fooling around with this, and every time I try it, my mechjeb_settings_global.cfg file gets corrupted and a bunch of the windows don't show up in the main list, such as the vehicle info in the VAB, delta V stats, etc. So, what's the trick? I've tried several ways to change the cfg file, but since there isn't much to change, there's not much else I can try. This isn't the first time I've fooled around in the configs, so I know a bit what I'm doing. Mind posting a config that works so I can compare?

I have several mods installed, but I'd like to post this particular install's cfg because it shows more of the formatting involved. I'll bold the only lines you should edit.

// this is a sample config file, for determining a good file format for defining part parameters

// comment line - ignored by cfg parser

// empty lines, or lines without a '=' sign are also ignored

// all other lines are split at the '=' sign, and the left operand is used to know what parameter we are setting

// diferent parameters require data in different formats (see docs), and each module has it's own parameters (again, see docs)

// each assignment must be in a single line. Lines without assignments will be ignored. (You CAN turn on word wrap, though)

// each keyword here relates to an existing variable in the assigned module. If the keyword isn't found, it is ignored.

// conversely, if a keyword is left unassigned (as in not in the file), it will be initialized with it's default value

// This is done automatically, so any public variable defined in the loaded module can be accessed this way (provided it's value can be parsed)

// --- general parameters ---

name = mk1pod

module = CommandPod

author = NovaSilisko

// --- asset parameters ---

mesh = model.mu

scale = 1

rescaleFactor = 1.0

// --- node definitions ---

// definition format is Position X, Position Y, Position Z, Up X, Up Y, Up Z

node_stack_bottom = 0.0, -0.4050379, 0.0, 0.0, 1.0, 0.0, 1

node_stack_top = 0.0, 0.6423756, 0.0, 0.0, 1.0, 0.0, 0

// --- editor parameters ---

cost = 600

category = Pods

subcategory = 0

title = Command Pod Mk1

manufacturer = Kerlington Model Rockets and Paper Products Inc.

description = Originally built as a placeholder for a demonstration mock-up of a rocket, the Mk1 Command Pod was heralded as a far safer and more reliable option than its predecessors by rocket scientists throughout the world. It is now commonly seen in active service.

// attachment rules: stack, srfAttach, allowStack, allowSrfAttach, allowCollision

attachRules = 1,0,1,1,0

// --- standard part parameters ---

mass = 0.8

dragModelType = default

maximum_drag = 0.2

minimum_drag = 0.15

angularDrag = 2

crashTolerance = 14

maxTemp = 3400

// --- pod/rcs parameters ---

rotPower = 5

linPower = 1

Kp = 1.0

Kd = 1.0

// --- tweakables (coming soon...) ---

vesselType = Ship

// --- internal setup ---

CrewCapacity = 1

INTERNAL

{

name = mk1PodCockpit

}

MODULE

{

name = ModuleCommand

minimumCrew = 1

RESOURCE

{

name = ElectricCharge

rate = 0.01388889

}

}

RESOURCE

{

name = MonoPropellant

amount = 20

maxAmount = 20

}

RESOURCE

{

name = ElectricCharge

amount = 50

maxAmount = 50

}

MODULE

{

name = protractorModule

}

MODULE

{

name = TacFuelBalancer

}

MODULE

{

name = MechJebCore

}

// ----- DO NOT EDIT BELOW THIS POINT ------

That's my Mark 1 pod's cfg file. I wouldn't recommend copying the whole thing, as several of the other values have been changed. The bold bits are what impact MechJeb. The first bolded line is what earlier versions used to access MechJeb, so changing that back to the stock CommandPod setting removes the earlier versions. The second bolded section enables MechJeb 2. Make sure the spacing is the same. I'm not sure if that really matters, but since my modding skills are at the most rudimentary level, it seemed like a good idea to not experiment too much.

Aight, found a stock install. This is the same cfg, stock, with mechjeb 2 enabled. I think. I haven't actually run it. Should work just fine, but if it doesn't, you're having problems that are beyond me.

// this is a sample config file, for determining a good file format for defining part parameters

// comment line - ignored by cfg parser

// empty lines, or lines without a '=' sign are also ignored

// all other lines are split at the '=' sign, and the left operand is used to know what parameter we are setting

// diferent parameters require data in different formats (see docs), and each module has it's own parameters (again, see docs)

// each assignment must be in a single line. Lines without assignments will be ignored. (You CAN turn on word wrap, though)

// each keyword here relates to an existing variable in the assigned module. If the keyword isn't found, it is ignored.

// conversely, if a keyword is left unassigned (as in not in the file), it will be initialized with it's default value

// This is done automatically, so any public variable defined in the loaded module can be accessed this way (provided it's value can be parsed)

// --- general parameters ---

name = mk1pod

module = CommandPod

author = NovaSilisko

// --- asset parameters ---

mesh = model.mu

scale = 1

rescaleFactor = 1

// --- node definitions ---

// definition format is Position X, Position Y, Position Z, Up X, Up Y, Up Z

node_stack_bottom = 0.0, -0.4050379, 0.0, 0.0, 1.0, 0.0, 1

node_stack_top = 0.0, 0.6423756, 0.0, 0.0, 1.0, 0.0, 0

// --- editor parameters ---

cost = 600

category = Pods

subcategory = 0

title = Command Pod Mk1

manufacturer = Kerlington Model Rockets and Paper Products Inc.

description = Originally built as a placeholder for a demonstration mock-up of a rocket, the Mk1 Command Pod was heralded as a far safer and more reliable option than its predecessors by rocket scientists throughout the world. It is now commonly seen in active service.

// attachment rules: stack, srfAttach, allowStack, allowSrfAttach, allowCollision

attachRules = 1,0,1,1,0

// --- standard part parameters ---

mass = 0.8

dragModelType = default

maximum_drag = 0.2

minimum_drag = 0.15

angularDrag = 2

crashTolerance = 14

maxTemp = 3400

// --- pod/rcs parameters ---

rotPower = 5

linPower = 1

Kp = 1.0

Kd = 1.0

// --- tweakables (coming soon...) ---

vesselType = Ship

// --- internal setup ---

CrewCapacity = 1

INTERNAL

{

name = mk1PodCockpit

}

MODULE

{

name = ModuleCommand

minimumCrew = 1

}

RESOURCE

{

name = ElectricCharge

amount = 50

maxAmount = 50

}

MODULE

{

name = MechJebCore

}

// ----- DO NOT EDIT BELOW THIS POINT ------

And sorry for the loooong post, but spoiler tags aren't enabled.

Edited by loppnessmonsta
Link to comment
Share on other sites

PLEASE, can the closest approach in rendezvous be made user defined or at least make it 80-100m away from the target ship/station...

I just blew up my latest station for the 3rd time cause rendezvous is causing my ship to collide with the bits of station I have already put up into orbit.

The way rendezvous is now would be great for 2 ships docking with each other, but for Space Stations it is a real pain in the butt more than anything else. (as we all know, most stations are NOT small :P

Is it that hard to press X and disable autopilot before you crash it? Because you dont need to wait untill that operation is completed. when you see you are 150m away just disable it and and activate docking autopilot if you need one.

Link to comment
Share on other sites

I have several mods installed, but I'd like to post this particular install's cfg because it shows more of the formatting involved. I'll bold the only lines you should edit.

That's my Mark 1 pod's cfg file. I wouldn't recommend copying the whole thing, as several of the other values have been changed. The bold bits are what impact MechJeb. The first bolded line is what earlier versions used to access MechJeb, so changing that back to the stock CommandPod setting removes the earlier versions. The second bolded section enables MechJeb 2. Make sure the spacing is the same. I'm not sure if that really matters, but since my modding skills are at the most rudimentary level, it seemed like a good idea to not experiment too much.

Aight, found a stock install. This is the same cfg, stock, with mechjeb 2 enabled. I think. I haven't actually run it. Should work just fine, but if it doesn't, you're having problems that are beyond me.

And sorry for the loooong post, but spoiler tags aren't enabled.

That's pretty much what I did, and it does activate mech jeb 2 for that part, but corrupts the config file so that several of the elements of mech jeb do not show in the command list pop out and are inaccessible. I'm only trying to change over the old mech jeb parts to the new mech jeb 2 layout so I don't have two mech jeb mods running when I have a ship that has two parts (mother ship and lander for example) that both have a mech jeb pod on them. The AR202 case that is the only pod included in mechjeb 2 doesn't always fit the configuration of the ship. Plus, I'd like to upgrade the ships already in place that are using the old mech jeb parts. Anything I try just corrupts the config file, and the most useful modules I use (orbital info, delta V stats) get removed because the config is garbled.

When you did your changes, did you check to make sure all the modules are available?

Link to comment
Share on other sites

Is it that hard to press X and disable autopilot before you crash it? Because you dont need to wait untill that operation is completed. when you see you are 150m away just disable it and and activate docking autopilot if you need one.

I think he's trying to point out that the "match velocities at CA" normally does stop you 50-100m AFTER you passed said CA, which combined with it's deadly accuracy for CA finetuning can result in a pin point interception?

It's not that hard to keep that in mind and abort the finetuning when it reached 100m seperation so the velocity match doesn't intercept right through, still it'd be nice if it wouldn't do that by default : /

You don't even get the CA distance field for rendevous targets O.o

Link to comment
Share on other sites

That's pretty much what I did, and it does activate mech jeb 2 for that part, but corrupts the config file so that several of the elements of mech jeb do not show in the command list pop out and are inaccessible. I'm only trying to change over the old mech jeb parts to the new mech jeb 2 layout so I don't have two mech jeb mods running when I have a ship that has two parts (mother ship and lander for example) that both have a mech jeb pod on them. The AR202 case that is the only pod included in mechjeb 2 doesn't always fit the configuration of the ship. Plus, I'd like to upgrade the ships already in place that are using the old mech jeb parts. Anything I try just corrupts the config file, and the most useful modules I use (orbital info, delta V stats) get removed because the config is garbled.

When you did your changes, did you check to make sure all the modules are available?

Yes. I just double-checked. Everything works. I'm afraid you're having problems that are beyond me.

Link to comment
Share on other sites

I think he's trying to point out that the "match velocities at CA" normally does stop you 50-100m AFTER you passed said CA, which combined with it's deadly accuracy for CA finetuning can result in a pin point interception?

It's not that hard to keep that in mind and abort the finetuning when it reached 100m seperation so the velocity match doesn't intercept right through, still it'd be nice if it wouldn't do that by default : /

You don't even get the CA distance field for rendevous targets O.o

Yes that's what I meant :)

If it could be stopped 50-100m BEFORE passing it would be great, but for now I will try to keep an eye on things and try not to destroy another station...

Link to comment
Share on other sites

Is it that hard to press X and disable autopilot before you crash it?

Protip: spaceships have no breaks. Pressing 'X' just cuts your engines. Since the problem is that it's firing retrograde thrusters too late and you're on a collision course with the station, pressing 'X', shutting down the thrusters that are trying to slow you down, will cause you to crash sooner and with greater velocity. Very bad idea... What you want to do is disable the autopilot and then try to divert your course to miss the station. Of course, you're not going to be pointed the right way to do that optimally, and gods help you if your ship doesn't turn well. In short, by the time you realize you're on a collision course, there may be nothing you can do but hit F9 and hope you last quicksave wasn't too long ago...

Link to comment
Share on other sites

I've been following this thread for a while, and have not seen anyone else mentioned this little glitch yet.

Doing planetary transfer burns, mechjeb will make the node, and attempt to execute it BUT it always calculates when it is supposed to start its burn by using the TWR of All the engines onboard rather than only the ones that are active. I haven't tested to see if it behaves this way when the other engines are separated by a stack or radial decoupler, but those aren't practicle in a reusesble cargo ships cargo hold.

Specifics: the ship uses 4 lvn's to push itself and the cargo with a TWR of 0.15. The cargo is a group of landers each with 4-6 radial engines each. All disabled but you can see in the staging with every engine active it would have a TWR of 0.65. Mechjeb is always warping to and executing its burn from about 3 minutes away from the node when the node burn time is 22 minutes. Should mention that the little radial engines are in their own stage and have never been activated on the craft at all.

Anyone have any insight or workarounds??

Link to comment
Share on other sites

Yes. I just double-checked. Everything works. I'm afraid you're having problems that are beyond me.

Thanks, I'll have to fiddle with it a bit more. Strange.

I've made the config file read only, hopefully that will fix it. I see each ship has it's own config file, will have to see how they work now.

Edited by Dweller_Benthos
Link to comment
Share on other sites

Protip: spaceships have no breaks. Pressing 'X' just cuts your engines. Since the problem is that it's firing retrograde thrusters too late and you're on a collision course with the station, pressing 'X', shutting down the thrusters that are trying to slow you down, will cause you to crash sooner and with greater velocity. Very bad idea... What you want to do is disable the autopilot and then try to divert your course to miss the station. Of course, you're not going to be pointed the right way to do that optimally, and gods help you if your ship doesn't turn well. In short, by the time you realize you're on a collision course, there may be nothing you can do but hit F9 and hope you last quicksave wasn't too long ago...

Hmm, well the latest collision was when my ship was waiting for the station to come to it, then all of a sudden the station appeared form the left and collided with the ship..

I guess if I had spotted that I could have disabled autopilot and fired my engines slowly hopefully enough to keep the station from catching up completely :)

Will give it another go and see what happens...

Link to comment
Share on other sites

Thanks, I'll have to fiddle with it a bit more. Strange.

I've made the config file read only, hopefully that will fix it. I see each ship has it's own config file, will have to see how they work now.

Each ship? It sounds like you're editing the ship's cfg. You shouldn't have to edit your ships at all, in-game or out. Only the parts themselves! If you're messing with the ship's file, that's why it's not working. The cfgs and changes I posted only work for the part cfgs. I'm sure there's a way to do the same thing to the ship itself, but doing it to the part negates the need. All ships, even after they've been launched, load from their appropriate cfg file, so if you add MJ to the part itself, any ship that already has that part attached is going to have MJ.

If I misunderstood you, you probably already know that, in which case I'm sorry.

Link to comment
Share on other sites

There seems to be a problem with land at target when giving the coordinates manually. From a circular 200km mun orbit, if I tell it to land on a target chosen on the map it does so without complications, if I manually inform the coordinates it starts spinning around after a couple of seconds deorbiting.

Edited by diegzumillo
Link to comment
Share on other sites

More information on the bug: If I abort the operation and hit 'land at target' again (without altering the coordinates) it will orient itself again and then it does nothing until crashing. The status says "off". I also have full control over the throttle, which is unusual, given mechjeb usually steals the controls to himself when it's doing something.

Link to comment
Share on other sites

Each ship? It sounds like you're editing the ship's cfg. You shouldn't have to edit your ships at all, in-game or out. Only the parts themselves! If you're messing with the ship's file, that's why it's not working. The cfgs and changes I posted only work for the part cfgs. I'm sure there's a way to do the same thing to the ship itself, but doing it to the part negates the need. All ships, even after they've been launched, load from their appropriate cfg file, so if you add MJ to the part itself, any ship that already has that part attached is going to have MJ.

If I misunderstood you, you probably already know that, in which case I'm sorry.

No, I'm editing the parts files, thanks for the help, no need to be sorry, lol.

The file that gets corrupted is mechjeb_settings_global.cfg it is located in \PluginData\mechjeb2. That is also the folder that holds the config files for each ship that has a mechjeb2 on it. These files store the information about what module windows are visible and where they are on the screen and what size they are. The main config file is the one that gets corrupted when I try to edit a part to add the new mechjeb2 controller. I have made that read only to keep it from getting corrupted, but I haven't had a chance to try one of my existing ships with the new mechjeb2 part to see if that ship's individual config also gets corrupted. Not sure why I'm the only one seeing this, and the corrupted file looks OK at first glance, just things are mostly in a different order than in the default config. I'll have to try it here on this computer and see if the same thing happens.

OK, I may be able to get the missing windows back with the window editor, so hopefully that will work. But what's this?

jokend.jpg

I got that from enabling the "obscurejoke" panel in the config file. Haven't tried anything in it during flight yet.

Edited by Dweller_Benthos
Link to comment
Share on other sites

The main config file is the one that gets corrupted when I try to edit a part to add the new mechjeb2 controller. I have made that read only to keep it from getting corrupted, but I haven't had a chance to try one of my existing ships with the new mechjeb2 part to see if that ship's individual config also gets corrupted. Not sure why I'm the only one seeing this, and the corrupted file looks OK at first glance, just things are mostly in a different order than in the default config. I'll have to try it here on this computer and see if the same thing happens.

Are you using the latest dev build? IIRC, the "official" 2.0.7 includes a bug where if you add MechJeb to a command module (the root of your ship, rather than using an attachment part like the AR202), you lose settings.

Link to comment
Share on other sites

Hmm, well the latest collision was when my ship was waiting for the station to come to it, then all of a sudden the station appeared form the left and collided with the ship..

Oh wow, I didn't even know that was possible. All of my collisions or near collisions have resulted from an extremely accurate Hohmann transfer followed by a match velocity, and I end up basically coming in with my engines pointed at the target, burning to match velocity instead of following the line straight through the target and out the other side. The fact that the "closest approach" match velocity option usually stops you a bit after the closest approach makes this an entertainingly disastrous rendezvous. A bit before would be perfect.

I suspect this is related to the way MechJeb executes nodes. A perfect orbit change node is an instantaneous change in velocity at the specified node. Since that's not possible, it's usually simulated by starting a burn half the length of the burn before the node is reached, thus a 10 second burn starts five seconds before the node and ends five seconds after. This has more or less the same effect as the instantaneous change would. The problem, I suspect, is that MechJeb doesn't quite do that. It starts the burn half the estimated burn length at full throttle before the node, which is perfectly correct if you're going to full burn the maneuver. But it doesn't do that, rather, as it gets close to the end, it throttles back and fine tunes. This extends the length of the burn on the plus side of the node to longer than the minus side. To compensate for the way it ends burns, I think it would need to start its burns a tiny bit earlier. But of course since it has no idea how much fine adjusting its going to do at the end, it really has no way to knowing exactly when to start.

Or I could be completely wrong. I'm not a rocket scientist. In any case, the end result is, collision course or not, for some reason, when you tell MechJeb to match velocities at closest approach, it usually only succeeds in matching velocities a bit after closest approach. On those cases where you got that perfect rendezvous, a bit before would be highly preferable (unless you *want* an entertainingly disastrous collision -- this is what we all play they game for anyway, right? xD) and a way to set, say, "match velocities X meters before closest approach" would be awesome.

Link to comment
Share on other sites

My little problems with MJ (Running 2.0.7, worked a bit with 1.9.8):

-Hohman transfer to a moon send me directly into it, so obviously i have to correct it, same with the fine-tuning manoeuvers, basically sends me to 0.0 m, little corrections are needed.

-Some burns using manoeuver planner start late, some waaayyyy too early, sometimes sending my periapsis into the planet

-The loss of settings, i like my custom windows!

-Seems the auto-landing needs to be given a spot the map using the "targeting tool", then you can edit it without problems. Actually punching in the exact coordinates of another lander might make them crash into each other, so the precision is a big plus.

-Translatron could use the RCS thrusters a lot more when killing horizontal speed

-Still have no idea how the RCS balancer is supposed to work

Link to comment
Share on other sites

-Seems the auto-landing needs to be given a spot the map using the "targeting tool", then you can edit it without problems. Actually punching in the exact coordinates of another lander might make them crash into each other, so the precision is a big plus.

That solves my problem! thanks :)

Link to comment
Share on other sites

Are you using the latest dev build? IIRC, the "official" 2.0.7 includes a bug where if you add MechJeb to a command module (the root of your ship, rather than using an attachment part like the AR202), you lose settings.

Nope, I had been using the official download, I will try the dev build, thanks. I had noticed that it wasn't saving the config for any of my ships, so maybe that will fix it.

Link to comment
Share on other sites

I'm wondering if certain MechJeb in-game settings should have their own window, instead of being scattered about the various other tool windows? For example, "Auto-Stage" on the Ascent Guidance tool, if checked, continues to operate even when the guidance isn't active, meaning it will just fire all your stages when you dock with another vessel (really annoying with my escape pod parachutes). Or "(Velocity) Tolerance" in the Maneuver Planner affecting basically every other tool, such as Rendezvous Guidance. Having all of these collected in their own small window one could leave open for easy access would be delightful. :)

Link to comment
Share on other sites

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