Quote:
Originally Posted by team-4480
How would you square negatives? Thanks!
|
RobotDrive has support for this built in, so you should be able to just use this:
Code:
self.robot_drive.arcadeDrive(self.joystick.getX(), self.joystick.getX(), true)
This is how it is done internally:
Code:
if squaredInputs:
# square the inputs (while preserving the sign) to increase fine
# control while permitting full power
if moveValue >= 0.0:
moveValue = (moveValue * moveValue)
else:
moveValue = -(moveValue * moveValue)
if rotateValue >= 0.0:
rotateValue = (rotateValue * rotateValue)
else:
rotateValue = -(rotateValue * rotateValue)