Matsemann / mDjiController

Connect your DJI Remote Controller to your computer and use it to play simulators
Apache License 2.0
87 stars 30 forks source link

Can't compile mDjiController #1

Closed Timebutt closed 7 years ago

Timebutt commented 7 years ago

I would like to compile the mDjiController executable myself to adapt some values. The reason why I want to change the code, is that when I use the 'Monitor vJoy' application, my controller values never exceed a very low value, see screenshot (this is with all sticks in the center):

capture

When I move the sticks to the extreme positions, the values read go to zero, or double the value shown in the screenshot (so very little travel in the digital value!). Maybe my Phantom 2 controller (on the back it says 'Model NDJ6') is a little different and spews out different values. Here is a screenshot of the log with my left stick in bottom right position:

2

In any case: I want to go through the source code and see if I can change some values to get better results, but I can't compile the code because the vjoyinterface.h header file is missing from this GitHub repository:

3

Could you please add the correct vjoyinterface.h to the repository?

Timebutt commented 7 years ago

Ok my bad, the vjoyinterface.h file is in the inc folder. Added that folder as an 'additional include folder' to my Visual Studio project and the issue was solved. Next issue coming up, now I get all kinds of linking errors referring to the fact that the actual implementation of the functions in the vjoyinterface.h header file is missing. What to do with these?

4

Matsemann commented 7 years ago

Sorry about the late reply, I have somehow managed to unwatch the project so just saw the other comment by accident. Can't answer right now, but will take a look later.

Matsemann commented 7 years ago

But I think when you download vJoy it should include a SDK where the implementations are.

Matsemann commented 7 years ago

Actually I can see now that I included the .dll files in the lib folder in this repo, so pointing to those should fix your build issues.

Timebutt commented 7 years ago

Hi @Matsemann, thanks for the hint, I somehow looked over it but my project is building correctly now. I'll close this issue.

One further question: can you confirm it is normal behaviour that the values in vJoyMonitor never exceed a very low value (as described in the first screenshot in my first post)? This is the reason why I want to take a look at the source code, I figure a lot more of the available range should be used.

Timebutt commented 7 years ago

What I am referring to is this piece of code:

sdf

If I multiply the values by 16, I have the maximal range available when inspecting with vJoyMonitor (see screenshot). What is the exact reason that you keep these values between 0 and 2000? When using the full range of values, you can still calibrate the sticks in the simulator software, maybe even with a more accurate result?

capture

Timebutt commented 7 years ago

Further thought: doing this fix solved the issue I was having with QGroundControl and my AirSim (very interesting simulator, highly recommended) setup.

Without this bigger range of values, I couldn't calibrate the sticks in QGroundControl and couldn't use the sticks. Only after this fix, could I see the sticks move and calibrate everything correctly, so now it works! Using this controller is FAR superior to my very noisy PS3 controller.

Only problem that still remains, is that I can't start mDJIController before starting QGroundControl (see this issue). If I start the mDJIController after starting my entire AirSim + QGroundControl setup, everything is fine. Hoping that someone will have a look at that issue and fix that small nuisance.

Matsemann commented 7 years ago

Cool that you got it to work. :)

I just added to the values for them to not be negative, and then it worked for my setup. So no other reason than that. So if this works better for you then that's great!