⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 calibration.h

📁 为参加日本的ET机器人比赛写的LEGO机器人控制程序
💻 H
字号:
/******************************************************************************\
*
* File:          Calibration.h
* Creation date: June 23, 2008 10:30
* Latest update: July 09, 2008 16:39
* Author:        ClassBuilder
*                XXXX
* Purpose:       Declaration of class 'Calibration'
* CB version:    ClassBuilder Version 2.9 (PR523)
*
* Modifications: @INSERT_MODIFICATIONS(* )
* July 09, 2008 16:35 Chijinliang
*     Added method 'GetWhiteGray'
*     Added method 'GetBlackGray'
*     Updated interface of method 'SetWhite'
*     Updated interface of method 'SetGray'
*     Updated interface of method 'SetBlack'
*     Updated member 'm_gray'
*     Updated member 'm_black'
*     Updated member 'm_white'
* July 09, 2008 15:48 Chijinliang
*     Deleted member 'm_newCommand'
* July 09, 2008 15:46 Chijinliang
*     Added member 'm_newCommand'
* July 09, 2008 12:13 Chijinliang
*     Deleted method 'CalculateMotorSpeed'
*     Deleted member 'm_steeringAngleGain'
*     Added method 'CalTime'
*     Updated interface of method 'CalAngle'
*     Updated member 'm_steeringAngles'
*     Updated member 'm_times'
* July 05, 2008 14:29 Chijinliang
*     Added method 'SetSteeringAngleGain'
*     Added method 'GetSteeringAngleGain'
*     Added member 'm_steeringAngleGain'
*     Updated interface of method 'SetThresholdWhite'
*     Updated interface of method 'SetThresholdGray'
*     Updated interface of method 'SetThresholdBlack'
*     Updated interface of method 'CalculateSteeringSpeed'
*     Updated interface of method 'CalculateMotorSpeed'
*     Updated member 'm_steeringSpeeds'
*     Updated member 'm_motorSpeeds'
*     Updated member 'm_thresholdGray'
*     Updated member 'm_thresholdBlack'
*     Updated member 'm_thresholdWhite'
* June 24, 2008 19:44 Chijinliang
*     Updated member 'm_steeringSpeeds'
* June 23, 2008 17:39 Chijinliang
*     Updated interface of method 'SetThresholdBlack'
*     Updated member 'm_steeringSpeeds'
*     Updated member 'm_motorSpeeds'
*     Updated member 'm_thresholdBlack'
* June 23, 2008 13:46 Chijinliang
*     Added method 'Calibration'
*     Updated interface of method 'SetThresholdWhite'
*     Updated interface of method 'SetThresholdGray'
*     Updated interface of method 'SetThresholdBlack'
*     Updated member 'm_thresholdGray'
*     Updated member 'm_thresholdBlack'
*     Updated member 'm_thresholdWhite'
* June 23, 2008 10:30 Chijinliang
*     Added method 'DestructorInclude'
*     Added method 'ConstructorInclude'
*     Added method 'SetThresholdWhite'
*     Added method 'GetThresholdWhite'
*     Added method 'SetThresholdGray'
*     Added method 'GetThresholdGray'
*     Added method 'SetThresholdBlack'
*     Added method 'GetThresholdBlack'
*     Added method 'CalculateSteeringSpeed'
*     Added method 'CalculateMotorSpeed'
*     Added method '~Calibration'
*     Added member 'm_steeringSpeeds'
*     Added member 'm_motorSpeeds'
*     Added member 'm_thresholdGray'
*     Added member 'm_thresholdBlack'
*     Added member 'm_thresholdWhite'
*     Updated return type of method 'CalculateMotorSpeed'
*
* Copyright 2008, XXXXX
* All rights are reserved. Reproduction in whole or part is prohibited
* without the written consent of the copyright owner.
*
\******************************************************************************/
#ifndef _CALIBRATION_H
#define _CALIBRATION_H

#define MAX_MAPITEM  12
/*
Calibration僋儔僗
*/
class Calibration
{

private:
    void ConstructorInclude();
    void DestructorInclude();

private:
    unsigned int m_white;
    unsigned int m_black;
    unsigned int m_gray;
    static byte m_times[MAX_MAPITEM];
    static int m_steeringAngles[MAX_MAPITEM];

public:
    Calibration();
    virtual ~Calibration();
    static int CalAngle(byte pastTime);
    static byte CalTime(int steeringAngle);
    unsigned int GetBlackGray() const;
    unsigned int GetWhiteGray() const;
    unsigned int GetBlack() const;
    void SetBlack(unsigned int black);
    unsigned int GetGray() const;
    void SetGray(unsigned int gray);
    unsigned int GetWhite() const;
    void SetWhite(unsigned int white);
};

#endif // ndef _CALIBRATION_H


#ifdef CB_INLINES
#ifndef _CALIBRATION_H_INLINES
#define _CALIBRATION_H_INLINES

/*
Returns the value of member 'm_black'.
*/
inline unsigned int Calibration::GetBlack() const
{
    return m_black;
}



/*
Set the value of member 'm_black' to 'black'.
*/
inline void Calibration::SetBlack(unsigned int black)
{
    m_black = black;
}



/*
Returns the value of member 'm_gray'.
*/
inline unsigned int Calibration::GetGray() const
{
    return m_gray;
}



/*
Set the value of member 'm_gray' to 'gray'.
*/
inline void Calibration::SetGray(unsigned int gray)
{
    m_gray = gray;
}



/*
Returns the value of member 'm_white'.
*/
inline unsigned int Calibration::GetWhite() const
{
    return m_white;
}



/*
Set the value of member 'white' to 'white'.
*/
inline void Calibration::SetWhite(unsigned int white)
{
    m_white = white;
}



#endif // ndef _CALIBRATION_H_INLINES
#endif //  def CB_INLINES

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -