Profile image

Funky trees auto pilot help

227 RealKSPGAMING  4.2 years ago

I need help fixing my code also idk if the maths im using to get the angle between 2 points will work but, my code is broken and i don't whats wrong with (im really just too lazy to look at it)
Here is the code, its multi lines for readability. "//" is a comment

(
(
(
clamp(
-RollAngle + clamp(
sin(
Heading+
(
Activate7 && Activate6 ? -360 * ( //Decides whether a location is selected ag7 = Krakabloa, ag6 = Wright
(
Activate7 ? 50000 : Activate6 ? 7170 : 0 //Selects latitude for Krakabloa or Wright Isles
) - Latitude
/
(
Activate7 ? 20000 : Activate6 ? 6900 : 0 //Selects longitude for Krakabloa or Wright Isles
) - Longitude
) : -VTOL * 180 //If no location is selected enable heading hold
)
)
* 90, -35, 35), -15,15
)
)
/ 180
)
* clamp01(
Activate3
)
)
+
(
(
(
(
(
clamp(
-RollAngle, -15, 15
)
* clamp(
Activate2, 0, 1
)
)
/ 180
)
)
)
* clamp01(
-Activate3
)
)
+
(
-Roll / 180 * 15
)
+
(
(
clamp(
RollAngle / 180, -0.1, 0.1
)
* round(
RollAngle / 80
)
* -round(
RollAngle / 80
)
)
* clamp01(
Activate1
)
)

  • Log in to leave a comment
  • Profile image
    3,247 BlxxVoidz

    hi, what is the code for?
    I want to try it :) thank you

    3.0 years ago
  • Profile image

    @RealKSPGAMING yes you have debug console, go to settings and then tap settings u til a notification pops up saying "debug console (dev console) is activated"

    4.2 years ago
  • Profile image

    @RealKSPGAMING yes you have debug console, go to settings and then tap settings u til a notification pops up saying "debug console (dev console) is activated"

    4.2 years ago
  • Profile image

    also the angle range is -180 to 180, 0 being positive latitude and 90 being positive longitude

    4.2 years ago
  • Profile image

    @BagelPlane Im not sure if this answers my question im trying find some maths to find the angle of one point to another Ex. x6900, y7170 to x20000, y50000 and im not sure if what i have will work also my funky trees is invalid and im on android so i don't have debug console

    4.2 years ago
  • Profile image
    24.1k BagelPlane

    Use a PID controller. ActivateX ? PID (0, PitchAngle, 0.1, 0, 0.1) : 0will work, but needs tunning. X represents an AG number.

    4.2 years ago