Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   Programming (http://www.chiefdelphi.com/forums/forumdisplay.php?f=51)
-   -   Robot Drifting (http://www.chiefdelphi.com/forums/showthread.php?t=25212)

The Lucas 15-02-2004 00:42

Re: Robot Drifting
 
Quote:

Originally Posted by Mark McLeod
Sadly, HuCDAVS have been ruled illegal by FIRST during autonomous mode.;)

I will note that we don't usually apply this software fix when our HuCDAVS is operable.

How about just using a gyro to keep a true bearing durng autonomous. Otherwise, I'm with John, HuDAVS is the way to go. You are just limiting your total drive train power with any other method.

Mark McLeod 15-02-2004 12:00

Re: Robot Drifting
 
Quote:

Originally Posted by steven114
Might I point out that 150/100 will evaluate to 1, not 1.5... there is no way to store a floating point number in an integer. You can hack around it by storing an exponent, but I don't believe setting myInt to 150/100 will store 1.5...

#define's don't evaluate expressions.
You don't evaluate (150/100). You evaluate (x * 150 / 100).
To get a floating point effect you do all your multiplication first, then all your division.

In integer math,e.g.,

x = 150/100 * 100 = 100
but
x = 100 * 150 / 100 = 150

Just be careful to type cast the expression to the largest size you need, e.g., using all char for the above will return an incorrect result.

Phil_Lutz 15-02-2004 12:13

Re: Robot Drifting
 
You Constant (#define) can be a floating point value.
but....
when you apply it in your program the result will be an int.
ie.

#define CONSTANT 1.5

int adjust_speed(int speed_in)
(
int speed_out;
speed_out = (speed_in/CONSTANT);
return speed_out; //sends back an int
)

Mark McLeod 15-02-2004 12:35

Re: Robot Drifting
 
Quote:

Originally Posted by The Lucas
How about just using a gyro to keep a true bearing durng autonomous. Otherwise, I'm with John, HuDAVS is the way to go. You are just limiting your total drive train power with any other method.

We use three methods: a gyro, the IR, and shaft encoders to maintain heading, position, and orientation during autonomous, but that doesn't help teams that don't have them. The method I suggest is for teams without any of these. It's essential if you are using true dead-reckoning.

We don't use any of them during driving mode, although we do sometimes modify the power curve to give more range at the low-end.

There are lots of answers and you'll see as many software solutions as robot solutions to FIRSTs game. It's part of what makes it all so interesting.:cool:

deltacoder1020 15-02-2004 21:49

Re: Robot Drifting
 
Quote:

Originally Posted by Phil_Lutz
You Constant (#define) can be a floating point value.
but....
when you apply it in your program the result will be an int.
ie.

#define CONSTANT 1.5

int adjust_speed(int speed_in)
(
int speed_out;
speed_out = (speed_in/CONSTANT);
return speed_out; //sends back an int
)

however, the floating-point constant forces the processor to do floating point math, which is slower. in this case, using
Code:

#define CONSTANT 3/2
is better, because the processor can use integer math, which is faster.


All times are GMT -5. The time now is 00:02.

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