Jump to content

[1.0] Figaro Global Navigation Satellite System - Launch a Working GPS System


PakledHostage

Recommended Posts

would be cool if this guy and the guy making the remotetech could work togehter and make one intermeshed communication mod.

Hi Sidfu! Glad to read you're interested in my mod. For what it is worth, I prefer my online handle to "this guy", but suit yourself...

About your suggestion, that was the idea behind adding the FigaroTransmitter part to the mod distribution. You can add the Figaro GNSS antenna array to any satellite you build, just like you would any other part. That way your remotetech satellites can carry a GNSS payload. Alternatively, you could do as KhaosCorp suggests and edit the FigaroTransmitter part's part.cfg file to incorporate the remotetech module.

I think something more productive would be to add a communications delay to the GPS read-outs, and to cancel GPS functionality of a satellite if it's not in contact with the network.

Hi Kimberly! I am afraid I don't understand your suggestion? Can you please clarify?

Edited by PakledHostage
Link to comment
Share on other sites

Odd. I had this working (With at least 6 satellites in view, 16 in total in orbit at 1588km), then it stopped working. It's reading 0 visible sats. I had it working just fine, then it stopped. Wonder what could have caused that? I'm testing to figure out what happened. But just letting you know.

Link to comment
Share on other sites

And yes to be sure I sped time up to make sure I had at least six sats visible to me (it went up to nine visible at times) throughout many days. It didn't drop below six. Now suddenly it won't read any sats visible.

