Go to Post If all you are is a nail, every hammer looks like a problem. - Alan Anderson [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 16-12-2008, 13:50
koreabell koreabell is offline
Team 956 Safety Captain
FRC #0956 (Eagles)
Team Role: Programmer
 
Join Date: Sep 2008
Rookie Year: 2007
Location: Oregon
Posts: 24
koreabell is an unknown quantity at this point
Joystick axis values in new controller

Are the values of joystick axis(x,y,and z) in new controller 0 to 255 like last controller? or do they have float value of -1.0 to +1.0?

i can't find what value it returns although my guess is float value of -1.0 to +1.0 since doxgen says function type is float.

just making sure

Last edited by koreabell : 16-12-2008 at 13:52. Reason: typo
  #2   Spotlight this post!  
Unread 16-12-2008, 14:02
billbo911's Avatar
billbo911 billbo911 is offline
I prefer you give a perfect effort.
AKA: That's "Mr. Bill"
FRC #2073 (EagleForce)
Team Role: Mentor
 
Join Date: Mar 2005
Rookie Year: 2005
Location: Elk Grove, Ca.
Posts: 2,369
billbo911 has a reputation beyond reputebillbo911 has a reputation beyond reputebillbo911 has a reputation beyond reputebillbo911 has a reputation beyond reputebillbo911 has a reputation beyond reputebillbo911 has a reputation beyond reputebillbo911 has a reputation beyond reputebillbo911 has a reputation beyond reputebillbo911 has a reputation beyond reputebillbo911 has a reputation beyond reputebillbo911 has a reputation beyond repute
Re: Joystick axis values in new controller

READ the Programming Guide, your question will be answered.
__________________
CalGames 2009 Autonomous Champion Award winner
Sacramento 2010 Creativity in Design winner, Sacramento 2010 Quarter finalist
2011 Sacramento Finalist, 2011 Madtown Engineering Inspiration Award.
2012 Sacramento Semi-Finals, 2012 Sacramento Innovation in Control Award, 2012 SVR Judges Award.
2012 CalGames Autonomous Challenge Award winner ($$$).
2014 2X Rockwell Automation: Innovation in Control Award (CVR and SAC). Curie Division Gracious Professionalism Award.
2014 Capital City Classic Winner AND Runner Up. Madtown Throwdown: Runner up.
2015 Innovation in Control Award, Sacramento.
2016 Chezy Champs Finalist, 2016 MTTD Finalist
  #3   Spotlight this post!  
Unread 16-12-2008, 14:47
koreabell koreabell is offline
Team 956 Safety Captain
FRC #0956 (Eagles)
Team Role: Programmer
 
Join Date: Sep 2008
Rookie Year: 2007
Location: Oregon
Posts: 24
koreabell is an unknown quantity at this point
Re: Joystick axis values in new controller

well I'm programming in c++ and there is no examples or something like that on C/C++ Users Guide for joystick axis value(there's nothing except for big "DRAFT" across the page when you go to joystick page)

there is GetRawAxis() function under joystick class which i assume it will return values between 0 to 255, but that is also float type function while GetRaw() function under PWM class is int type(actually UINT8 type) function.

i know float can handle more wide range than int, thus GetRawAxis() might return values between 0 and 255, but still i'm not sure and i won't know until new controller comes

anyway, i wrote a function that will return values between 0 and 255 even if GetY() or GetAxis() function returns values between -1.0 and +1.0
  #4   Spotlight this post!  
Unread 16-12-2008, 17:05
slavik262's Avatar
slavik262 slavik262 is offline
We do what we must because we can.
AKA: Matt Kline
FRC #0537 (Charger Robotics)
Team Role: Alumni
 
Join Date: Jan 2007
Rookie Year: 2007
Location: Sussex, WI
Posts: 310
slavik262 is a splendid one to beholdslavik262 is a splendid one to beholdslavik262 is a splendid one to beholdslavik262 is a splendid one to beholdslavik262 is a splendid one to beholdslavik262 is a splendid one to beholdslavik262 is a splendid one to behold
Send a message via AIM to slavik262
Re: Joystick axis values in new controller

Refer to the C/C++ Programmer Reference Guide.

You can either use Joystick::GetRawAxis(UINT32 axis), where axis is a value between 1 and 6 specifying the axis, or you can simply use Joystick::GetX() and Joystick::GetY(). All of these functions return a floating point value between -1.0f and 1.0f. Returning values between 0 and 255 will lower your precision, as a floating point variable can hold much more data than an unsigned character.
__________________
  #5   Spotlight this post!  
