Exemplo n.º 1
0
def SetPosPID(motor_sel, position):
	AccessRoboclaw()
	speed, accel = 1000,2000 # maybe fine tune these
	if motor_sel[1] == 1:
		# SetM1PositionPID(motor_sel[0], kp, ki, kd, kimax, deadzone, limits[0], limits[1])
		roboclaw.SpeedAccelDeccelPositionM1(motor_sel[0], accel, speed, accel, position, 1)
	elif motor_sel[1] == 2:
		roboclaw.SpeedAccelDeccelPositionM2(motor_sel[0], accel, speed, accel, position, 1)
	else:
		raise NotImplementedError
Exemplo n.º 2
0
 def drive_position(self, motor, position, buffer=False):
     if self.motor_num[motor] == 1:
         out = roboclaw_driver.SpeedAccelDeccelPositionM1(
             self.address[motor], self.acceleration[motor],
             self.speed[motor], self.decceleration[motor], position, buffer)
     else:
         out = roboclaw_driver.SpeedAccelDeccelPositionM2(
             self.address[motor], self.acceleration[motor],
             self.speed[motor], self.decceleration[motor], position, buffer)
     return out