Commit d7129a94 authored by Sebastien Petitdemange's avatar Sebastien Petitdemange
Browse files

Merge branch 'fix_issue_72' into 'master'

Fix issue 72

Closes #72

See merge request !385
parents 2445df6f 4a52fb31
......@@ -318,7 +318,10 @@ class Axis(object):
Returns:
float: dial encoder position
"""
return self.__controller.read_encoder(self.encoder) / self.encoder.steps_per_unit
if self.encoder is not None:
return self.encoder.read()
else:
raise RuntimeError("Axis '%s` has no encoder." % self.name)
def __do_set_dial(self, new_dial, no_offset):
user_pos = self.position()
......
......@@ -441,3 +441,8 @@ def test_jog2(jogger):
assert jogger._hw_position() == pytest.approx(300+jogger.acceleration()*0.5*jogger.acctime()**2, 1e-2)
jogger.stop()
def test_measured_position(m1, roby):
assert m1.measured_position() == m1.position()
with pytest.raises(RuntimeError):
roby.measured_position()
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment