Jump to content

Search the Community

Showing results for tags 'position'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • General
    • Announcements
    • Welcome Aboard
  • Kerbal Space Program 2
    • KSP2 Dev Updates
    • KSP2 Discussion
    • KSP2 Suggestions and Development Discussion
    • Challenges & Mission Ideas
    • The KSP2 Spacecraft Exchange
    • Mission Reports
    • KSP2 Prelaunch Archive
  • Kerbal Space Program 2 Gameplay & Technical Support
    • KSP2 Gameplay Questions and Tutorials
    • KSP2 Technical Support (PC, unmodded installs)
    • KSP2 Technical Support (PC, modded installs)
  • Kerbal Space Program 2 Mods
    • KSP2 Mod Discussions
    • KSP2 Mod Releases
    • KSP2 Mod Development
  • Kerbal Space Program 1
    • KSP1 The Daily Kerbal
    • KSP1 Discussion
    • KSP1 Suggestions & Development Discussion
    • KSP1 Challenges & Mission ideas
    • KSP1 The Spacecraft Exchange
    • KSP1 Mission Reports
    • KSP1 Gameplay and Technical Support
    • KSP1 Mods
    • KSP1 Expansions
  • Community
    • Science & Spaceflight
    • Kerbal Network
    • The Lounge
    • KSP Fan Works
  • International
    • International
  • KerbalEDU
    • KerbalEDU
    • KerbalEDU Website

Categories

There are no results to display.


Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


Website URL


Skype


Twitter


About me


Location


Interests

