Linear position sensor for mobile hydraulics