Unread 16-12-2008, 17:23
Joe Ross's Avatar Unsung FIRST Hero
Joe Ross Joe Ross is offline
Registered User
FRC #0330 (Beachbots)
Team Role: Engineer
 
Join Date: Jun 2001
Rookie Year: 1997
Location: Los Angeles, CA
Posts: 8,576
Joe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond repute
Re: Joystick axis values in new controller

In most cases, the WPI Robotics Library is equivalent between LabVIEW and C++, although the documentation isn't always as good for one or the other. 99% of the time, you should be able to look at the LabVIEW documentation if the C++ documentation isn't clear (and vice versa). Don't get caught up in the name of the document.

Quote:
Returning values between 0 and 255 will lower your precision, as a floating point variable can hold much more data than an unsigned character.
I don't believe that is true in this case. I'm pretty sure that DS sends the values to the cRIO as a single byte integer. In this case, they should be equivilent.

If you are trying to directly copy an algorithm from the IFI controller, it may be easier if you use the raw joystick values and the PWM class, but for implementing new things, you'll probably find it easier to work with the floating point values.

Last edited by Joe Ross : 16-12-2008 at 17:30.
  #6   Spotlight this post!  
Unread 16-12-2008, 22:19
slavik262's Avatar
slavik262 slavik262 is offline
We do what we must because we can.
AKA: Matt Kline
FRC #0537 (Charger Robotics)
Team Role: Alumni
 
Join Date: Jan 2007
Rookie Year: 2007
Location: Sussex, WI
Posts: 310
slavik262 is a splendid one to beholdslavik262 is a splendid one to beholdslavik262 is a splendid one to beholdslavik262 is a splendid one to beholdslavik262 is a splendid one to beholdslavik262 is a splendid one to beholdslavik262 is a splendid one to behold
Send a message via AIM to slavik262
Re: Joystick axis values in new controller

Quote:
Originally Posted by Joe Ross View Post
I'm pretty sure that DS sends the values to the cRIO as a single byte integer. In this case, they should be equivilent.
I may be wrong, but in doing basic tests it seemed that the joystick had greater precision than that. What you're saying does make sense though. I'll have to take a deeper look at it.
__________________
  #7   Spotlight this post!  
Unread 17-12-2008, 10:38
Mike Soukup's Avatar
Mike Soukup Mike Soukup is offline
Software guy
FRC #0111 (Wildstang)
Team Role: Engineer
 
Join Date: May 2001
Rookie Year: 1996
Location: Schaumburg, IL
Posts: 797
Mike Soukup has a reputation beyond reputeMike Soukup has a reputation beyond reputeMike Soukup has a reputation beyond reputeMike Soukup has a reputation beyond reputeMike Soukup has a reputation beyond reputeMike Soukup has a reputation beyond reputeMike Soukup has a reputation beyond reputeMike Soukup has a reputation beyond reputeMike Soukup has a reputation beyond reputeMike Soukup has a reputation beyond reputeMike Soukup has a reputation beyond repute
Re: Joystick axis values in new controller

Quote:
Originally Posted by slavik262 View Post
I've downloaded that document on two computers and when I open it on both I get "The address is not valid" in the right pane. Is it a problem with the user or the document?
  #8   Spotlight this post!  
Unread 17-12-2008, 11:39
Mark McLeod's Avatar
Mark McLeod Mark McLeod is offline
Just Itinerant
AKA: Hey dad...Father...MARK
FRC #0358 (Robotic Eagles)
Team Role: Engineer
 
Join Date: Mar 2003
Rookie Year: 2002
Location: Hauppauge, Long Island, NY
Posts: 8,830
Mark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond repute
Re: Joystick axis values in new controller

Is it due to Microsoft's problem with .chm format?

http://forums.usfirst.org/showthread.php?t=10708
__________________
"Rationality is our distinguishing characteristic - it's what sets us apart from the beasts." - Aristotle
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
Reversing the joystick axis JBotAlan Programming 3 09-02-2005 19:47
Tri-axis Analog Joystick KVermilion Control System 5 19-01-2005 00:24
pwm outputs vs. joystick y-axis stephenthe1 Programming 4 01-12-2004 17:29
Inverting Y axis on joystick FormatteD_C Programming 7 24-02-2004 16:56
switching joystick axis????? team222badbrad Technical Discussion 9 16-01-2002 23:07


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

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