Found 4 results

  1. Hello, I'm attempting to draw custom orbit lines and place objects in the Tracking Station view. I'm trying to retrieve the position on a orbit from a true anomaly. However, I'm coming accross weird position calculations when using the Orbit.getPosition functions and custom true anomalies values. I saw a similar issue in this post, but it doesn't provide an explanation or solution to the problem: I've setted up this bit of code to debug what's going on, which runs on the first frame when entering the Tracking Station. It first compares positions calculated using UT and an offsetted UT. Then it compares the positions by modifying the true anomaly angle with a small offset. I made a small analysis of the results below. Logger.Log("MODIFYING UT:"); double ut = Planetarium.GetUniversalTime(); Logger.Log("UT: " + ut); double trueAnom1 = kerbin.orbit.TrueAnomalyAtUT(ut); double trueAnom2 = kerbin.orbit.TrueAnomalyAtUT(ut + 1); // +1 second Logger.Log("True Anom 1: " + trueAnom1); Logger.Log("True Anom 2: " + trueAnom2); Vector3d localPos1 = kerbin.orbit.getPositionFromTrueAnomaly(trueAnom1); Vector3d localPos2 = kerbin.orbit.getPositionFromTrueAnomaly(trueAnom2); Logger.Log("Local Pos 1: " + localPos1); Logger.Log("Local Pos 2: " + localPos2); Vector3d scaledPos1 = ScaledSpace.LocalToScaledSpace(localPos1); Vector3d scaledPos2 = ScaledSpace.LocalToScaledSpace(localPos2); Logger.Log("Scaled Pos 1: " + scaledPos1); Logger.Log("Scaled Pos 2: " + scaledPos2); Logger.Log("Local Positions Distance: " + (localPos1 - localPos2).magnitude); Logger.Log("Scaled Positions Distance: " + (scaledPos1 - scaledPos2).magnitude); Logger.Log("MODIFYING TRUE ANOMALY:"); ut = Planetarium.GetUniversalTime(); Logger.Log("UT: " + ut); trueAnom1 = kerbin.orbit.TrueAnomalyAtUT(ut); trueAnom2 = trueAnom1 + 0.001; // 0.001 offset angle in radians (= 0.05729578°) Logger.Log("True Anom 1: " + trueAnom1); Logger.Log("True Anom 2: " + trueAnom2); localPos1 = kerbin.orbit.getPositionFromTrueAnomaly(trueAnom1); localPos2 = kerbin.orbit.getPositionFromTrueAnomaly(trueAnom2); Logger.Log("Local Pos 1: " + localPos1); Logger.Log("Local Pos 2: " + localPos2); scaledPos1 = ScaledSpace.LocalToScaledSpace(localPos1); scaledPos2 = ScaledSpace.LocalToScaledSpace(localPos2); Logger.Log("Scaled Pos 1: " + scaledPos1); Logger.Log("Scaled Pos 2: " + scaledPos2); Logger.Log("Local Positions Distance: " + (localPos1 - localPos2).magnitude); Logger.Log("Scaled Positions Distance: " + (scaledPos1 - scaledPos2).magnitude); (Logger.Log is a custom wrapper around Debug.Log) Here are the results: MODIFYING UT: UT: 135842917.592889 True Anom 1: 1.63107920616794 True Anom 2: 1.63107988885983 Local Pos 1: [493910.75, 1014.90991210938, -340737.9375] Local Pos 2: [501845.514609337, 1014.90991210938, -335916.997343063] Scaled Pos 1: [82.3098468153844, 0.269453518842612, -56.9360563766938] Scaled Pos 2: [83.6323075694434, 0.269453518842612, -56.1325663591432] Local Positions Distance: 9284.500708296 Scaled Positions Distance: 1.54741676814283 MODIFYING TRUE ANOMALY: UT: 135842917.592889 True Anom 1: 1.63107920616794 True Anom 2: 1.63207920616794 Local Pos 1: [493910.75, 1014.90991210938, -340737.9375] Local Pos 2: [12113141.2240677, 1014.90991210938, 6726731.39502716] Scaled Pos 1: [82.3098468153844, 0.269453518842612, -56.9360563766938] Scaled Pos 2: [2018.84823841927, 0.269453518842612, 1120.97548642882] Local Positions Distance: 13599839.6893388 Scaled Positions Distance: 2266.63992394695 First test (modifying the UT) : In the first comparison, I'm calculating the true anomalies using the built in TrueAnomalyAtUT function at two different dates : the current UT and that same time but 1 second in the future. As you can see, the positions seem close enough both in local space and scaled space. Morover, the distance of about 9284 meters between the two position matches the distance Kerbin would travel in 1 second, based on its orbital velocity which is 9285 m/s (according to the wiki: https://wiki.kerbalspaceprogram.com/wiki/Kerbin). Note also that the scaled position calculated at the current UT matches the coordinates of kerbin.scaledBody.transform.position (not shown here, but tested). However, the magnitude of the position vector (in local space) is about 60000 m, which doesn't seem to match Kerbin's orbit semi major axis of 13 599 840 256 m (according to the wiki). I thought intuitively that the origin of the world (= local space ?) coordinates would be where the Sun is, but it can't be according to these values. Where is the origin of the world ? Am I missing something in how the local space works ? I also find a bit curious that the distance traveled in the scaled space is about 1 unit. The magnitude of the position vector in scaled space (according to these logs) is about 100 units. So that means that Kerbin would have moved of 1/10th of its "position magnitude" in one second in the Tracking Station view... which clearly isn't the case. We don't see any bodies moving that much in just 1 second (they look pretty still). Second test (modifying the true anomaly) : Now the second comparison. I first compute the true anomaly at the current UT, and the position at this true anomaly using getPositionFromTrueAnomaly. Then I compute another position but with a true anomaly offsetted of only 0.001 radians, which corresponds to about 0.06 degrees. I expect to have very close coordinates, but as you can see, it's complete nonsense. The position calculated from the true anomaly at the current UT looks correct (same as in first test). But the positions calculated at the offseted anomaly makes no sense. Except the y-coordinate, the xz-coordinates are different from the first position by several orders of magnitude (not mentioning the sign change on the z-component). The scaled coordinates doesn't make sense either. The distance between the two positions is about 13 600 km for a 0.06 degrees difference in the true anomaly, and in scaled space it's about 2300 units. Something is obviously wrong and I can't figure out what. I want to draw custom orbit lines and I've looked through the source code of other mods (the DrawTools class in Kopernicus: https://github.com/Kopernicus/Kopernicus/blob/755ab1e3a5cf73e44e033be12906693f9564ceaa/src/Kopernicus/Components/DrawTools.cs) and they don't seem to do anything different from me except using the eccentric anomaly (I tried it, and I get the same problems). What am I missing ? Am I misunderstanding how local space / scaled space work ? (another post I made related to Tracking Station positioning problems : Thank you very much in advance for any help !
  2. I'm looking for a modder to make a simple tool which would be able to edit part position and rotation in-flight. With simple UI and part highlighting (code for part selection is available in mods like Part Commander and Action Groups Extended) Basically a mod which will change and update these values in real time: excerpt from a save file PART { name = engineLargeSkipper cid = 4289663140 uid = 927870594 mid = 409881460 launchID = 51 parent = 128 position = 9.5522575378417969, -7.2433972358703613, 5.9428839683532715 rotation = -0.00245498656, -0.0027628853, -0.698597789, 0.715505123
  3. Hi all, I saw on many screenshots, that lot of people have their top-right icons (contract info, resources monitor, kerbalpedia and mods buttons...) aligned horizontally. Mine are vertical as seen on attached picture and as I installed MechJeb mod, its colliding with pull-out MechJeb menu. How can I switch these icons bar from vertical to horizontal position? Thanks in advance for any help.
  4. Greetings! : D I've been trying to figure out a method for measuring a crafts "wobbliness"/rigidity and have things happen when it's poorly constructed or subjected to excess stress. I've been looking into breaking forces and torque, but as I have understood, it is not possible to have Unity give up any values on forces applied to a part's joints, except when it has actually fallen off. I was therefore thinking of trying to measure parts relative rotation and position to its parent part (or joint). Then store the values at start of a flight. Then during flight check the offset values of the original position/rotation. Then finally, have thing happen when the offset values are too great. However, I've been trying for a while to figure out exactly what I should measure (or where I can get the information I need), but I'm still just as clueless as I was when I started. Any help would be greatly appreciated : D
×
×
  • Create New...