-
Posts
133 -
Joined
-
Last visited
Content Type
Profiles
Forums
Developer Articles
KSP2 Release Notes
Everything posted by c4ooo
-
I have considered the following layout: Pe Alt [8 7-segment displays] time to Pe [6 7-segment displays] Ap Alt [8 7-segment displays] time to Ap [6 7-segment displays] Vessel altitude (Alt / Radar Alt) [8 7-segment displays] time to node [6 7-segment displays] speed (orbit, target, surface, or delta-v left to complete maneuver) [5 7-segment displays] However this adds up to a total of 47 7-segment displays, and doesn't look as clean IMHO Edit: so it will end up being a big price tag
-
My alarm clock is the default alarm sound on my phone. Never hear it though becouse i always wake up exactly 5 minutes before my alarm sounds
-
Edit: the orignal version of this post had a question that i figured out I added navball speed modes. They use the upper nibble of SASMode (autopilot vector). "If the navball is in Surface mode and SAS is set to AntiNormal, SASMode will equal TARGET + SMAntinormal = 48 + 5 = 52. ". To get the SASMode (auto pilot vector) on arduino, do (SASMode & 0x0F), and (SASMode & 0xF0) to get the navball speed mode. Navball speed mode definitions: #define ORBIT 16 #define SURFACE 32 #define TARGET 48 Heres some example code for arduino: if((VData.SASMode & 0x0F) == SMRetroGrade){ //if the SAS is set to RetroGrade... CPacket.SASMode = SMPrograde; //set to Prograde }else{ CPacket.SASMode = 0; //reset } if((VData.SASMode & 0xF0) == ORBIT){ //If navball in orbit mode... CPacket.SASMode = CPacket.SASMode | TARGET; //Set to target mode. (Notice the bitwise-or with the SAS autopilot vector }
-
Athena ... a ridiculously huge stock space station.
c4ooo replied to Azimech's topic in KSP1 The Spacecraft Exchange
Welp, it crashed my laptop when i tried to load it :/ In the end i had to pull the plug becouse everything simply froze. -
Hmm, looking at https://github.com/zitron-git/KSPSerialIO/blob/master/KSPSerialIO/KSPIO.cs#L935 it seems that SASMode remain set to the last value, and wont reset to zero when SAS is dissabled. Similarly, by looking at https://github.com/zitron-git/KSPSerialIO/blob/master/KSPSerialIO/KSPIO.cs#L1114 , setting CPacket.SASMode = SMOFF; wont actualy dissable SAS, but would be ingored. (In my orignal code, setting the SAS control byte to zero would not change anything, but the sas state sent to the arduino would revert to zero when SAS is turned off) Just wanted to point this out, as i think it may cause problems.
-
Athena ... a ridiculously huge stock space station.
c4ooo replied to Azimech's topic in KSP1 The Spacecraft Exchange
I've tried loading it, but it sais "Incompatible with this version of KSP" (I am in 1.2.0) But I only have like 4GB RAM on my computer, so that may be the problem x.x -
Heh, i know this situation all too well from my experience programming graphing calculators >.< Never really bothered to check the amount of ram on an arduino though More on topic though, could anyone suggest some joysticks? I am looking for two 1-axis and two 2-axis joysticks. (One pair for rotations and the other translation) I have done some searching, and i haven't found any 1 axis joysticks at all.
-
Cant set SAS autopilot mode programmatically?
c4ooo replied to c4ooo's topic in KSP1 C# Plugin Development Help and Support
As far as i understand, ActiveVessal should be the same as FlightGlobals.ActiveVessel (This isn't my code that i am modifying). Anyways, i guess it doesn't like that i am casting a number to (VesselAutopilot.AutopilotMode) or something, becouse i can change the mode fine with "ActiveVessel.Autopilot.SetMode(VesselAutopilot.AutopilotMode.RadialOut);" etc. Edit: "ActiveVessel.Autopilot.SetMode((VesselAutopilot.AutopilotMode) ((int) SOME_BYTE));" works but "ActiveVessel.Autopilot.SetMode((VesselAutopilot.AutopilotMode) (SOME_BYTE));"? Can someone confirm that this and that its not just some other part in my code that was messing stuff up? -
Cant set SAS autopilot mode programmatically?
c4ooo replied to c4ooo's topic in KSP1 C# Plugin Development Help and Support
Yes, i have made sure that i am actually able to change the SAS mode (i set it manually). Anyways, maybe its because i am doing ActiveVessel.Autopilot.SetMode((VesselAutopilot.AutopilotMode) BYTE_REPRESENTING_MODE); Instead of something like: switch(BYTE_REPRESENTING_MODE){ case 0: ActiveVessel.Autopilot.SetMode(VesselAutopilot.AutopilotMode.StabilityAssist); break; case 1: ActiveVessel.Autopilot.SetMode(VesselAutopilot.AutopilotMode.ProGrade); break; case 2: ActiveVessel.Autopilot.SetMode(VesselAutopilot.AutopilotMode.RetroGrade); break; etc... } (Never done C# until yesterday) Once i get back to my code in ~6 hours i will update the post -
I am trying to set the SAS autopilot mode programatically, i am calling: ActiveVessel.Autopilot.SetMode((VesselAutopilot.AutopilotMode) Mode ); However this does not change the mode. I have looked at the kOS code, and it's also changing the mode with Autopilot.SetMode(); Could anyone shed some light on this? I have tried adding the following: (From https://github.com/Mihara/RasterPropMonitor/blob/6d322ad430d6496450c5415e5d57f44f13a7b86f/RasterPropMonitor/Handlers/JSIInternalRPMButtons.cs#L220 ) UIStateToggleButton[] SASbtns = UnityEngine.Object.FindObjectOfType<VesselAutopilotUI>().modeButtons; SASbtns.ElementAt<UIStateToggleButton>((int)KSPSerialPort.VControls.AutoPilotData).SetState(true); Didn't help.