Go to Post Are they Robots? Of course they aren't robots; they are obviously and unambiguously robots. - gblake [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 Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 10-02-2013, 15:52
The_Colonel The_Colonel is offline
Registered User
FRC #4456
 
Join Date: Feb 2013
Location: Washington, DC
Posts: 4
The_Colonel is an unknown quantity at this point
significance of encoder function getRaw()

Does anybody know what the value being returned by getRaw() actually signifies? and how is it distinct from get()?
Reply With Quote
  #2   Spotlight this post!  
Unread 10-02-2013, 16:03
Ether's Avatar
Ether Ether is offline
systems engineer (retired)
no team
 
Join Date: Nov 2009
Rookie Year: 1969
Location: US
Posts: 8,042
Ether has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond repute
Re: significance of encoder function getRaw()

Quote:
Originally Posted by The_Colonel View Post
Does anybody know what the value being returned by getRaw() actually signifies? and how is it distinct from get()?
Look at the file "Encoder.java" in the WPILib source code folder installed on your development computer.

Search for get() and getRaw() and look at the comment section preceding each method.


Reply With Quote
  #3   Spotlight this post!  
Unread 10-02-2013, 16:06
joelg236 joelg236 is offline
4334 Retired Mentor & Alumni
AKA: Joel Gallant
no team
Team Role: Mentor
 
Join Date: Dec 2011
Rookie Year: 2012
Location: Calgary
Posts: 733
joelg236 has a reputation beyond reputejoelg236 has a reputation beyond reputejoelg236 has a reputation beyond reputejoelg236 has a reputation beyond reputejoelg236 has a reputation beyond reputejoelg236 has a reputation beyond reputejoelg236 has a reputation beyond reputejoelg236 has a reputation beyond reputejoelg236 has a reputation beyond reputejoelg236 has a reputation beyond reputejoelg236 has a reputation beyond repute
Re: significance of encoder function getRaw()

Code:
/**
 * Read the current counter value.
 * Read the value at this instant. It may still be running, so it reflects the current value. Next
 * time it is read, it might have a different value.
 */
public int get() {
    return m_counter.readOutput_Value();
}
and

Code:
/**
 * Gets the raw value from the encoder.
 * The raw value is the actual count unscaled by the 1x, 2x, or 4x scale
 * factor.
 * @return Current raw count from the encoder
 */
public int getRaw() {
    int value;
    if (m_counter != null) {
        value = m_counter.get();
    } else {
        value = m_encoder.readOutput_Value();
    }
    return value;
}
getRaw() is unscaled for the encoder type (quadrature, 2x, 1x, etc.).
__________________
All opinions are my own.
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 09:52.

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