本文整理汇总了Python中pid.PID属性的典型用法代码示例。如果您正苦于以下问题:Python pid.PID属性的具体用法?Python pid.PID怎么用?Python pid.PID使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类pid
的用法示例。
在下文中一共展示了pid.PID属性的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: reset
# 需要导入模块: import pid [as 别名]
# 或者: from pid import PID [as 别名]
def reset(self):
self.xerror = 0
self.yerror = 0
self.controllerX = pid.PID()
self.controllerY = pid.PID()
self.controllerX.SetKp(25.0)
self.controllerX.SetKi(0.0)
self.controllerY.SetKp(25.0)
self.controllerY.SetKi(0.0)
self.x_correction = 0
self.y_correction = 0
self.prev_gray = None
self.tracks = []
self.draw_trails = True
self.xerror = 0
self.yerror = 0
self.last_command = 0
self.frame = None
self.queue = Queue(maxsize=1)
示例2: __init__
# 需要导入模块: import pid [as 别名]
# 或者: from pid import PID [as 别名]
def __init__(self, port):
self.i2c = i2c_bus.get(i2c_bus.M_BUS)
self._available()
self.port = port - 1
self.prev_enc_val = 0
self.interval = 0
self.sample_interval = 10
self.enc_zero = 0
self.input_value = 0
self.speed_pid = PID(p=50, i=0, d=60)
self.speed_point = None
self.angle_pid = PID(p=8, i=0, d=30)
self.angle_point = None
self.angle_max_pwm = 255
self.encode_zero = 0
self.encode_clear()
示例3: _getTransform
# 需要导入模块: import pid [as 别名]
# 或者: from pid import PID [as 别名]
def _getTransform(self, target_frame, source_frame):
if self.listener.frameExists(target_frame) and self.listener.frameExists(source_frame):
t = self.listener.getLatestCommonTime(target_frame, source_frame)
result, other = self.listener.lookupTransform(target_frame, source_frame, t)
return result, other
# This function calls the reset function for all the PID controllers.