|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
|
|
Thread Tools | Rate Thread | Display Modes |
|
|
|
#1
|
||||
|
||||
|
Re: Kiwi Field Oriented Driving Programming
Quote:
What does your initialization process consist of? Are you moving the robot during initialization? Have you created a process to "re-zero" the gyro? |
|
#2
|
|||
|
|||
|
Re: Kiwi Field Oriented Driving Programming
Very helpful thread, thank you. However I have one question, in: "y = -j_x * sin(theta) + j_j * cos(theta)" what is "j_j" meant to represent?
|
|
#3
|
||||
|
||||
|
Re: Kiwi Field Oriented Driving Programming
That should be j_y.
|
|
#4
|
|||
|
|||
|
Re: Kiwi Field Oriented Driving Programming
Last edited by L1TH1UM : 25-05-2015 at 14:45. |
|
#5
|
|||||
|
|||||
|
Re: Kiwi Field Oriented Driving Programming
Using Jared's code, and assuming Ether's clarifications are correct, j_y is positive "forward", and a counterclockwise-positive gyroscope:
Quote:
Quote:
Quote:
Code:
biggest = max(abs(wheel1),abs(wheel2),abs(wheel3))
if (biggest > 1.0) {
wheel1 = wheel1 / biggest
wheel2 = wheel2 / biggest
wheel3 = wheel3 / biggest
}
|
|
#6
|
||||
|
||||
|
Re: Kiwi Field Oriented Driving Programming
The strange behavior described could be because of an issue with degrees and radians or possibly because the code is looking at angular rate instead of the angle.
We might be able to help more if you post a video of what's happening. |
|
#7
|
|||||
|
|||||
|
Re: Kiwi Field Oriented Driving Programming
An even cleaner way to limit speeds:
Code:
biggest = max(1.0, abs(wheel1), abs(wheel2) ,abs(wheel3)) wheel1 = wheel1 / biggest wheel2 = wheel2 / biggest wheel3 = wheel3 / biggest If you want to make the controls less sensitive at small deflections of the joysticks, you can change 1.0 in the first line for 1.5 or 2.0 or even as high as 2.414 (1 + sqrt(2)), which appears to be the highest number that can come out of the previous transformations. And yes, using degrees and radians incorrectly could cause discontinuities, esp. at the transition through 0. Last edited by GeeTwo : 25-05-2015 at 20:32. |
|
#8
|
||||
|
||||
|
Re: Kiwi Field Oriented Driving Programming
Doesn't this procedure make it so that even the slightest input will give full throttle? I mean sure it scales it appropriately now but What if you only wanted the wheels to run at say 0.1, 0.05, 0.05 ? Now this scales it to 1, 0.5, 0.5
|
|
#9
|
||||
|
||||
|
Re: Kiwi Field Oriented Driving Programming
Quote:
GeeTwo's code: Code:
biggest = max(1.0, abs(wheel1), abs(wheel2) ,abs(wheel3)) wheel1 = wheel1 / biggest wheel2 = wheel2 / biggest wheel3 = wheel3 / biggest |
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|