Focus Ramping now supported with the Fuji X-T2

I've been doing testing this week with the Fuji X-T2 and have focus control working very well with it! 

The way focus is controlled via USB with Fuji differs a bit from Canon and Nikon.  With both Canon on Nikon, there's no way to query the current position of the focus, and there's no feedback if it hits a limit.  There are simply relative move commands that tell the camera to move the focus farther or nearer, and nothing else.  Working with this, the VIEW internally tracks focus position and sends the camera relative commands, which works well as long as you don't end up hitting the limits during setup (since if you do, the VIEW will have no way of knowing the focus didn't move, so the internally tracked position will be incorrect, and you'll need to start again with the setup).

Fuji is different -- in fact, it doesn't even have relative move commands.  Instead, the current position can be queried and the focus move command sends an absolute position to focus to. This sounds wonderful, but it also has its own set of quirks.  For one, when an absolute position is sent, it may not reach it exactly -- it will often overshoot, especially if moving a very small amount or very large amount.  To work around this, I query the position right after sending the move command and if it's not on target, I send the same absolute position command again until it hits it.

Since the VIEW internally expects the focus to be moved by relative amounts, for Fuji I query the current position and then add the relative move to that to determine the absolute target.  This ended up revealing another oddity: sometimes after taking a picture, the camera's focus position is very slightly different.  I don't know why, but about one out of three times, the queried focus position before and after a capture would vary by up to 5 steps.  This was an issue since the relative move would compound the incorrect position reading post-capture.  I work around this by caching the last absolute point from before the capture to base the next relative move on.  This works very well now and holds the position very accurately.  These are the kind of things I never expect to take so much time!

Below is a demo of how this is used and setup.  Note that this also works with most Canon and Nikon cameras.

And here's the resulting clip showing the motion and focus ramping:

Firmware with X-T2 support will be released in the next day or two as v1.8-beta11.