34        unsigned int loopCycle, servo_preset = 0, target_angle = 0;
 
   35        float        move_angle = 0, next_angle = 0, value = 0, speed = 0, last_angle;
 
   43                   unsigned int Last_Angle = 0)
 
   45            loopCycle  = LoopCycle / 100;
 
   46            last_angle = next_angle = 
static_cast<float>(Last_Angle);
 
 
   68            last_angle = next_angle;    
 
   70                static_cast<float>(target_angle) - 
static_cast<float>(last_angle);
 
   80                        (move_angle < 0 ? -1 : 1);
 
   82                next_angle = 
Udon::Constrain(next_angle, 0.0f, 
static_cast<float>(servo_preset));
 
 
   96        void stop() { next_angle = last_angle; }
 
  106            return static_cast<unsigned int>(next_angle);
 
 
 
bool getStatus() const
サーボの状態を返す
Definition ServoSpeed.hpp:100
 
void update()
サーボの状態を更新する関数 毎周期実行する
Definition ServoSpeed.hpp:65
 
void stop()
非常停止 今周期のデータを捨てる
Definition ServoSpeed.hpp:96
 
void setAngle(unsigned int r, float s)
サーボの次の動きをセットする
Definition ServoSpeed.hpp:89
 
ServoSpeed(unsigned int LoopCycle, ServoChoose Choose, unsigned int Last_Angle=0)
ServoSpeedのコンストラクタ
Definition ServoSpeed.hpp:42
 
float speedValue() const
現在設定されているサーボの稼働速度を返す
Definition ServoSpeed.hpp:111
 
unsigned int getAngle() const
次の目標角度取得
Definition ServoSpeed.hpp:104
 
constexpr T Abs(const T &rhs)
絶対値を返す (std::abs)
Definition Math.hpp:110
 
constexpr A Constrain(const A &amt, const B &low, const C &high)
値を指定された範囲内に収める (std::clamp)
Definition Math.hpp:69
 
ServoChoose
サーボの種類選択
Definition ServoSpeed.hpp:23
 
@ _30kg
Definition ServoSpeed.hpp:25
 
@ _60kg
Definition ServoSpeed.hpp:26
 
@ _20kg
Definition ServoSpeed.hpp:24