![]() |
Python: TypeError: unorderable types: complex() > float()?
Hi! We have a problem when trying to sqaure root our contoller's left and right axis for a nice speed curve. The error message is:
Code:
TypeError: unorderable types: complex() > float()Code:
self.robot_drive.arcadeDrive(cmath.sqrt(self.joystick.getX()),cmath.sqrt(self.joystick.getX())) |
Re: Python: TypeError: unorderable types: complex() > float()?
Shot in the dark guess: taking the square root of getX(), which can sometimes be negative, will give you an imaginary value. You need some way to avoid that and only produce real numbers for arcadeDrive().
|
Re: Python: TypeError: unorderable types: complex() > float()?
Quote:
|
Re: Python: TypeError: unorderable types: complex() > float()?
Quote:
|
Re: Python: TypeError: unorderable types: complex() > float()?
Quote:
|
Re: Python: TypeError: unorderable types: complex() > float()?
Quote:
Code:
self.robot_drive.arcadeDrive(self.joystick.getX(), self.joystick.getX(), true)Code:
if squaredInputs: |
| All times are GMT -5. The time now is 02:41. |
Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi