|
|
|
![]() |
|
|||||||
|
||||||||
|
|
Thread Tools | Rate Thread | Display Modes |
|
#24
|
|||
|
|||
|
Re: Offseason Project: Holonomic Kiwi Drive Robot
Okay, thanks. We're using the FTC stuff - an NXT programmed with RobotC - Do the FPGA issues apply to that, as well?
Okay - I think I may have found the issue. I was watching the variables and noticed at position (127,0) on the joystick, W1 and W2 were being sent 0's. The Joystick was scaled by dividing by 1.28 (Because 128 was the maximum negative value) The code I used is: Code:
W1 = (- 1/2 * 99) - (sqrt(3)/2 * 0) Code:
W1 = ((-1 * (1/2)) * 99) - (((sqrt(3))/2) * 0) I dove a bit deeper - I tried each individual expression. Code:
float test = -1/2;
writeDebugStreamLine("%d", test);
Then, Code:
float test = -.5;
writeDebugStreamLine("%d", test);
sqrt(3)/2 returned 1063105496 - Any idea what the problem is? EDIT 2: Tested the sample math program, everything worked. It printed to the NXT screen, so I told it to print to the debug stream as well - lo and behold, something mucked up the numbers in between. I changed the code on the NXT to be -.5 instead of -1/2 and it works fine now - Why is that? Last edited by EthanMiller : 11-05-2011 at 10:39. Reason: Did more testing, here's the results. |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|