本文整理汇总了Python中Path.Path.backlash_reset方法的典型用法代码示例。如果您正苦于以下问题:Python Path.backlash_reset方法的具体用法?Python Path.backlash_reset怎么用?Python Path.backlash_reset使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Path.Path
的用法示例。
在下文中一共展示了Path.backlash_reset方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: home
# 需要导入模块: from Path import Path [as 别名]
# 或者: from Path.Path import backlash_reset [as 别名]
def home(self, axis):
""" Home the given axis using endstops (min) """
logging.debug("homing " + str(axis))
# Home axis for core X,Y and H-Belt independently to avoid hardware
# damages.
if Path.axis_config == Path.AXIS_CONFIG_CORE_XY or \
Path.axis_config == Path.AXIS_CONFIG_H_BELT:
for a in axis:
self._home_internal(a)
# For delta, switch to cartesian when homing
elif Path.axis_config == Path.AXIS_CONFIG_DELTA:
if 0 < len({"X", "Y", "Z"}.intersection(set(axis))) < 3:
axis = list(set(axis).union({"X", "Y", "Z"})) # Deltas must home all axes.
Path.axis_config = Path.AXIS_CONFIG_XY
path_center, speed = self._home_internal(axis)
Path.axis_config = Path.AXIS_CONFIG_DELTA
# homing was performed in cartesian mode
# need to convert back to delta
Az = path_center['X']
Bz = path_center['Y']
Cz = path_center['Z']
z_offset = Delta.vertical_offset(Az,Bz,Cz) # vertical offset
xyz = Delta.forward_kinematics2(Az, Bz, Cz) # effector position
xyz[2] += z_offset
path = {'X':xyz[0], 'Y':xyz[1], 'Z':xyz[2]}
p = G92Path(path, speed)
self.add_path(p)
self.wait_until_done()
else:
self._home_internal(axis)
# go to the designated home position
self._go_to_home(axis)
# Reset backlash compensation
Path.backlash_reset()
logging.debug("homing done for " + str(axis))
return
示例2: home
# 需要导入模块: from Path import Path [as 别名]
# 或者: from Path.Path import backlash_reset [as 别名]
def home(self, axis):
""" Home the given axis using endstops (min) """
logging.debug("homing " + str(axis))
# Home axis for core X,Y and H-Belt independently to avoid hardware
# damages.
if Path.axis_config == Path.AXIS_CONFIG_CORE_XY or \
Path.axis_config == Path.AXIS_CONFIG_H_BELT:
for a in axis:
self._home_internal(a)
# For delta, switch to cartesian when homing
elif Path.axis_config == Path.AXIS_CONFIG_DELTA:
if 0 < len({"X", "Y", "Z"}.intersection(set(axis))) < 3:
axis = list(set(axis).union({"X", "Y", "Z"})) # Deltas must home all axes.
Path.axis_config = Path.AXIS_CONFIG_XY
path_center, speed = self._home_internal(axis)
Path.axis_config = Path.AXIS_CONFIG_DELTA
# homing was performed in cartesian mode
# need to convert back to delta
Az = path_center['X']
Bz = path_center['Y']
Cz = path_center['Z']
z_offset = Delta.vertical_offset(Az,Bz,Cz) # vertical offset
xyz = Delta.forward_kinematics2(Az, Bz, Cz) # effector position
xyz[2] += z_offset
path = {'X':xyz[0], 'Y':xyz[1], 'Z':xyz[2]}
p = G92Path(path, speed)
self.add_path(p)
self.wait_until_done()
# For scar, switch also to cartesian when homing
elif Path.axis_config == Path.AXIS_CONFIG_SCARA:
# TODO: implement individual homing ( needs to take care of position after homing)
if 0 < len({"X", "Y", "Z"}.intersection(set(axis))) < 3:
axis = list(set(axis).union({"X", "Y", "Z"})) # For now Scaras must home all axes. Than can changed
Path.axis_config = Path.AXIS_CONFIG_XY
path_center, speed = self._home_internal(axis)
Path.axis_config = Path.AXIS_CONFIG_SCARA
# homing was performed in cartesian mode
# need to convert back to delta
A = path_center['X']
B = path_center['Y']
C = path_center['Z']
#z_offset = Delta.vertical_offset(Az,Bz,Cz) # vertical offset
# xyz = Scara.inverse_kinematics(A, B, C) # effector position
# logging.debug("HomeXYZ: %s", xyz)
#xyz[2] += z_offset
# don't cpnvert home_pos to effector spac
# home offset is defined in cartesian space
# xyz = np.array([path_center['X'], path_center['Y'], path_center['Z']])
#path = {'X':xyz[0], 'Y':xyz[1], 'Z':xyz[2]}
path = {A, B, C}
p = G92Path(path, speed)
self.add_path(p)
self.wait_until_done()
else:
self._home_internal(axis)
# go to the designated home position
self._go_to_home(axis)
# Reset backlash compensation
Path.backlash_reset()
logging.debug("homing done for " + str(axis))
return