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
)
)
hi, what is the code for?
I want to try it :) thank you
@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"
@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"
also the angle range is -180 to 180, 0 being positive latitude and 90 being positive longitude
@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
Use a PID controller.
ActivateX ? PID (0, PitchAngle, 0.1, 0, 0.1) : 0
will work, but needs tunning. X represents an AG number.