Go to Post Being good people is as important as being the winners of some robotics competition! - ExTexan [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

 
 
 
Thread Tools Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #4   Spotlight this post!  
Unread 19-02-2014, 08:58
NWChen's Avatar
NWChen NWChen is offline
Alum
no team
 
Join Date: Oct 2012
Rookie Year: 2012
Location: New York City
Posts: 205
NWChen is a splendid one to beholdNWChen is a splendid one to beholdNWChen is a splendid one to beholdNWChen is a splendid one to beholdNWChen is a splendid one to beholdNWChen is a splendid one to beholdNWChen is a splendid one to behold
Re: Data Range on Joystick.getRawAxis

Quote:
Originally Posted by Joe Ross View Post
I'm curious where you found that information in the javadocs. I couldn't find it.
The method summary of getRawAxis() in Joystick links to this source code:
Code:
public double getRawAxis(final int axis) {
    return m_ds.getStickAxis(m_port, axis);
}
getStickAxis() is a method of DriverStation:
Code:
private DriverStation m_ds;
and in the DriverStation class the getStickAxis() method used with m_ds earlier is as follows:
Code:
public double getStickAxis(int stick, int axis) {
       if (axis < 1 || axis > kJoystickAxes) {
           return 0.0;
       }
   
           int value;
           switch (stick) {
                    ...
           default:
               return 0.0;
       }
   
       double result;
       if (value < 0) {
           result = ((double) value) / 128.0;
       } else {
           result = ((double) value) / 127.0;
       }
   
       // wpi_assert(result <= 1.0 && result >= -1.0);
       if (result > 1.0) {
           result = 1.0;
       } else if (result < -1.0) {
           result = -1.0;
       }
    return result;
}
 


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 22:03.

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