|
|
|
![]() |
|
|||||||
|
||||||||
|
|
Thread Tools | Rate Thread | Display Modes |
|
#31
|
|||
|
|||
|
Re: Unique ways of controlling your robot (driving)
Part of training drivers is giving them multiple options to steer the bot. We programmed our controller so if you hit a button, it switches between different drive modes. This made it so anyone could practice any mode they wanted to just by hitting a button, not by reprogramming the robot.
One reason why I made this thread was also show off their actual programming for controlling their bots. I'm very interested in what other programmers decided to do. I've always liked unique ways of doing things, not for the sake of being different, but being inovative. Inovation means something new and because I'm new to programming new is all I know. If anyone is willing to explain or share their code so I can study it and learn from what other people do, that would be great. The drive mode my team uses in the competition was developped from an algorithm. When I was thinking of better ways of controlling the bot, I thought a single joystick mode would be definately better than the 2 joystick tank control. I like algoritms better than plotting points on the joystick. It's more clean in my opinion and easier to reprogram. I thought of how the robot should moving according to the position the joystick is in. If I push it forward, it goes farward. The more I push farward the faster it should go. What if I push the joystick diagnal so it's in the top left corner? I think the robot should turn gradually left in a wide arc. So, I looked at motor speeds and plotted them onto a graph. forwards (255, 255) backwards (0,0) arc left (127, 255) arc right (255, 127) 255 the motors will be spinning full clockwise. 127 the motors will not be spinning. 0 the motors will be spinning full counterclockwise. And so on... I eventually discovered a cool way of doing this based on this... On the joystick y-axis would run from bottom to top where bottom is 0 and top is 255. On the joystick x-axis would run from left to right where left is 0 and right is 255. leftMotors = -127 + (y-axis + x-axis) rightMotors = -127 + (y-axis + oposite of the x-axis (x-axis mirrored)) oposite of the x-axis means that if on the x axis it were really 255, it would count as 0 in the code. Last edited by AmoryG : 07-04-2008 at 12:51. |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| surefire ways to break you robot | XXShadowXX | General Forum | 159 | 06-02-2009 19:03 |
| Whats unique about your website? | Trashed20 | Website Design/Showcase | 7 | 26-11-2002 13:50 |
| Controlling a FIRST robot with a Lego RCX Controller? | archiver | 2001 | 5 | 24-06-2002 04:19 |
| Favorite NEW unique aspect of a robot | archiver | 2001 | 1 | 24-06-2002 03:57 |
| What's unique about your Regional? | Digo | Regional Competitions | 11 | 14-04-2002 14:37 |