So last night I was brainstorming how best to accomplish multiple configuration modes and I was sorta struggling with how I implemented the joysticks. While it works, it is far from elegant. Each `Joy.toString()` returns a comma separated list of the axes: i.e. -1,-1,-1 or 0,0,0 or 1,1,1 or something in between. Because the Telemachus API only has `setYawPitchRollXYZ`, I have to aggregate both responses into a single API call.
It's not bad, but it makes `Joy0` and `Joy1` special snowflakes and not as easily interchangeable as the rest of the system. If I wanted to implement separate controls for spaceplanes, it'd have to be very specific code and not just reuse what I'm using for all the other devices.
So that got me thinking: maybe I should put in a feature request for this? Unfortunately, the author hasn't been really active recently. I decided to search the repository and see if I couldn't reverse engineer what I needed. It turned out to be a single place in the repository, so I added two separate methods `setAttitude[yaw, pitch, roll]` and `setTranslation[x, y, z]` and submitted a pull request.
This was probably not the right thing to do since I hadn't tested it at all, but I put it out there in the hopes that it might be someday pulled in. This morning I woke up and decided to try my hand at building a mod. Seeing as I had zero experience with this and no environment setup, I started with the Telemachus docs. I did hit some snags.
- Being on a Mac, Visual Studio is out. I opted for Xamarin
- You need to download and install Unity 4.6.5
- Don't use MonoDevelop, I couldn't get it to build properly
- You need a Windows install of KSP for the KSP_Data (cf. step 2 from Telemachus wiki)
- You might be able to get it from KSP.app/Contents/Data, but it wasn't a 100% match.
- The post-build script is Windows only.
- Either deal with it, or use DwarfPlanetTossing's fix
- Even with this fix, it didn't seem to work 100%, so make sure when you copy out the .dll's, you get the newly built ones.
- I'll say it again, check the timestamps of the .dll's. I spent far too long combing the code for what went wrong when the solution was I was still using the old version.
Anyway, all that said and done, I was able to successfully build Telemachus from source with my new contributions. I'll be using this build from now on and it'll make life MUCH simpler for the planned modal inputs.
Discussions
Become a Hackaday.io Member
Create an account to leave a comment. Already have an account? Log In.