Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Benoit Rousselle
bliss
Commits
95b8c7da
Commit
95b8c7da
authored
Nov 07, 2016
by
Alejandro Homs Puron
Committed by
bliss administrator
Nov 07, 2016
Browse files
Emotion: refactor variables in Axis.prepare_move
parent
51934e36
Changes
1
Hide whitespace changes
Inline
Side-by-side
bliss/common/axis.py
View file @
95b8c7da
...
...
@@ -645,20 +645,19 @@ class Axis(object):
def
prepare_move
(
self
,
user_target_pos
,
relative
=
False
):
"""Prepare a motion. Internal usage only"""
elog
.
debug
(
"user_target_pos=%g, relative=%r"
%
(
user_target_pos
,
relative
))
user
_initial_
dial_
pos
=
self
.
dial
()
dial
_initial_pos
=
self
.
dial
()
hw_pos
=
self
.
_read_dial_and_update
()
elog
.
debug
(
"hw_position=%g
user
_initial_
dial_
pos=%g"
%
(
hw_pos
,
user
_initial_
dial_
pos
))
elog
.
debug
(
"hw_position=%g
dial
_initial_pos=%g"
%
(
hw_pos
,
dial
_initial_pos
))
if
abs
(
user
_initial_
dial_
pos
-
hw_pos
)
>
self
.
tolerance
:
if
abs
(
dial
_initial_pos
-
hw_pos
)
>
self
.
tolerance
:
raise
RuntimeError
(
"%s: discrepancy between dial (%f) and controller position (%f), aborting"
%
(
self
.
name
,
user
_initial_
dial_
pos
,
hw_pos
))
self
.
name
,
dial
_initial_pos
,
hw_pos
))
if
relative
:
user_target_pos
+=
self
.
_set_position
()
user_initial_pos
=
self
.
dial2user
(
user_initial_dial_pos
)
dial_initial_pos
=
self
.
user2dial
(
user_initial_pos
)
user_initial_pos
=
self
.
dial2user
(
dial_initial_pos
)
dial_target_pos
=
self
.
user2dial
(
user_target_pos
)
self
.
_set_position
(
user_target_pos
)
if
abs
(
dial_target_pos
-
dial_initial_pos
)
<
1E-6
:
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment