Skip to content

Focus backend updates - precise focus position and other tweaks

Alex requested to merge branch/focus into branch/lua_fix


Exposed the focus motor position counter (relative) to lens_info.focus_pos (or, in Lua, lens.focus_pos). This counter has some nice properties: it appears to be the motor encoder output, as it doesn't lose track of its position, as long as the focus ring is moved by the internal motor.

TODO: combine motor position (high-res, relative, unknown origin, may lose position with MF) with focus distance reports (low-res, absolute, direction-dependent, probably with good repeatability) to get a precise estimation of the focus distance.

Also fixed a bug where the lens may get stuck at some endpoint, especially at low speed, even if you tell the lens to move away from that endpoint. This might also help with issue #2452 (not tested).

EOS M: refactored some code - are the focus ring triggers (for magic zoom and 5x/10x zoom) still working?

Note: on EOS M and 6D, the location of this counter is unknown, so I need some help with reverse engineering (just print the contents of PROP_LV_LENS and find out which offset contains the focus motor position). The current state would break the 6D and EOS M builds.

Merge request reports