![]() |
One joystick drive
Hi,
I'm trying to get something better than the default one joystick drive, but I don't really understand the concept of turning the x and y joystick values into values for each wheel motor (2 motors). I'm planning on doing something along the lines of using a lookup table to make the robot more handlable, using thisa function instead of a look up table: Code:
long ramping (unsigned char ramp)Thanks edit - sorry for the typo in the name of the thread, I can't change it. |
Re: One joystink drive
Sure. What you should end up having is code that looks like this:
Code:
// on our joystick the x values were invertedthe left and right values go through a typical 1-joystick function. Then you just assign those values to your motors. |
Re: One joystink drive
DO you want the explanation of the one joystick formula... how they are derived? It's a bit long winded but not complicated. If that's what you want I can post it.
The function you are showing creates a curve based on the cubic values of the inputs. This makes the joystick less sensitive to start up and more sensitive once the bot is going. Not sure you can "improve" on the one joystick formulas but you can customize them. |
Re: One joystink drive
Quote:
Next you need to know what Limit_Mix function does. It takes a value and bounds it to be between 2000 and 2254, the subtracts 2000, and returns a value from 0 to 254. The first call to Limit_Mix is Code:
int left = (int)Limit_Mix(2000 + nSpeed + nTurn - 127);The next call to Limit_Max is Code:
int right = (int)Limit_Mix(2000 + nSpeed - nTurn + 127);I know this was complicated, but does it sort of make sense? |
Re: One joystink drive
That makes perfect sense! After running that Limit_Mix logic through my head with the joystick in each direction it's really quite simple :)
|
| All times are GMT -5. The time now is 00:59. |
Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi