Arrowstar / ksptot

KSP Trajectory Optimization Tool
Other
87 stars 13 forks source link

Missing key in dictionary when running createDragData.ks #30

Open CharlesA18 opened 2 years ago

CharlesA18 commented 2 years ago

Attempting to create drag profiles for an Eve lander using Ren0k's Atmospheric Drag Project and the kOS scripts provided with TOT, I encountered a number of errors, the first one being that createDragData.ks (from TOT) tried to run a non-existent file "Telemetry.ks." After some tinkering, I figured out that Ren0k has (I think) updated his project in a way that restructures the directories, gets rid of Telemetry.ks, and puts required functions from it into different places (in particular I found I needed the contents of "Vectors.ks"

I have attached an edited version of the createDragData.ks* script (with edited instructions in the header) which runs without errors. I need to do some testing to figure out if the output .csv file has the correct information. I noticed that column D (which I see in the script holds CdACube) was all zeros after a test run on a ship I made, but maybe that's normal.

*As .txt because github doesn't like .ks and .txt runs anyways. createDragData_MODIFIED.txt

Arrowstar commented 2 years ago

Can you point me to which version of Ren0k's code you used? I'm not seeing any updates in the past ~1.5 years in his git repo.

CharlesA18 commented 2 years ago

Hmm, you're right, it looks like there's nothing in the last 1.5 years. Maybe I misunderstood something?

I am simply using the folders and files from the main branch currently linked to in the header comments in your script (https://github.com/Ren0k/Project-Atmospheric-Drag). I initially only copied the atmoData folder (inside "Library") and DragProfile folder (inside "CCAT") into the Ships/Script folder as described in the steps commented in the header of createDragData.ks, and copied/pasted the part database and craft files into the places described in the steps as well. Followed the steps exactly as far as I can tell (except on the last step, I realize I should run "createDragData.ks" not "createDragProfile.ks" which doesn't exist. But upon running, it spat out an error when trying to execute the command 'runpath("dragProfile/LIB/Telemetry.ks").' A simple search looking in the DragProfile/LIB folder showed that Telemetry.ks did not exist.

After seeing this, I pulled the full CCAT and Library folders from the github, edited the paths for the things in dragProfile to point to said folder now inside CCAT, and commented out the line for running Telemetry.ks. I then got an error about lib_VesselOrientation not existing, and assumed it must have been something that was once inside Telemetry.ks. Poking through the different files (I've worked with kOS a lot before) I found it was defined in Vectors.ks, and so updated the code to run this script instead of Telemetry.ks. The code then ran fine.

Is there a different version I'm supposed to be using? Is the telemetry.ks supposed to be found somewhere else?

Arrowstar commented 2 years ago

I was using the "Latest" normal release, "dragProfile 1.01". Can you try downloading that and see if it helps?

CharlesA18 commented 2 years ago

Ok, well this is embarrassing. I just didn't understand github enough to realize clicking on "dragProfile v1.01" did something different than downloading the folders and files right next to it.

CharlesA18 commented 2 years ago

Alright, using the 1.01 version, with files set up as described in the createDragData.ks instructions, I'm getting a new error.
I tried replacing my craft file and part database file (and deleting the old database .json file) in case maybe the old ones had some artifacts from me having used the wrong Atm Drag Project earlier, but that didn't fix it.

image

I can provide my craft file if you think it would be beneficial. My craft does have a fairing, which I read in Ren0k's readme would require a manually-entered drag cube for accuracy. Perhaps I need to do some tinkering using the gui/tools in his mod?

Arrowstar commented 2 years ago

Alright, using the 1.01 version, with files set up as described in the createDragData.ks instructions, I'm getting a new error. I tried replacing my craft file and part database file (and deleting the old database .json file) in case maybe the old ones had some artifacts from me having used the wrong Atm Drag Project earlier, but that didn't fix it.

image

I can provide my craft file if you think it would be beneficial. My craft does have a fairing, which I read in Ren0k's readme would require a manually-entered drag cube for accuracy. Perhaps I need to do some tinkering using the gui/tools in his mod?

So this appears to be a bug with the mod. If you try to use the 1.01 version of the drag profile mod by itself, as the author intended it to be used (so no integration with my code), do you get the same error?

CharlesA18 commented 2 years ago

It may be a while before I get back to you on this. I broke my own rule of not putting an uncovered drink within arm's reach of my laptop and... well... "It's dead Jim."