Edit: Also had the receiver (Of course all 16 GPS sats had the transmitter), added a second receiver to see if that was an issue (it wasn't), redid the receivers, used a different ship with a receiver, and so on. So far no luck getting it to read anything other than zero sats visible. I'm actually proud of myself for putting that many satellites up around Kerbin. They're all separated by 90 degrees on 4 different orbital planes (0, 45, 90, and 135). Was one of the more difficult missions I've done in KSP so far! So I really wish it would work!

Edit Edit: I reloaded the game and it started working again. Then I went back to the VAB and relaunched. Again, not working. I think it *might* have something to do with relaunching, or reverting the flight back to VAB (and/or back to launch, not sure on that)

Edited by SpaceRodent
Link to comment
Share on other sites

Hi Kimberly! I am afraid I don't understand your suggestion? Can you please clarify?

D'oh, I should probably have quoted a post. I was talking about RemoteTech integration; if you want to do that, it would be useful to make GPS satellites non-functional if they're not in contact with the RemoteTech network.

Link to comment
Share on other sites

Okay after some testing I figured out that sometimes it works and sometimes it doesn't work. When I revert back to the VAB or SPH, or if I revert back to launch, it will either work or not work. Doesn't seem to be related to that. So I'm not sure what the problem is...

Link to comment
Share on other sites

D'oh, I should probably have quoted a post. I was talking about RemoteTech integration; if you want to do that, it would be useful to make GPS satellites non-functional if they're not in contact with the RemoteTech network.

heh, that doesn't make sense, why would they stop working? RemoteTech network is for relay commands.

Link to comment
Share on other sites

heh, that doesn't make sense, why would they stop working? RemoteTech network is for relay commands.

Real GPS satellites need to synchronize with ground stations from time to time to keep functioning properly.

Link to comment
Share on other sites

Same problem, sometimes they will stop working.

Clearly there is a bug. It sounds to me like it isn't always updating or renewing the list of SVs. It only searches for SVs when it first loads and whenever there's a change in the number of spacecraft. I'll have to look for an oversight in the logic... Please give me a day or so. (If someone can PM me with a link to download a persistence file, that would be great.)

In the meantime, billeinstein and spacerodent, you should be able to make it work reliably by reverting to the old method of identifying SVs in your constellation. In your case, billeinstein, I see that all of your satellites are called "gps launcher". You can change the "GNSSAcronym" parameter in the Figaro Receiver part's part.cfg file from NONE to gps and it will work more reliably. Same is true for you, spacerodent. Just use any acronym that is unique to your constellation.

And Kimberly is correct about the need for real GPS satellites to be updated from ground stations from time to Time. I had actually considered adding an advanced mode where the SVs would have to orbit within view of KSC's tracking station every so often, but I haven't gotten around to it yet...

Link to comment
Share on other sites

Real GPS satellites need to synchronize with ground stations from time to time to keep functioning properly.

And Kimberly is correct about the need for real GPS satellites to be updated from ground stations from time to Time. I had actually considered adding an advanced mode where the SVs would have to orbit within view of KSC's tracking station every so often, but I haven't gotten around to it yet...

I see, I do know that IRL satellites need constant communication for them to work, what I meant is that it didn't make sense gameplay-wise. RemoteTech lets me control probes, and if the probes are outside of the network then I can't control them. I don't need to control GPS satellites once they are in orbit, hence why would they need to stop working?

There's a lot of IRL stuff that the game handwaves. Kerbin is supposed to be populated, why do I have to make sure the satellite's orbit is in view of the KSC when it makes more sense to think that the KSC doesn't have the only antenna in the planet's surface? And if a satellite stops working will I know why? will I know which one of them needs fixing? or will I have to jump through all the satellites in the constellation to make sure every one is working?

Does it add gameplay value? is it fun? or it is a chore?

Edited by m4v
Link to comment
Share on other sites

I see, I do know that IRL satellites need constant communication for them to work, what I meant is that it didn't make sense gameplay-wise. ... Does it add gameplay value? is it fun? or it is a chore?

You are absolutely right, which is why the feature would be optional if I were to add it. (And I am not sure that I will add it.)

As you point out, there is plenty that the game "hand-waves", like having precise position information available without requiring the infrastructure to support it. The beauty of mods, however, is that they give players the option to customize gameplay. An optional "hardcore" mode within an optional mod only adds a layer of challenge for those who want to take it on.

I'll do some work later today on the bug that billeinstein and spacerodent identified and will post back with an updated version once I have it fixed. The fix will not require players to relaunch their GNSS constellations, so... as you were.

Link to comment
Share on other sites

While we're at discussing new features, something I believe it would add gameplay is pseudolites, roughly a ground based GPS for remote planets. I think we can already do that, instead of using a satellite you use small landers and scatter a bunch of them near your base, if you have line of sight of 4 of them then you will have GPS around your base without the need of a full fledged sat constellation.

However for rovers and stuff in the ground, the line of sight requirement might be a bit tricky to get due to terrain, so maybe change it so it requires either line of sight or to be within some distance from the GPS units?

Link to comment
Share on other sites

However for rovers and stuff in the ground, the line of sight requirement might be a bit tricky to get due to terrain, so maybe change it so it requires either line of sight or to be within some distance from the GPS units?

You could use RemoteTech's model for line of sight calculations: it assumes the planet is a perfect sphere, and the sphere used in the calculation is slightly smaller than the actual planet. This prevents mountains and such from blocking the signal.

Pseudolites definitely sound like an interesting idea. Building a GPS network around every planet seems less realistic than strategically deploying some pseudolites around your main area of interest, e.g. a base. I'm curious, how do pseudolites calibrate?

Edited by Kimberly
Link to comment
Share on other sites

You could use RemoteTech's model for line of sight calculations: it assumes the planet is a perfect sphere, and the sphere used in the calculation is slightly smaller than the actual planet. This prevents mountains and such from blocking the signal.

So I bothered to look at Figaro's code, and it looks like it does the same. I have never bothered to deploy pseudolites arrays because I assumed that I will run into LOS issues. It seems that It wasn't the case.

Nevermind then.

edit:

Pseudolites definitely sound like an interesting idea. Building a GPS network around every planet seems less realistic than strategically deploying some pseudolites around your main area of interest, e.g. a base. I'm curious, how do pseudolites calibrate?
About that, I have no idea. Edited by m4v
Link to comment
Share on other sites

I just read up a bit on self-calibrating pseudolites. Apparently, they communicate with each other to determine their relative positions. Then, they can give relative coordinates to whatever's inside the network. They can't give planet-relative coordinates, so implementing them properly would probably be labor-intensive and also not terribly useful. You could just add a pseudolite part made of handwavium, of course, which tells you planet-relative coordinates anyway. :P

Link to comment
Share on other sites

So I bothered to look at Figaro's code, and it looks like it does the same.

Yes, when calculating whether or not a satellite is visible above the receiver's horizon, it assumes planets are perfect spheres. Let's just assume that trace amounts of handwavium in the Kerbal universe refract GNSS and pseudolite signals around obstacles like mountains...

UPDATE

I believe I have fixed the bug that was reported by spacerodent and billeinstein. I have rebuilt the plugin as v1.0.21.02 and posted it to SpacePort.

Link to comment
Share on other sites

Yes, when calculating whether or not a satellite is visible above the receiver's horizon, it assumes planets are perfect spheres. Let's just assume that trace amounts of handwavium in the Kerbal universe refract GNSS and pseudolite signals around obstacles like mountains...

UPDATE

I believe I have fixed the bug that was reported by spacerodent and billeinstein. I have rebuilt the plugin as v1.0.21.02 and posted it to SpacePort.

Just installed a 12 x dedicated GPS network at 1588kms staggered at 15 degree intervals. While setting up, my orbiting station was happily receiving a signal that gradually improved as more sats went up. 1024x576.resizedimage

I did some IRL work, came back an hour later and fit a receiver to a rover to test surface accuracy and went to launch. Fps dropped to less than 1 (on a 670gtx) and bogged everything down. Tried turning off receiver and it clicked off then back on again. Reverted to VAB, removed receiver, fps came back to 60+.

I tested the station (at 100km) and it bogged as well.

Did your suggestion of "GNSSacronym = GPS" (all my sats have GPS prefix), restarted, loaded receiver and sitting at launch with GPS signals, visible sats 4, accuracy 0.2m with 60 fps again.

Hope this helps solve this little issue. Time tested would be *after* the aforementioned update. Mod was d/l'd from Spaceport about 4 hours prior to post time.

Link to comment
Share on other sites

Thanks for the feedback. Sounds like it is getting bogged down while searching for the transmitter part on your satellites. It doesn't do that step if you set GNSSacronym to something other than "NONE".

It only develops the list of GPS SVs once when you first load your flight (and then again if the number of vessels ever changes), but it sounds like it is struggling to find SVs in the first place. It uses a bit of a kludge to find the SVs because I don't have access to the guts of the game, but obviously I'll have to come up with a more efficient method. Can you maybe PM me with a link to your Persistence file so that I can trouble shoot? It doesn't do what you're describing on my computer, so it must be something peculiar to your Persistence file.

Edited by PakledHostage
Link to comment
Share on other sites

Hello all

I've just run into an issue that I think may be similar to what Maverick found.

Any time I attach the GPS Reciever unit to a ship (or even simply a pod on the launch pad with no other parts at all) the game gets bogged down to less than 1 fps. This does not happen with the antennae. I'm currently on KSP v 0.21.1 and have Figaro 1.0.21.02. With my new download of the game I've only added MechJeb, Figaro and the RendezMe plugins (and I haven't even played with the last one yet). Everything else is completely stock (but obviously won't be for long...).

I'm pretty useless with computers but I'd be happy to send along any information that will help. I'll need pretty detailed instructions for how to find the Persistence file (which, btw I don't even know what that is...).

Thanks

Link to comment
Share on other sites

Thanks for the feedback. Sounds like it is getting bogged down while searching for the transmitter part on your satellites. It doesn't do that step if you set GNSSacronym to something other than "NONE".

It only develops the list of GPS SVs once when you first load your flight (and then again if the number of vessels ever changes), but it sounds like it is struggling to find SVs in the first place. It uses a bit of a kludge to find the SVs because I don't have access to the guts of the game, but obviously I'll have to come up with a more efficient method. Can you maybe PM me with a link to your Persistence file so that I can trouble shoot? It doesn't do what you're describing on my computer, so it must be something peculiar to your Persistence file.

I looked the code a bit, I neither know how to find the transmitter part without having to loop through all the parts of each vessel. And without profiling is hard to tell where is the bottleneck, if there's one at all, but some things that occurred to me for make it faster:

check the body each vessel is orbiting, if we aren't orbiting the same body then skip. And compare string hashes instead of the strings themselves because int comparison faster, something like:


int transmitterID = transmitterString.GetHashCode();
CelestialBody ourCelestialBody = vessel.GetOrbit().referenceBody;

....

/* I'm actually not sure if this is valid, I'm writing from the top of my head, test fist! */
CelestialBody otherCelestialBody = otherVessel.GetOrbit().referenceBody;
if (ourCelestialBody != otherCelestialBody) {
/* skip */
}

