Go to Post I joined because I needed something to complete my nerdyness and I never regretted it. - Regine [more]
Home
Go Back   Chief Delphi > Technical > Programming > Java
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Reply
 
Thread Tools Rating: Thread Rating: 4 votes, 5.00 average. Display Modes
  #1   Spotlight this post!  
Unread 11-11-2014, 22:51
lamk lamk is offline
Ken Lam
FRC #4719
Team Role: Mentor
 
Join Date: Jan 2014
Rookie Year: 2014
Location: Calgary
Posts: 69
lamk is just really nicelamk is just really nicelamk is just really nicelamk is just really nice
Re: Logitech F310 Control Scheme Help

Quote:
Originally Posted by JamieKilburn View Post
Hi! For our controllers, we use the left stick to control forward/backward, and right stick to control left/right movement. Is this something similar to what you want? A sample implementation of this could be something along the lines of
Code:
 leftSpeed = y-x; 
rightSpeed = y+x; 
//y = Y axis of left joystick
//x = X axis of right joystick
If you have any other questions, please ask away!
Mr. Lim (Mentor of Jamie's team) called it the Kaj Drive.
"Kaj refers to Kajeevan, a long-standing and well-decorated former driver for 188 who pushed hard for this drive layout as a grade 9 driver, and used it to great effect ever since."
Here's the code written by one of his student.
Note how Mr. Lim's student decrease the midstick sensitivivty by using x^5:
Code:
//DRIVETRAIN--------------------------------------------------------------------------------------------
            
            //kaj drive (max forward and back = 90%)
            //          (max left and right = 75%)
            jagLeft.setX(-0.9 * (driverStick.getRawAxis(6) * driverStick.getRawAxis(6) * driverStick.getRawAxis(6) * driverStick.getRawAxis(6) * driverStick.getRawAxis(6))
                                 + 0.75 * (driverStick.getRawAxis(3) * driverStick.getRawAxis(3) * driverStick.getRawAxis(3) * driverStick.getRawAxis(3) * driverStick.getRawAxis(3)));
            jagRight.setX(-0.9 * (driverStick.getRawAxis(6)* driverStick.getRawAxis(6) * driverStick.getRawAxis(6) * driverStick.getRawAxis(6) * driverStick.getRawAxis(6))
                                 - 0.75 * (driverStick.getRawAxis(3) * driverStick.getRawAxis(3) * driverStick.getRawAxis(3)* driverStick.getRawAxis(3) * driverStick.getRawAxis(3)));
https://code.google.com/p/crescent-c...svn644&r=64 4
__________________

Last edited by lamk : 11-11-2014 at 22:57.
Reply With Quote
  #2   Spotlight this post!  
Unread 12-11-2014, 08:28
JamieKilburn JamieKilburn is offline
Registered User
FRC #0610 (The Coyotes)
Team Role: Driver
 
Join Date: Nov 2014
Rookie Year: 2013
Location: Toronto, Ontario
Posts: 15
JamieKilburn has a spectacular aura aboutJamieKilburn has a spectacular aura about
Re: Logitech F310 Control Scheme Help

Quote:
Originally Posted by lamk View Post
Mr. Lim (Mentor of Jamie's team) called it the Kaj Drive.
"Kaj refers to Kajeevan, a long-standing and well-decorated former driver for 188 who pushed hard for this drive layout as a grade 9 driver, and used it to great effect ever since."
Here's the code written by one of his student.
Note how Mr. Lim's student decrease the midstick sensitivivty by using x^5:
Code:
//DRIVETRAIN--------------------------------------------------------------------------------------------
            
            //kaj drive (max forward and back = 90%)
            //          (max left and right = 75%)
            jagLeft.setX(-0.9 * (driverStick.getRawAxis(6) * driverStick.getRawAxis(6) * driverStick.getRawAxis(6) * driverStick.getRawAxis(6) * driverStick.getRawAxis(6))
                                 + 0.75 * (driverStick.getRawAxis(3) * driverStick.getRawAxis(3) * driverStick.getRawAxis(3) * driverStick.getRawAxis(3) * driverStick.getRawAxis(3)));
            jagRight.setX(-0.9 * (driverStick.getRawAxis(6)* driverStick.getRawAxis(6) * driverStick.getRawAxis(6) * driverStick.getRawAxis(6) * driverStick.getRawAxis(6))
                                 - 0.75 * (driverStick.getRawAxis(3) * driverStick.getRawAxis(3) * driverStick.getRawAxis(3)* driverStick.getRawAxis(3) * driverStick.getRawAxis(3)));
https://code.google.com/p/crescent-c...svn644&r=64 4


Yep, for Kaj Drive we usually cube it to smoothen the sensitivity. Another example of it is:
Code:
  
        //Create variables for x, y, right speed and the left speed
        double rightSpeed, leftSpeed, x, y;
        //Set x and y to their axis values
        x = driver.getRawAxis(InputConstants.rightXAxis);
        y = driver.getRawAxis(InputConstants.leftYAxis);
        //Drive Smoothing

        //Set the left and rightspeed using x and y
        leftSpeed = y - x;
        rightSpeed = y + x;
        

        //Set the left and right side of the drive
        driveTrain.setLeftVBus(-leftSpeed);
        driveTrain.setRightVBus(-rightSpeed);
If you have any questions about Kaj, ask away!
Reply With Quote
Reply


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -5. The time now is 11:02.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi