Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   Java (http://www.chiefdelphi.com/forums/forumdisplay.php?f=184)
-   -   Robot going backwards! (http://www.chiefdelphi.com/forums/showthread.php?t=89899)

will_1359 23-01-2011 16:34

Robot going backwards!
 
I've put the line tracking code into my robot, but it keeps going backwards whether I invert the motors or not. Could this be because it uses arcadeDrive while the rest of my code uses tankDrive? If so, how can I fix it? If not, what else could it be and how can I fix it?

Robby Unruh 23-01-2011 16:43

Re: Robot going backwards!
 
Quote:

Originally Posted by will_1359 (Post 1006575)
I've put the line tracking code into my robot, but it keeps going backwards whether I invert the motors or not. Could this be because it uses arcadeDrive while the rest of my code uses tankDrive? If so, how can I fix it? If not, what else could it be and how can I fix it?

You should use the drive(speed, curve) function, since a joystick isn't actually being used in the tracking code.

will_1359 23-01-2011 16:52

Re: Robot going backwards!
 
Do you mean that I should be able to use the arcade drive thing anyway? Or do I need to change that?

BradAMiller 23-01-2011 17:00

Re: Robot going backwards!
 
Quote:

Originally Posted by will_1359 (Post 1006575)
I've put the line tracking code into my robot, but it keeps going backwards whether I invert the motors or not. Could this be because it uses arcadeDrive while the rest of my code uses tankDrive? If so, how can I fix it? If not, what else could it be and how can I fix it?

Are you sure that removing the code to invert the motors didn't change the robot direction? You can also change the sign of the computed robot speed in the code and that should also flip the direction.

The use of the arcade vs. tank functions don't stick, they just set the speeds at that moment based on the parameters passed.

will_1359 23-01-2011 17:05

Re: Robot going backwards!
 
Quote:

Originally Posted by BradAMiller (Post 1006592)
Are you sure that removing the code to invert the motors didn't change the robot direction? You can also change the sign of the computed robot speed in the code and that should also flip the direction.

The use of the arcade vs. tank functions don't stick, they just set the speeds at that moment based on the parameters passed.

I tried inverting the motors, and I tried changing the sign. Neither one worked.

I didn't think that the use of arcade vs. tank would matter, but I wanted to make sure.

Do you have any other suggestions?

jhersh 24-01-2011 02:33

Re: Robot going backwards!
 
If you are changing each of these things (only one at a time, I hope, since changing both would double negate and wind back up where you started), then perhaps we need to consider that you are changing the code in the wrong place. Can you post the code you're using and note where you and making these changes?

-Joe


All times are GMT -5. The time now is 22:16.

Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi