Jump to content

TrainWreck

Members
  • Posts

    5
  • Joined

  • Last visited

Everything posted by TrainWreck

  1. @Benji Throttle is working just fine for me in my implementation. If you post more of your code that isn't working you might get more help.
  2. @stibbons your instructions for pulling down and starting development were actually pretty spot on. There were a few extra packages required for my system to be able to run make correctly, but that's on me and not your documentation. That is indeed my pull request. This is actually not a bug at all! Your Arduino library code very clearly documented that the line I mentioned was required, and I just didn't notice it. the (byte)7 is reasonable to me, as this was just test code and any reasonable implementation would have that in a byte variable anyway.
  3. I have replicated Codapop's code for the most part in my setup with the same results. In my setup I have a slide pot controlling the throttle, and the same value is also sent to the ROTATION_MESSAGE. throttleValue = analogRead(throttlePin); throttleValue = map(throttleValue, 0, 1023, 32767, 0); mySimpit.send(THROTTLE_MESSAGE, (unsigned char*) &throttleValue, 2); rotation.pitch = throttleValue; rotation.yaw = throttleValue; rotation.roll = throttleValue; mySimpit.send(ROTATION_MESSAGE, rotation); In KSP, when I move the slide pot the throttle works fine, but no movement on any of the rotational controls. EDIT: On looking through the code on bitbucket (finally), it looks like the below callback is handling the rotational control messages. There is a bitwise and operation being performed against newRotation.mask, but I can't see newRotation.mask actually getting set anywhere. IIRC (and my memory of C# is pretty rusty, so I could easily be wrong) structs are always pre-zeroed, and performing a bitwise & against 0 is always going to give you zero. If all of the above is correct, it would make sense that nothing you send in will do anything, because the code will always evaluate it to zero! Stibbons, please correct me if I'm wrong here! public void vesselRotationCallback(byte ID, object Data) { newRotation = KerbalSimpitUtils.ByteArrayToStructure<RotationalStruct>((byte[])Data); // Bit fields: // pitch = 1 // roll = 2 // yaw = 4 if ((newRotation.mask & (byte)1) > 0) { myRotation.pitch = newRotation.pitch; } if ((newRotation.mask & (byte)2) > 0) { myRotation.roll = newRotation.roll; } if ((newRotation.mask & (byte)4) > 0) { myRotation.yaw = newRotation.yaw; } } EDIT 2: After further review, the fix was incredibly simple like @Codapop expected, and I was just over-complicating things. All I did was add rotation.mask = (byte)7; To the code above and the throttle works as expected. Set rotation.mask based on which of the 3 axis' are getting updated (see lines 59-66 here. Luckily, debugging this (admittedly self inflicted) issue finally got me to pull down the repos and set up my make environment. Hopefully I'll be able to find time to work on them a little bit and open some pull requests.
  4. If you have an ISP (or another Arduino board) I think you should be able to upload sketches that way. Googling "arduino upload sketch without usb" returned some seemingly useful results for me. I don't remember the keyboard being disabled when I was testing, but I can't say for sure until I can test again at home.
  5. Hello, Are there any plans to include the SAS headings as controllable items (e.g. hold prograde, hold retrograde, etc.)? I looked through the docs and it doesn't look like this is available currently. Are you open to accepting pull requests if you don't have the time to put in anymore?
×
×
  • Create New...