|
Re: Sample code for Windriver needed (FRC)
Quote:
Originally Posted by pacerobotics
Help Please!!!
Thanks
|
I've posted a complete C++ program here: http://www.chiefdelphi.com/forums/sh...11#post1024111
It incl. arcade drive, I understand you want to write your own drive code. The code shows how to read (obtain) the values from a joystick and drive a Jaguar/Victor with that value. Joysticks give a value between 1.0 and -1.0, inclusive, in the X, Y, and Z axies. (The Z axis is the throttle thing at the base of the JS.)
Victors and Jaguars accept values -1.0 <= x <= 1.0. The direction of rotation is a function of how the motor is wired and the nature of the gearbox.
The algebra in between the JS and the Jaguar is up to you :-)
Whenever you change the drive code (incl. the first version) YOU MUST TEST WITH YOUR ROBOT ON BLOCKS with the wheels off the ground. There's a real risk of the motors being powered other than as you expect and the robot smashing into an object - I've seen it happen.
__________________
Silicon Valley Regional 2005, 2006 972
Silicon Valley Regional 2007 668 Xerox Creativity Award
Championship Event 2007 668
Portland Regional 2008 668
Silicon Valley Regional 2008 668, 972
Beta Test Team 2008 668 (with 100 & 254)
Silicon Valley Regional 2009 668 Regional Chairman's Award; 2643
Sacramento Regional 2009 668 Winning Alliance (thanks, 1717 & 2473!), 2010 Winning Alliance 3256
CalGames 2006, 2007, 2008, 2009, 2010, 2011 Field Tech
NorCal FTC Regional 2008, 2009 Inspector
Championship Event 2009
San Diego, Silicon Valley Regionals; Champ. Event 2010 668, 2643, 3256
Silicon Valley, Madera Regional 2012 2643
WRRF Programming Instructor 2006-2016
Regional Woodie Flowers Award 2014 2643 Utah Regional
|