....

if (otherPart.name.GetHashCode() == transmitterID)
{
/* has transmitter */
}

also I remember Mu saying in #kspmodders that "foreach" was more inefficient than "for" due to being slower and generating more garbage for the garbage collector, but I don't know how significant would be in this case.

Link to comment
Share on other sites

Thanks. Good suggestion to test only those objects in orbit around the same body. It does that for the old method of seeking satellites with some GNSS acronym in their vessel name, but I don't think I remembered to do it in the new case.

I wonder, though, if the bug is as simple as some funny interaction between Figaro and other mods like MechJeb? As I mentioned before, it doesn't bog down on my machine and I am only running it on a very slow little netbook...

Another possibility is that it bogs down when none of the orbiting vessels have a Figaro Transmitter part installed. I never actually tested that case. I will look into it in the next few days.

@AviatorDSB: Your game's persistence files are located in the "Saves" directory of the KSP game's folder. They are the files that the game uses to store data about all of your active missions. Don't worry about it if you can't find it. I wouldn't want you to screw up your game's save file.

Link to comment
Share on other sites

UPDATE

Regarding the reports that I'm getting of people's systems bogging down when spacecraft with the Figaro Receiver part installed first load:

I have done some more testing and still haven't been able to duplicate the bug on my own system (a slow little netbook).

Even so, I polished up the code a bit and tested a few things that I hadn't previously tested. The improvements will be included in the next update, but I won't release it until I have a real reason to. I'd like to find the "smoking gun" that's behind the bug people are reporting. If anyone who's encountered the bug can provide a detailed description of how to duplicate it, or better yet a copy of their persistence file, it would be greatly appreciated. Please include in your description a list of all mods that you've got installed, in case the problem is due to an interaction between Figaro and some other mod.

Link to comment
Share on other sites

Hello,

Well I just tried this again (simple ship on pad with a Receiver Unit installed) and this time it bogged down so much that it eventually crashed the program. I've located the persistence file and will try to PM it to you.

There may be a new clue. This time the game bogged down noticeably worse than before and the only change that has happened is that I got all giddy about GPS constellations and launched a bunch of transmitter satellites. No other mods or anything installed. So from limited experimentation on my end it looks like my ships fly fine with a transmitter and that the game performance is affected by the Receiver but perhaps to a greater degree when there are a bunch of transmitters already in orbit. Feel free to disregard if that doesn't make sense, kind of out of my league here...

One other thought, The version of MechJeb I have is 2.0.9 that adds it to all capsules and pods. Are the guys who are using Figaro successfully using a different MechJeb?

@Maverick: Could you tell us what version of MechJeb you're using (if at all)?

Keep the pointy part

Link to comment
Share on other sites

UPDATE

Thanks to AviatorDSB's help, I have been able to narrow down the cause of the bug that people have been reporting. The bug causes the game to bog down when you go to launch your spacecraft. It does not occur when you use the old method of naming all of your satellites with a certain acronym. It only occurs when using the new Figaro Transmitter part.

I was finally able to duplicate those symptoms on my computer by having one spacecraft that contains the Figaro Receiver part in a game save, and then trying to launch a second one. That's an oversight on my part and I have to fix it. I will work on it this coming weekend and will hopefully post v1.0.21.03 of the plugin by early next week.

Until then, you can avoid the bug by only having one craft at a time carry the receiver, or reverting to the old method of using a unique acronym in the names of all of your satellites (change the "GNSSAcronym" parameter in the Figaro Receiver's Part.cfg file to match the acronym you are using if you choose this work around).

Edited by PakledHostage
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...