三浦 颯太 / TrapezoidControl
Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers TrapezoidControl.h Source File

TrapezoidControl.h

00001 #ifndef TRAPEZOIDCONTROL_H_
00002 #define TRAPEZOIDCONTROL_H_
00003 
00004 #include "mbed.h"
00005 #include <stdio.h>
00006 
00007 class TrapezoidControl {
00008     public:
00009         //いつもの1
00010         TrapezoidControl();
00011         //いつもの2
00012         TrapezoidControl(float maxAcceleration, //最大加速度
00013                          float maxVelocity);    //最大速度
00014         //いつもの3    
00015         TrapezoidControl(float maxAcceleration, //最大加速度
00016                          float maxVelocity,     //最大速度
00017                          float strVerocity,     //初期速度
00018                          float endVerocity,     //終点速度
00019                          float tarDistance);    //目標距離
00020         //最大加速度と最大速度の設定・変更
00021         void setParameter(float maxAcceleration, float maxVelocity);
00022         //目標値の設定・変更
00023         void setDis(float tarDistance, float endVerocity);
00024         //目標値の初期化
00025         void reset();
00026         //台形制御の開始
00027         void start();
00028         //速度の取得
00029         float getVel();
00030         //距離(理論値)の取得
00031         float getDis();
00032     private:
00033         float maxAcceleration_;
00034         float maxVelocity_;
00035         float strVerocity_;
00036         float endVerocity_;
00037         float tarDistance_;
00038         float time;
00039         Timer sampling;
00040 };
00041 
00042 #endif //TRAPEZOIDCONTROL_H_