本文整理匯總了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.