当前位置: 首页>>代码示例>>Python>>正文


Python Path.backlash_reset方法代码示例

本文整理汇总了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
开发者ID:quillford,项目名称:redeem,代码行数:48,代码来源:PathPlanner.py

示例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
开发者ID:morriswinkler,项目名称:redeem-scara,代码行数:80,代码来源:PathPlanner.py


注:本文中的Path.Path.backlash_reset方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。