Go to Post He is just one of the dozens of evil minions I have molded into my image over the years. Be afraid world, be very afraid. - Andy Grady [more]
Home
Go Back   Chief Delphi > Technical > Programming
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Closed Thread
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 29-01-2008, 18:42
greatman05 greatman05 is offline
Registered User
AKA: Chavez Clemons Jr.
FRC #2224 (Phoenix Phenoms)
Team Role: Mentor
 
Join Date: Jan 2008
Rookie Year: 2006
Location: Detroit, MI
Posts: 32
greatman05 is an unknown quantity at this point
Send a message via AIM to greatman05 Send a message via MSN to greatman05 Send a message via Yahoo to greatman05
Lightbulb Joystick Programming

Hello. Does the FRC default code allow 2 joysticks to be used? Also, is there any way to adjust the sensitivity of the controllers, or the speed of the motors?
  #2   Spotlight this post!  
Unread 29-01-2008, 18:50
MiniNerd24's Avatar
MiniNerd24 MiniNerd24 is offline
Are you going to eat that?
FRC #2039 (Rockford Robotics)
Team Role: Programmer
 
Join Date: Dec 2007
Rookie Year: 2006
Location: Illinois
Posts: 375
MiniNerd24 is a jewel in the roughMiniNerd24 is a jewel in the roughMiniNerd24 is a jewel in the roughMiniNerd24 is a jewel in the rough
Re: Joystick Programming

