ARCS6 AR6-REV.24062600
読み取り中…
検索中…
一致する文字列を見つけられません
SshapeGenerator.hh
[詳解]
1
8//
9// Copyright (C) 2011-2021 Yokokura, Yuki
10// This program is free software;
11// you can redistribute it and/or modify it under the terms of the FreeBSD License.
12// For details, see the License.txt file.
13
14#ifndef SSHAPEGENERATOR
15#define SSHAPEGENERATOR
16
17#include <cassert>
18#include "MovingAverage.hh"
19
20// ARCS組込み用マクロ
21#ifdef ARCS_IN
22 // ARCSに組み込まれる場合
23 #include "ARCSassert.hh"
24 #include "ARCSeventlog.hh"
25#else
26 // ARCSに組み込まれない場合
27 #define arcs_assert(a) (assert(a))
28 #define PassedLog()
29 #define EventLog(a)
30 #define EventLogVar(a)
31#endif
32
33namespace ARCS { // ARCS名前空間
36template <size_t N>
38 public:
41 : RampStage(), SshapeStage()
42 {
43 PassedLog();
44 }
45
49 // :
50 {
51
52 }
53
58
62 double GetShapedSignal(const double input){
63 return SshapeStage.GetSignal(RampStage.GetSignal(input)); // 移動平均を2回掛けてS字にする
64 }
65
68 void SetInitialValue(const double init){
69 RampStage.Fill(init); // 移動平均のメモリを初期値で埋める
70 SshapeStage.Fill(init); // 移動平均のメモリを初期値で埋める
71 }
72
73 private:
74 SshapeGenerator(const SshapeGenerator&) = delete;
75 const SshapeGenerator& operator=(const SshapeGenerator&) = delete;
76 MovingAverage<N> RampStage;
77 MovingAverage<N> SshapeStage;
78
79};
80}
81
82#endif
83
ARCS イベントログクラス
#define PassedLog()
イベントログ用マクロ(ファイルと行番号のみ記録版)
Definition ARCSeventlog.hh:26
ARCS用ASSERTクラス
移動平均クラス
移動平均クラス
Definition MovingAverage.hh:38
S字軌道生成器
Definition SshapeGenerator.hh:37
double GetShapedSignal(const double input)
S字軌道の最新値を取得する関数
Definition SshapeGenerator.hh:62
SshapeGenerator(SshapeGenerator &&r)
ムーブコンストラクタ
Definition SshapeGenerator.hh:48
SshapeGenerator()
コンストラクタ
Definition SshapeGenerator.hh:40
~SshapeGenerator()
デストラクタ
Definition SshapeGenerator.hh:55
void SetInitialValue(const double init)
S字軌道の初期値を設定する関数
Definition SshapeGenerator.hh:68