Hi, and yes there is. The controllers (I'm going to guess that you mean the Victors) are pretty much un-programmable. The motors, however, are programmable by way of the Victors that run them. Now I'm not sure what you are using for the programming tool but we used the free ROBOTC software that can be downloaded from one of these forums(try searching FREE ROBOTC, that's what I did). Let me know if it's a different programming language and I'll help you. You could also PM me if you need any more help.
__________________
The system is down.


Rockford Robotics 2039: Think outside the bots.
  #3   Spotlight this post!  
Unread 29-01-2008, 19:13
tseres's Avatar
tseres tseres is offline
obsessed with FIRST...
FRC #1565 (Think Tank Tech)
Team Role: Leadership
 
Join Date: Apr 2007
Rookie Year: 2007
Location: Cambridge, ON
Posts: 305
tseres is a glorious beacon of lighttseres is a glorious beacon of lighttseres is a glorious beacon of lighttseres is a glorious beacon of lighttseres is a glorious beacon of lighttseres is a glorious beacon of light
Re: Joystick Programming

also, if you're new at this and dont have anyone else who knows what they're doing, avoid using MPLab....try EasyC or robotC instead. i dont have any experience with these, but they're supposed to be easier!
__________________


  #4   Spotlight this post!  
Unread 29-01-2008, 19:59
MiniNerd24's Avatar
MiniNerd24 MiniNerd24 is offline
Are you going to eat that?
FRC #2039 (Rockford Robotics)
Team Role: Programmer
 
Join Date: Dec 2007
Rookie Year: 2006
Location: Illinois
Posts: 375
MiniNerd24 is a jewel in the roughMiniNerd24 is a jewel in the roughMiniNerd24 is a jewel in the roughMiniNerd24 is a jewel in the rough
Re: Joystick Programming

Quote:
Originally Posted by tseres View Post
also, if you're new at this and dont have anyone else who knows what they're doing, avoid using MPLab....try EasyC or robotC instead. i dont have any experience with these, but they're supposed to be easier!
I concur ROBOTC and EasyC are probably the easiest.
__________________
The system is down.


Rockford Robotics 2039: Think outside the bots.
  #5   Spotlight this post!  
Unread 29-01-2008, 20:00
tseres's Avatar
tseres tseres is offline
obsessed with FIRST...
FRC #1565 (Think Tank Tech)
Team Role: Leadership
 
Join Date: Apr 2007
Rookie Year: 2007
Location: Cambridge, ON
Posts: 305
tseres is a glorious beacon of lighttseres is a glorious beacon of lighttseres is a glorious beacon of lighttseres is a glorious beacon of lighttseres is a glorious beacon of lighttseres is a glorious beacon of light
Re: Joystick Programming

i just avoid them because they have 'easy' in them (well, just easyC)
__________________


  #6   Spotlight this post!  
Unread 29-01-2008, 21:05
greatman05 greatman05 is offline
Registered User
AKA: Chavez Clemons Jr.
FRC #2224 (Phoenix Phenoms)
Team Role: Mentor
 
Join Date: Jan 2008
Rookie Year: 2006
Location: Detroit, MI
Posts: 32
greatman05 is an unknown quantity at this point
Send a message via AIM to greatman05 Send a message via MSN to greatman05 Send a message via Yahoo to greatman05
Re: Joystick Programming

I'm sorry, I should have been a bit clearer: By controllers, I meant the joysticks.
Where in the code does it allow you to adjust motor sensitivity? Looking at the default code, I have no idea where I can adjust that.
  #7   Spotlight this post!  
Unread 29-01-2008, 21:11
wt200999's Avatar
wt200999 wt200999 is offline
Texas Instruments
AKA: Will Toth
FRC #3005 (Robochargers)
Team Role: Mentor
 
Join Date: Mar 2006
Rookie Year: 2004
Location: Dallas, Texas
Posts: 325
wt200999 has much to be proud ofwt200999 has much to be proud ofwt200999 has much to be proud ofwt200999 has much to be proud ofwt200999 has much to be proud ofwt200999 has much to be proud ofwt200999 has much to be proud ofwt200999 has much to be proud ofwt200999 has much to be proud of
Send a message via MSN to wt200999
Re: Joystick Programming

if you look in the default code you will see lines like

Code:
pwm01 = p1_y
pwm02 = p2_y
pwm is the term for each of the moters. p1_y and p2_y are joystick 1 & 2 on the y axis. These give you a value between 0 and 255, with 127 being neutral. To adjust the sensitivity you can take the joystick input and apply a little bit of math and what you set the motors to will be less.

I will give you a link to a thread I posted in a couple of weeks ago on this.

Edit: http://www.chiefdelphi.com/forums/sh...ad.php?t=61929
__________________
Programming in LabVIEW? Try VI Snippets!

FIRST LEGO League 2004 - 2005
FRC Team 870 Student 2006 - 2009
FRC Team 3005 Mentor 2013 -
  #8   Spotlight this post!  
Unread 29-01-2008, 21:45
MiniNerd24's Avatar
MiniNerd24 MiniNerd24 is offline
Are you going to eat that?
FRC #2039 (Rockford Robotics)
Team Role: Programmer
 
Join Date: Dec 2007
Rookie Year: 2006
Location: Illinois
Posts: 375
MiniNerd24 is a jewel in the roughMiniNerd24 is a jewel in the roughMiniNerd24 is a jewel in the roughMiniNerd24 is a jewel in the rough
Re: Joystick Programming

I'm sorry what programming tool are you using? That code that wt200999 posted may be the code that works for EasyC only (i don't know really). There are other codes that work with other systems.
__________________
The system is down.


Rockford Robotics 2039: Think outside the bots.
  #9   Spotlight this post!  
Unread 29-01-2008, 22:29
wt200999's Avatar
wt200999 wt200999 is offline
Texas Instruments
AKA: Will Toth
FRC #3005 (Robochargers)
Team Role: Mentor
 
Join Date: Mar 2006
Rookie Year: 2004
Location: Dallas, Texas
Posts: 325
wt200999 has much to be proud ofwt200999 has much to be proud ofwt200999 has much to be proud ofwt200999 has much to be proud ofwt200999 has much to be proud ofwt200999 has much to be proud ofwt200999 has much to be proud ofwt200999 has much to be proud ofwt200999 has much to be proud of
Send a message via MSN to wt200999
Re: Joystick Programming

Sorry about any confusion, that thread was about how to do it in easyC, the example I posted in there I wrote in MPlab. Someone else had posted code in that thread that works in easyC if you are using that.
__________________
Programming in LabVIEW? Try VI Snippets!

FIRST LEGO League 2004 - 2005
FRC Team 870 Student 2006 - 2009
FRC Team 3005 Mentor 2013 -

Last edited by wt200999 : 29-01-2008 at 23:09.
  #10   Spotlight this post!  
Unread 30-01-2008, 18:33
greatman05 greatman05 is offline
Registered User
AKA: Chavez Clemons Jr.
FRC #2224 (Phoenix Phenoms)
Team Role: Mentor
 
Join Date: Jan 2008
Rookie Year: 2006
Location: Detroit, MI
Posts: 32
greatman05 is an unknown quantity at this point
Send a message via AIM to greatman05 Send a message via MSN to greatman05 Send a message via Yahoo to greatman05
Re: Joystick Programming

OK...thanks for the info.

I have another question: What kind of algorithm or math should I use to reduce joystick sensitivity? I am really new to this programming thing...
  #11   Spotlight this post!  
Unread 30-01-2008, 20:28
timville's Avatar
timville timville is offline
Registered User
AKA: Timothy Friez
FRC #1185 (X-Bots)
Team Role: Alumni
 
Join Date: Mar 2007
Rookie Year: 2003
Location: Pittsburgh
Posts: 18
timville is an unknown quantity at this point
Send a message via AIM to timville
Re: Joystick Programming

Hi there.

ROBOTC makes using the joystick very easy. If you wanted to use the joysticks to drive your robot you could the following code:

while(true){
motor[port1] = frcRF[p1_y]; //maps pwm port 1 to the Y axis of Joy1
motor[port2] = frcRF[p2_y]; //maps pwm port 2 to the Y axis of Joy2
{

You can in exchange slow down the motors and still retain the joystick "movement" by dividing the values you're getting from the joystick... like in this example:

while(true){
motor[port1] = (frcRF[p1_y] / 2); //maps pwm port 1 to half the value of the Y axis of Joy1
motor[port2] = (frcRF[p2_y] / 2); //maps pwm port 2 to half the value of the Y axis of Joy2
{
__________________
2003 - Rookie All-Stars Awards - #1185 (Pittsburgh)
2004-2008 FIRST Volunteer - Ref/Head Ref (Pittsburgh)
2002-2007 FIRST Lego League Volunteer - Head Ref (Pittsburgh)
  #12   Spotlight this post!  
Unread 30-01-2008, 20:40
lukevanoort lukevanoort is offline
in between teams
AKA: Luke Van Oort
no team
 
Join Date: Oct 2005
Rookie Year: 2005
Location: Waterloo, ON, Canada
Posts: 1,873
lukevanoort has a reputation beyond reputelukevanoort has a reputation beyond reputelukevanoort has a reputation beyond reputelukevanoort has a reputation beyond reputelukevanoort has a reputation beyond reputelukevanoort has a reputation beyond reputelukevanoort has a reputation beyond reputelukevanoort has a reputation beyond reputelukevanoort has a reputation beyond reputelukevanoort has a reputation beyond reputelukevanoort has a reputation beyond repute
Send a message via AIM to lukevanoort
Re: Joystick Programming

I posted here about what we do. It gives us maximum speed (something dividing doesn't) and reduces sensitivity at low speeds. If you are using RobotC or EasyC, I don't know how you would implement it, but I assume that it is possible (I mean, if those tools don't allow working with arrays, I would be very disappointed).
__________________
Team 1219: 2009 - Mentor
Team 587: 2005 - Animator, 2006-2008 - Team Captain
Closed Thread


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

Similar Threads
Thread Thread Starter Forum Replies Last Post
Joystick Programming LieAfterLie Programming 7 15-02-2007 09:30
Programming a Joystick sbf2009 Programming 3 10-02-2007 15:59
Joystick Programming team 803 Programming 6 21-02-2006 11:49
Joystick Button programming Bharat Nain Programming 5 18-02-2005 11:48
single joystick programming Bill Bonsky OCCRA 2 04-10-2003 09:47


All times are GMT -5. The time now is 01:10.

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