cpp_robotics
Namespaces
Classes
Types
Name | |
---|---|
enum class | CanonicalizeMode |
enum uint8_t | OCPConstraintType |
enum class | OCPIntegrationMethod |
enum | UnitIndex |
template <class DerType =Eigen::VectorXd> using Eigen::AutoDiffScalar< DerType > |
ADScalar |
using ADVector< Eigen::VectorXd, Eigen::Dynamic > | ADVectorXd |
using std::variant< Vector2d, Line, Quad, Rect, Triangle, Circle > | ShapeType |
using unit_assem::unit_div< Torque, Ampere >::unit | TorqueConstant |
using unit_assem::unit_div< Volt, AngularVelocity >::unit | BackEmfConstant |
using unit_assem::unit_mul< Torque, Second >::unit | FrictionConstant |
using std::variant< Rect, Circle > | ObstacleShapeType |
using GridMap< 2 > | GridMap2d |
using GridMap< 3 > | GridMap3d |
using GridMap< Eigen::Dynamic > | GridMapXd |
using CatumullRomSplinePath< Eigen::Vector2d > | CatumullRomSplinePath2d |
using CatumullRomSplinePath< Eigen::Vector3d > | CatumullRomSplinePath3d |
using CubicSplinePath< Eigen::Vector2d > | CubicSplinePath2d |
using CubicSplinePath< Eigen::Vector3d > | CubicSplinePath3d |
using Unit< double, unit_dimention::second, prefix::none > | Second |
using Unit< double, unit_dimention::second, prefix::milli > | MilliSecond |
using Unit< double, unit_dimention::second, prefix::micro > | MicroSecond |
using Unit< double, unit_dimention::metere, prefix::none > | Meter |
using Unit< double, unit_dimention::metere, prefix::milli > | MilliMeter |
using Unit< double, unit_dimention::metere, prefix::micro > | MicroMeter |
using Unit< double, unit_dimention::metere, prefix::centi > | CentiMeter |
using Unit< double, unit_dimention::kilogram, prefix::none > | KiloGram |
using Unit< double, unit_dimention::kilogram, prefix::milli > | Gram |
using Unit< double, unit_dimention::watt, prefix::none > | Watt |
using Unit< double, unit_dimention::watt, prefix::kilo > | KiloWatt |
using Unit< double, unit_dimention::newton, prefix::none > | Newton |
using Unit< double, unit_dimention::newton, prefix::kilo > | KiloNewton |
using Unit< double, unit_dimention::pascal, prefix::none > | Pascal |
using Unit< double, unit_dimention::pascal, prefix::kilo > | KiloPascal |
using Unit< double, unit_dimention::hertz, prefix::none > | Hertz |
using Unit< double, unit_dimention::area, prefix::none > | Area |
using Unit< double, unit_dimention::volume, prefix::none > | Volume |
using Unit< double, unit_dimention::velocity, prefix::none > | Velocity |
using Unit< double, unit_dimention::acceleration, prefix::none > | Acceleration |
using Unit< double, unit_dimention::dencity, prefix::none > | Dencity |
using Unit< double, unit_dimention::torque, prefix::none > | Torque |
using Unit< double, unit_dimention::inertia, prefix::none > | Inertia |
using Unit< double, unit_dimention::ampere, prefix::none > | Ampere |
using Unit< double, unit_dimention::ampere, prefix::milli > | MilliAmpere |
using Unit< double, unit_dimention::volt, prefix::none > | Volt |
using Unit< double, unit_dimention::volt, prefix::milli > | MilliVolt |
using Unit< double, unit_dimention::ohm, prefix::none > | Ohm |
using Unit< double, unit_dimention::ohm, prefix::milli > | MilliOhm |
using Unit< double, unit_dimention::henry, prefix::none > | Henry |
using Unit< double, unit_dimention::henry, prefix::milli > | MilliHenry |
using Unit< double, unit_dimention::farad, prefix::none > | Farad |
using Unit< double, unit_dimention::farad, prefix::milli > | MilliFarad |
using Unit< double, unit_dimention::farad, prefix::micro > | MicroFarad |
using Unit< double, unit_dimention::farad, prefix::nano > | NanoFarad |
using Unit< double, unit_dimention::angle, prefix::none, tag::angle::radian > | Radian |
using Unit< double, unit_dimention::angle, prefix::none, tag::angle::degree > | Degree |
using Unit< double, unit_dimention::angular_velocity, prefix::none, tag::angular_vel::rad_per_sec > | AngularVelocity |
using Unit< double, unit_dimention::angular_velocity, prefix::none, tag::angular_vel::rps > | Rps |
using Unit< double, unit_dimention::angular_velocity, prefix::none, tag::angular_vel::rpm > | Rpm |
using Unit< double, unit_dimention::angular_acceleration, prefix::none > | AngularAcceleration |
using RandomGenerator< std::uniform_int_distribution<> > | UniformIntRandomEngine 整数型一様分布乱数生成エンジン |
using RandomGenerator< std::uniform_real_distribution<> > | UniformRealRandomEngine 実数型一様分布乱数生成エンジン |
using RandomGenerator< std::bernoulli_distribution > | BernoulliRandomEngine ベルヌーイ分布乱数生成エンジン |
using RandomGenerator< std::binomial_distribution<> > | BinomialRandomEngine 二項分布乱数生成エンジン |
using RandomGenerator< std::geometric_distribution<> > | GeometricRandomEngine 幾何学分布乱数生成エンジン |
using RandomGenerator< std::negative_binomial_distribution<> > | NegativeBinomialRandomEngine 負の二項分布乱数生成エンジン |
using RandomGenerator< std::poisson_distribution<> > | PoissonRandomEngine ポワソン分布乱数生成エンジン |
using RandomGenerator< std::exponential_distribution<> > | ExponentialRandomEngine 指数分布乱数生成エンジン |
using RandomGenerator< std::gamma_distribution<> > | GammaRandomEngine ガンマ分布乱数生成エンジン |
using RandomGenerator< std::weibull_distribution<> > | WeibullRandomEngine ワイブル分布乱数生成エンジン |
using RandomGenerator< std::extreme_value_distribution<> > | ExtremeValueRandomEngine 極値分布乱数生成エンジン |
using RandomGenerator< std::normal_distribution<> > | NormalRandomEngine 正規分布乱数生成エンジン |
using RandomGenerator< std::lognormal_distribution<> > | LognormalRandomEngine 対数正規分布乱数生成エンジン |
using RandomGenerator< std::chi_squared_distribution<> > | ChiSquaredRandomEngine カイ二乗分布乱数生成エンジン |
using RandomGenerator< std::cauchy_distribution<> > | CauchyRandomEngine コーシー分布乱数生成エンジン |
using RandomGenerator< std::fisher_f_distribution<> > | FisherFRandomEngine フィッシャーのF分布乱数生成エンジン |
using RandomGenerator< std::student_t_distribution<> > | StudentTRandomEngine ステューデントのt分布乱数生成エンジン |
using RandomGenerator< std::discrete_distribution<> > | DiscreteRandomEngine 整数のインデックスごとに離散した確率分布の乱数生成エンジン |
using RandomGenerator< std::piecewise_constant_distribution<> > | PiecewiseConstantRandomEngine 区間ごとの重み付けを定数値とした分布の乱数生成エンジン |
using RandomGenerator< std::piecewise_linear_distribution<> > | PiecewiseLinearRandomEngine 区間ごとの重み付けを線形に接続した分布の乱数生成エンジン |
using Quaternion< float > | Quaternionf |
using Quaternion< double > | Quaterniond |
using Transform< float > | Transformf |
using Transform< double > | Transformd |
using Vector2< float > | Vector2f |
using Vector2< double > | Vector2d |
using Vector3< float > | Vector3f |
using Vector3< double > | Vector3d |
using Vector4< float > | Vector4f |
using Vector4< double > | Vector4d |
Functions
Name | |
---|---|
template <int DIM> std::pair< Eigen::Matrix< double, DIM, DIM >, Eigen::Matrix< double, DIM, 1 > > |
calcu_transformatoin(std::vector< Eigen::Matrix< double, DIM, 1 >> dest, std::vector< Eigen::Matrix< double, DIM, 1 >> fixed) |
template <int DIM> std::tuple< std::vector< Eigen::Matrix< double, DIM, 1 > >, Eigen::MatrixXd, size_t > |
icp(std::vector< Eigen::Matrix< double, DIM, 1 >> dest, const std::vector< Eigen::Matrix< double, DIM, 1 >> & fixed, double eps =1e-4, size_t max_iter =100) |
double | mahalanobis(const Eigen::VectorXd & a, const Eigen::VectorXd & b, const Eigen::MatrixXd cov_inv) マハラノビス距離の計算 |
Polynomial | poly_regression(const std::vector< double > & x, const std::vector< double > & y, const size_t degree) 回帰曲線 |
Eigen::MatrixXd | homogeneous(const Eigen::MatrixXd & R, const Eigen::VectorXd & T) |
Eigen::VectorXd | transform_by_homogeneous(const Eigen::MatrixXd & H, const Eigen::VectorXd & x) |
std::optional< Eigen::MatrixXd > | solve_riccati_arimoto_potter(const Eigen::MatrixXd & A, const Eigen::MatrixXd & B, const Eigen::MatrixXd & Q, const Eigen::MatrixXd & R) 有本-ポッターの方法によるリカッチ方程式の解法 |
Eigen::MatrixXd | lqr(const Eigen::MatrixXd & A, const Eigen::MatrixXd & B, const Eigen::MatrixXd & Q, const Eigen::MatrixXd & R) |
Eigen::MatrixXd | controllability_matrix(const Eigen::MatrixXd & A, const Eigen::VectorXd & B) 可制御性行列の計算 |
bool | is_controllable(const Eigen::MatrixXd & A, const Eigen::VectorXd & B) 可制御性の判別 |
bool | is_controllable(const StateSpaceSystem & sys) |
Eigen::MatrixXd | observability_matrix(const Eigen::MatrixXd & A, const Eigen::RowVectorXd & C) 可観測性行列を計算する |
bool | is_observable(const Eigen::MatrixXd & A, const Eigen::RowVectorXd & C) 可観測性の判別 |
bool | is_observable(const StateSpaceSystem & sys) |
std::tuple< Eigen::MatrixXd, Eigen::MatrixXd, Eigen::MatrixXd > | canonicalize_system(const Eigen::MatrixXd & A, const Eigen::MatrixXd & B, const Eigen::MatrixXd & C, CanonicalizeMode mode =CanonicalizeMode::COMPANION) 同値変換による可制御正準形への変換 |
std::tuple< Eigen::MatrixXd, Eigen::MatrixXd, Eigen::MatrixXd > | canonicalize_system(const StateSpaceSystem & sys, CanonicalizeMode mode =CanonicalizeMode::COMPANION) 同値変換による可制御正準形への変換 |
Eigen::VectorXd | place(const StateSpaceSystem & sys, std::vector< double > poles) アッカーマン法によるSISOモデルの極配置 |
OCPConstraintArray | OCPInputBoundConstraints(const Eigen::VectorXd & lb, const Eigen::VectorXd & ub, double slope =10.0) |
OCPConstraintArray | OCPStateBoundConstrants(const Eigen::VectorXd & lb, const Eigen::VectorXd & ub, double slope =10.0) |
Eigen::VectorXd | vrft_leastsq(const Eigen::VectorXd & u, const Eigen::VectorXd & y, const double Ts, TransferFunction ref_model, std::vector< TransferFunction > & control_base, std::optional< TransferFunction > prefilter) |
Eigen::VectorXd | vrft_pid(const Eigen::VectorXd & u, const Eigen::VectorXd & y, const double Ts, TransferFunction ref_model, std::optional< TransferFunction > prefilter, double Td =0.01) |
Eigen::VectorXd | vrft_p(const Eigen::VectorXd & u, const Eigen::VectorXd & y, const double Ts, TransferFunction ref_model, std::optional< TransferFunction > prefilter) |
Eigen::VectorXd | vrft_pi(const Eigen::VectorXd & u, const Eigen::VectorXd & y, const double Ts, TransferFunction ref_model, std::optional< TransferFunction > prefilter) |
Eigen::VectorXd | vrft_pd(const Eigen::VectorXd & u, const Eigen::VectorXd & y, const double Ts, TransferFunction ref_model, std::optional< TransferFunction > prefilter, double Td =0.01) |
std::ostream & | operator<<(std::ostream & os, const Vector2d & v) |
std::ostream & | operator<<(std::ostream & os, const Vector3d & v) |
std::ostream & | operator<<(std::ostream & os, const Vector4d & v) |
std::ostream & | operator<<(std::ostream & os, const Transformd & v) |
bool | intersect(const Vector2d & a, const Vector2d & b) |
bool | intersect(const Vector2d & a, const Line & b) |
bool | intersect(const Vector2d & a, const Rect & b) |
bool | intersect(const Vector2d & a, const Circle & b) |
bool | intersect(const Vector2d & a, const Triangle & b) |
bool | intersect(const Vector2d & a, const Quad & b) |
bool | intersect(const Line & a, const Vector2d & b) |
bool | intersect(const Line & a, const Line & b) |
bool | intersect(const Line & a, const Circle & b) |
bool | intersect(const Rect & a, const Vector2d & b) |
bool | intersect(const Circle & a, const Vector2d & b) |
std::optional< std::vector< Vector2d > > | intersect_at(const Vector2d & a, const Vector2d & b) |
std::optional< std::vector< Vector2d > > | intersect_at(const Vector2d & a, const Line & b) |
std::optional< std::vector< Vector2d > > | intersect_at(const Vector2d & a, const Rect & b) |
std::optional< std::vector< Vector2d > > | intersect_at(const Vector2d & a, const Circle & b) |
std::optional< std::vector< Vector2d > > | intersect_at(const Line & a, const Vector2d & b) |
std::optional< std::vector< Vector2d > > | intersect_at(const Line & a, const Line & b) |
std::optional< std::vector< Vector2d > > | intersect_at(const Rect & a, const Vector2d & b) |
std::optional< std::vector< Vector2d > > | intersect_at(const Circle & a, const Vector2d & b) |
constexpr DCMotorParam | generate_mabuchi_motor_param(Volt nominal_voltage, Rpm free_speed, Ampere free_current, Torque stall_torque, Ampere stall_current, Henry inductance, Inertia rotor_inertia) |
constexpr DCMotorParam | generate_maxon_brush_motor_param(Volt nominal_voltage, Rpm free_speed, Ampere free_current, Ohm resistance, Henry inductance, TorqueConstant Kt, Inertia rotor_inertia) |
TransferFunction | make_motor_vel_tf(const DCMotorParam & motor, const double dt) DCモーターのモデルから角速度の伝達関数を生成する |
TransferFunction | make_motor_pos_tf(const DCMotorParam & motor, const double dt) DCモーターのモデルから角度の伝達関数を生成する |
TransferFunction | make_geared_motor_vel_tf(const DCGearedMotorParam & geared_motor, const double dt) ギアヘッド付きDCモーターのモデルから角速度の伝達関数を生成する |
TransferFunction | make_geared_motor_pos_tf(const DCGearedMotorParam & geared_motor, const double dt) ギアヘッド付きDCモーターのモデルから角度の伝達関数を生成する |
std::tuple< bool, Eigen::VectorXd, size_t > | barrier_method(std::function< double(const Eigen::VectorXd &)> f, ConstraintArray constraint, Eigen::VectorXd x_init, const double r_init =10.0, const double tol =1e-3, const size_t max_iter =1000) バリア法 |
void | bfgs_step(Eigen::MatrixXd & hess, Eigen::VectorXd s, Eigen::VectorXd y) BFGS法 |
void | powells_modified_bfgs_step(Eigen::MatrixXd & hess, Eigen::VectorXd s, Eigen::VectorXd y, Eigen::VectorXd dgg, double gamma =0.2) パウエルの修正BFGS法 |
void | powells_modified_bfgs_step(Eigen::MatrixXd & hess, Eigen::VectorXd s, Eigen::VectorXd y, double gamma =0.2) |
double | bracketing_serach(std::function< double(Eigen::VectorXd)> func, std::function< Eigen::VectorXd(Eigen::VectorXd)> grad, const Eigen::VectorXd & x, const Eigen::VectorXd & d, double gamma =0.3, double tau =0.9, const size_t max_iter =1000) アルミホ条件を満たすステップ幅を求める囲い込み法 |
double | bracketing_serach(std::function< double(double)> func, const double init =1.0, const double beta =0.9, const size_t max_iter =1000) 囲い込み法 |
double | derivative(std::function< double(double)> f, double x, double eps =std::pow(std::numeric_limits< double >::epsilon(), 0.5)) R -> Rの数値微分 |
Eigen::VectorXd | derivative(std::function< double(Eigen::VectorXd)> f, Eigen::VectorXd x, double eps =std::pow(std::numeric_limits< double >::epsilon(), 0.5)) R^n -> Rの数値微分 |
Eigen::MatrixXd | derivative(std::function< Eigen::VectorXd(Eigen::VectorXd)> f, Eigen::VectorXd x, double eps =std::pow(std::numeric_limits< double >::epsilon(), 0.5)) R^n -> R^mの数値微分 |
double | second_derivative(std::function< double(double)> f, double x, double eps =std::pow(std::numeric_limits< double >::epsilon(), 0.5)) R -> Rの2回数値微分 |
Eigen::MatrixXd | second_derivative(std::function< double(Eigen::VectorXd)> f, Eigen::VectorXd x, double eps =std::pow(std::numeric_limits< double >::epsilon(), 0.5)) R^n -> Rの2回数値微分 |
Eigen::MatrixXd | mixed_derivative(std::function< double(Eigen::VectorXd, Eigen::VectorXd)> f, Eigen::VectorXd x, Eigen::VectorXd y, double eps =std::pow(std::numeric_limits< double >::epsilon(), 0.5)) R^(n, m) -> Rのn,mでの偏微分 |
Eigen::MatrixXd | approx_hessian(std::function< double(Eigen::VectorXd)> f, Eigen::VectorXd x, double eps =std::pow(std::numeric_limits< double >::epsilon(), 0.5)) |
double | golden_search(std::function< double(double)> f, double low, double high, const double tol =1e-6, const size_t max_iter =100) 黄金探索 |
Eigen::VectorXd | leastsq(const Eigen::MatrixXd & A, const Eigen::VectorXd & b) |
std::tuple< Eigen::MatrixXd, Eigen::VectorXd > | lsi2qp(const Eigen::MatrixXd & C, const Eigen::VectorXd & d) |
std::tuple< bool, Eigen::VectorXd, size_t > | newton_method(std::function< Eigen::VectorXd(const Eigen::VectorXd &)> grad, std::function< Eigen::MatrixXd(const Eigen::VectorXd &)> hesse, Eigen::VectorXd x_init, const double tol =1e-6, const size_t max_iter =1000) ニュートン法 |
std::tuple< bool, Eigen::VectorXd, size_t > | penalty_method(std::function< double(const Eigen::VectorXd &)> f, ConstraintArray constraint, Eigen::VectorXd x_init, const double r_init =1.0, const double tol =1e-3, const size_t max_iter =1000) ペナルティ法 |
QuadProg::Result | quadprog(const QuadProgProblem & prob, const Eigen::VectorXd & x0, QuadProg::Method method =QuadProg::Method::ADMM) |
QuadProg::Result | quadprog(const Eigen::MatrixXd & Q, const Eigen::VectorXd & c, const Eigen::VectorXd & x0, QuadProg::Method method =QuadProg::Method::ADMM) |
QuadProg::Result | quadprog(const Eigen::MatrixXd & Q, const Eigen::VectorXd & c, const Eigen::MatrixXd & A, const Eigen::VectorXd & b, const Eigen::VectorXd & x0, QuadProg::Method method =QuadProg::Method::ADMM) |
QuadProg::Result | quadprog(const Eigen::MatrixXd & Q, const Eigen::VectorXd & c, const Eigen::MatrixXd & A, const Eigen::VectorXd & b, const Eigen::MatrixXd & Aeq, const Eigen::VectorXd & beq, const Eigen::VectorXd & lb, const Eigen::VectorXd & ub, const Eigen::VectorXd & x0, QuadProg::Method method =QuadProg::Method::ADMM) |
QuadProg::Result | quadprog_ineq_con(const Eigen::MatrixXd & Q, const Eigen::VectorXd & c, const Eigen::MatrixXd & A, const Eigen::VectorXd & b, const Eigen::VectorXd & x0, QuadProg::Method method =QuadProg::Method::ADMM) |
QuadProg::Result | quadprog_eq_con(const Eigen::MatrixXd & Q, const Eigen::VectorXd & c, const Eigen::MatrixXd & Aeq, const Eigen::VectorXd & beq, const Eigen::VectorXd & x0, QuadProg::Method method =QuadProg::Method::ADMM) |
QuadProg::Result | quadprog_bound_con(const Eigen::MatrixXd & Q, const Eigen::VectorXd & c, const Eigen::VectorXd & lb, const Eigen::VectorXd & ub, const Eigen::VectorXd & x0, QuadProg::Method method =QuadProg::Method::ADMM) |
std::tuple< bool, Eigen::VectorXd, size_t > | quasi_newton_method(std::function< double(const Eigen::VectorXd &)> f, std::function< Eigen::VectorXd(const Eigen::VectorXd &)> grad, Eigen::VectorXd x_init, const double tol =1e-6, const size_t max_iter =1000) 準ニュートン法 |
std::tuple< bool, Eigen::VectorXd, size_t > | steepest_descent_method(std::function< double(const Eigen::VectorXd &)> f, std::function< Eigen::VectorXd(const Eigen::VectorXd &)> grad, Eigen::VectorXd x_init, const double tol =1e-6, const size_t max_iter =1000) 最急降下法 |
std::vector< Eigen::Vector2i > | a_star(const Eigen::Vector2i & start, const Eigen::Vector2i & end, const Eigen::MatrixXi & map) A*法 |
template <class EigenVector ,class Map > std::vector< EigenVector > |
fmt_star(const Map & map, const EigenVector & x_init, const EigenVector & x_goal, const FMTStarConfig & config =FMTStarConfig()) |
double | normalized_mjm_position(double t) |
double | normalized_mjm_velocity(double t) |
double | normalized_mjm_acceleration(double t) |
double | normalized_mjm_jerk(double t) |
std::vector< Eigen::Vector2i > | wave_propagation(const Eigen::Vector2i & start, const Eigen::Vector2i & end, const Eigen::MatrixXi & map) Wave propagation法 |
std::tuple< std::vector< double >, std::vector< double > > | bode(TransferFunction & tf, const std::vector< double > & omegas =logspace(-2, 2, 500), bool gain_db_mode =true, bool phase_deg_mode =true) ボード線図の応答を計算する |
template <class T > T |
integrate_forward_euler(double dt, const T & x, const T & u, std::function< T(const T &, const T &)> dynamics) |
template <class T > T |
integrate_modified_euler(double dt, const T & x, const T & u, std::function< T(const T &, const T &)> dynamics) |
template <class T > T |
integrate_rk4(double dt, const T & x, const T & u, std::function< T(const T &, const T &)> dynamics) |
std::tuple< std::vector< double >, std::vector< double > > | nyquist(TransferFunction & tf, const std::vector< double > & omegas =logspace(-2, 2, 500)) ナイキスト線図の応答を計算する |
std::ostream & | operator<<(std::ostream & os, const Polynomial & v) |
template <class CONTROLLER_T ,class SYSTEM_T > SisoFeedbackSystem |
make_feedback_system(CONTROLLER_T & controller, SYSTEM_T & system) |
void | set_controller(SisoFeedbackSystem::func_list_t & fn, PID & controller) |
void | set_controller(SisoFeedbackSystem::func_list_t & fn, NctfController & controller) |
void | set_system(SisoFeedbackSystem::func_list_t & fn, TransferFunction & system) |
StateSpaceSystem | tf2ss(const TransferFunction & tf) |
std::tuple< std::vector< double >, std::vector< double > > | impulse(const std::function< double(double)> & sys, double dt, double time) インパルス応答を求める |
template <class SysType ,typename std::enable_if< internal::is_system_class< SysType >::value >::type * =nullptr> std::tuple< std::vector< double >, std::vector< double > > |
impulse(SysType & sys, double time) |
std::tuple< std::vector< double >, std::vector< double > > | step(const std::function< double(double)> & sys, double dt, double time, const double gain =1.0) ステップ応答を求める |
template <class SysType ,typename std::enable_if< internal::is_system_class< SysType >::value >::type * =nullptr> std::tuple< std::vector< double >, std::vector< double > > |
step(SysType & sys, double time, const double gain =1.0) |
template <class FilterType ,typename std::enable_if< internal::is_pure_filter_class< FilterType >::value >::type * =nullptr> std::tuple< std::vector< double >, std::vector< double > > |
step(FilterType & filter, double time, const double gain =1.0) |
template <class DataIterativeType > std::tuple< DataIterativeType, DataIterativeType > |
lsim(const std::function< double(double)> & sys, double dt, const DataIterativeType & input) 任意の入力による応答を求める |
template <class DataIterativeType ,class SysType ,typename std::enable_if< internal::is_system_class< SysType >::value >::type * =nullptr> std::tuple< DataIterativeType, DataIterativeType > |
lsim(SysType sys, const DataIterativeType & input, bool skip_reset =false) |
template <class DataIterativeType > std::tuple< DataIterativeType, DataIterativeType > |
lsim(TransferFunction::tf_t sys_config, const DataIterativeType & input) |
template <class DataIterativeType > std::tuple< DataIterativeType, DataIterativeType, DataIterativeType > |
lsim(SisoFeedbackSystem sys, const DataIterativeType & input, bool skip_reset =false) |
template <class DataIterativeType > DataIterativeType |
lsim_y(const std::function< double(double)> & sys, double dt, const DataIterativeType & input) |
template <class DataIterativeType ,class SysType ,typename std::enable_if< internal::is_system_class< SysType >::value >::type * =nullptr> DataIterativeType |
lsim_y(SysType sys, const DataIterativeType & input, bool skip_reset =false) |
template <class DataIterativeType > DataIterativeType |
lsim_y(TransferFunction::tf_t sys_config, const DataIterativeType & input) |
template <class DataIterativeType > std::tuple< DataIterativeType, DataIterativeType > |
lsim_uy(SisoFeedbackSystem sys, const DataIterativeType & input, bool skip_reset =false) |
template <class DataIterativeType > DataIterativeType |
lsim_y(SisoFeedbackSystem sys, const DataIterativeType & input, bool skip_reset =false) |
template <class UnitDimType ,int FromTag,int ToTag,bool IsNormalTag =tag::is_normal_tag constexpr double |
conv_factor() |
template <typename T1 ,typename T2 ,class UnitDim ,class Prefix ,int Tag> constexpr auto |
operator*(const Unit< T1, UnitDim, Prefix, Tag > & l_value, const T2 & r_value) |
template <typename T1 ,typename T2 ,class UnitDim ,class Prefix ,int Tag> constexpr auto |
operator*(const T1 & l_value, const Unit< T2, UnitDim, Prefix, Tag > & r_value) |
template <typename T1 ,typename T2 ,class UnitDim ,class Prefix ,int Tag> constexpr auto |
operator/(const T1 & l_value, const Unit< T2, UnitDim, Prefix, Tag > & r_value) |
template <typename T1 ,typename T2 ,class UnitDim ,class Prefix ,int Tag> constexpr auto |
operator/(const Unit< T1, UnitDim, Prefix, Tag > & l_value, const T2 & r_value) |
template <typename T1 ,class UnitDim1 ,class Prefix1 ,int Tag1,typename T2 ,class UnitDim2 ,class Prefix2 ,int Tag2> constexpr auto |
operator*(const Unit< T1, UnitDim1, Prefix1, Tag1 > & lhl, const Unit< T2, UnitDim2, Prefix2, Tag2 > & rhl) |
template <typename T1 ,class UnitDim1 ,class Prefix1 ,int Tag1,typename T2 ,class UnitDim2 ,class Prefix2 ,int Tag2> constexpr auto |
operator/(const Unit< T1, UnitDim1, Prefix1, Tag1 > & lhl, const Unit< T2, UnitDim2, Prefix2, Tag2 > & rhl) |
template <typename T ,class UnitDim ,class Prefix1 ,class Prefix2 ,int Tag> constexpr auto |
operator+(const Unit< T, UnitDim, Prefix1, Tag > & lhl, const Unit< T, UnitDim, Prefix2, Tag > & rhl) |
template <typename T ,class UnitDim ,class Prefix1 ,class Prefix2 ,int Tag> constexpr auto |
operator-(const Unit< T, UnitDim, Prefix1, Tag > & lhl, const Unit< T, UnitDim, Prefix2, Tag > & rhl) |
template <class ForwardIterator > constexpr ForwardIterator |
shift_left(ForwardIterator first, ForwardIterator last, typename std::iterator_traits< ForwardIterator >::difference_type n) Substitute shift_left function in C++20 alogorithm. |
template <class ForwardIterator > constexpr ForwardIterator |
shift_right(ForwardIterator first, ForwardIterator last, typename std::iterator_traits< ForwardIterator >::difference_type n) Substitute shift_right function in C++20 alogorithm. |
template <typename... Args> std::string |
c_format(const std::string & format, Args const &... args) printfと同様の操作でstd::stringを得る |
template <typename MatrixType > bool |
isPositiveDefinite(const MatrixType & matrix) |
template <typename MatrixType > MatrixType |
pseudo_inverse(const MatrixType & a, double epsilon =std::numeric_limits< double >::epsilon()) |
template <typename MatrixType > MatrixType |
sr_inverse(const MatrixType & a, double w0 =1e-2, Eigen::MatrixXd W =Eigen::MatrixXd()) |
template <typename T > constexpr bool |
in_range_open(T x, T min, T max) |
template <typename T > constexpr bool |
in_range(T x, T min, T max) |
template <typename T > constexpr int |
sgn(T x) |
template <typename T > constexpr double |
radians(T deg) |
template <typename T > constexpr double |
degrees(T rad) |
double | normalize_angle_positive(double angle) |
double | normalize_angle(double angle) |
double | shortest_angular_distance(double from, double to) |
double | nearest_angle(double from, double to) |
constexpr double | square(const double x) |
constexpr double | cubic(const double x) |
constexpr double | lerp(const double a, const double b, const double t) |
constexpr double | approx_eq(const double a, const double b) |
constexpr double | approx_zero(const double a) |
template <typename Real =double> Real |
gererate_random() 0.0〜1.0までの一様分布の乱数を生成する |
template <class DataType =std::vector DataType |
arrange(double start, double end, double step =1.0) startからendまでstepずつ増える点のベクトルを返す |
template <class DataType =std::vector DataType |
linspace(double start, double end, size_t n =100) startからendまでをn分割した点のベクトルを返す |
template <class DataType =std::vector DataType |
implusespace(double time, double dt =1.0) |
template <class DataType =std::vector DataType |
stepspace(double time, double dt =1.0) |
template <class DataType =std::vector DataType |
logspace(double start, double end, size_t n =100) 10^startから10^endまで対数的に等間隔なn個の点のベクトルを返す |
std::vector< double > | funcspace(std::function< double(size_t, size_t)> f, size_t n =100) |
std::vector< double > | sinspace(double a, double b, size_t n =100) |
Attributes
Name | |
---|---|
constexpr DCMotorParam | RZ_735VA_9517 |
constexpr DCMotorParam | RS_775_8513 |
constexpr DCMotorParam | RS_555VC_5524 |
constexpr DCMotorParam | RS_380PH_4045 |
constexpr DCMotorParam | RS_385PH_2465 |
constexpr DCMotorParam | RE_65_250_18 |
constexpr GearHeadParam | IG42C_4 |
constexpr GearHeadParam | IG42C_14 |
constexpr GearHeadParam | IG42C_17 |
constexpr GearHeadParam | IG32_27 |
constexpr GearHeadParam | IG32_71 |
constexpr GearHeadParam | IG32_100 |
constexpr double | PI 円周率 |
constexpr double | HALF_PI 円周率 / 2 |
constexpr double | TWO_PI 円周率 * 2 |
constexpr double | DEG_TO_RAD degree -> radians |
constexpr double | RAD_TO_DEG radian -> degree |
constexpr double | EULER ネイピア数 |
constexpr double | GRAVITY 重力 |
constexpr double | Nm2gfm |
constexpr double | gfm2Nm |
constexpr double | mNm2gfcm |
constexpr double | gfcm2mNm |
Types Documentation
enum CanonicalizeMode
Enumerator | Value | Description |
---|---|---|
COMPANION | ||
OBSERBAVLE | ||
CONTROLLABLE |
enum OCPConstraintType
Enumerator | Value | Description |
---|---|---|
Eq | ||
Ineq |
enum OCPIntegrationMethod
Enumerator | Value | Description |
---|---|---|
ForwardEuler | ||
ModifiedEuler | ||
RK4 |
enum UnitIndex
Enumerator | Value | Description |
---|---|---|
MetereIdx | ||
KiloGramIdx | ||
SecondIdx | ||
AmpereIdx | ||
KelvinIdx | ||
MoleIdx | ||
CandelaIdx |
using ADScalar
template <class DerType =Eigen::VectorXd>
using cpp_robotics::ADScalar = typedef Eigen::AutoDiffScalar<DerType>;
using ADVectorXd
using cpp_robotics::ADVectorXd = typedef ADVector<Eigen::VectorXd, Eigen::Dynamic>;
using ShapeType
using cpp_robotics::ShapeType = typedef std::variant<Vector2d, Line, Quad, Rect, Triangle, Circle>;
using TorqueConstant
using cpp_robotics::unit::TorqueConstant = typedef unit_assem::unit_div<Torque, Ampere>::unit;
using BackEmfConstant
using cpp_robotics::unit::BackEmfConstant = typedef unit_assem::unit_div<Volt, AngularVelocity>::unit;
using FrictionConstant
using cpp_robotics::unit::FrictionConstant = typedef unit_assem::unit_mul<Torque, Second>::unit;
using ObstacleShapeType
using cpp_robotics::ObstacleShapeType = typedef std::variant<Rect, Circle>;
using GridMap2d
using cpp_robotics::GridMap2d = typedef GridMap<2>;
using GridMap3d
using cpp_robotics::GridMap3d = typedef GridMap<3>;
using GridMapXd
using cpp_robotics::GridMapXd = typedef GridMap<Eigen::Dynamic>;
using CatumullRomSplinePath2d
using cpp_robotics::CatumullRomSplinePath2d = typedef CatumullRomSplinePath<Eigen::Vector2d>;
using CatumullRomSplinePath3d
using cpp_robotics::CatumullRomSplinePath3d = typedef CatumullRomSplinePath<Eigen::Vector3d>;
using CubicSplinePath2d
using cpp_robotics::CubicSplinePath2d = typedef CubicSplinePath<Eigen::Vector2d>;
using CubicSplinePath3d
using cpp_robotics::CubicSplinePath3d = typedef CubicSplinePath<Eigen::Vector3d>;
using Second
using cpp_robotics::unit::Second = typedef Unit<double, unit_dimention::second, prefix::none>;
using MilliSecond
using cpp_robotics::unit::MilliSecond = typedef Unit<double, unit_dimention::second, prefix::milli>;
using MicroSecond
using cpp_robotics::unit::MicroSecond = typedef Unit<double, unit_dimention::second, prefix::micro>;
using Meter
using cpp_robotics::unit::Meter = typedef Unit<double, unit_dimention::metere, prefix::none>;
using MilliMeter
using cpp_robotics::unit::MilliMeter = typedef Unit<double, unit_dimention::metere, prefix::milli>;
using MicroMeter
using cpp_robotics::unit::MicroMeter = typedef Unit<double, unit_dimention::metere, prefix::micro>;
using CentiMeter
using cpp_robotics::unit::CentiMeter = typedef Unit<double, unit_dimention::metere, prefix::centi>;
using KiloGram
using cpp_robotics::unit::KiloGram = typedef Unit<double, unit_dimention::kilogram, prefix::none>;
using Gram
using cpp_robotics::unit::Gram = typedef Unit<double, unit_dimention::kilogram, prefix::milli>;
using Watt
using cpp_robotics::unit::Watt = typedef Unit<double, unit_dimention::watt, prefix::none>;
using KiloWatt
using cpp_robotics::unit::KiloWatt = typedef Unit<double, unit_dimention::watt, prefix::kilo>;
using Newton
using cpp_robotics::unit::Newton = typedef Unit<double, unit_dimention::newton, prefix::none>;
using KiloNewton
using cpp_robotics::unit::KiloNewton = typedef Unit<double, unit_dimention::newton, prefix::kilo>;
using Pascal
using cpp_robotics::unit::Pascal = typedef Unit<double, unit_dimention::pascal, prefix::none>;
using KiloPascal
using cpp_robotics::unit::KiloPascal = typedef Unit<double, unit_dimention::pascal, prefix::kilo>;
using Hertz
using cpp_robotics::unit::Hertz = typedef Unit<double, unit_dimention::hertz, prefix::none>;
using Area
using cpp_robotics::unit::Area = typedef Unit<double, unit_dimention::area, prefix::none>;
using Volume
using cpp_robotics::unit::Volume = typedef Unit<double, unit_dimention::volume, prefix::none>;
using Velocity
using cpp_robotics::unit::Velocity = typedef Unit<double, unit_dimention::velocity, prefix::none>;
using Acceleration
using cpp_robotics::unit::Acceleration = typedef Unit<double, unit_dimention::acceleration, prefix::none>;
using Dencity
using cpp_robotics::unit::Dencity = typedef Unit<double, unit_dimention::dencity, prefix::none>;
using Torque
using cpp_robotics::unit::Torque = typedef Unit<double, unit_dimention::torque, prefix::none>;
using Inertia
using cpp_robotics::unit::Inertia = typedef Unit<double, unit_dimention::inertia, prefix::none>;
using Ampere
using cpp_robotics::unit::Ampere = typedef Unit<double, unit_dimention::ampere, prefix::none>;
using MilliAmpere
using cpp_robotics::unit::MilliAmpere = typedef Unit<double, unit_dimention::ampere, prefix::milli>;
using Volt
using cpp_robotics::unit::Volt = typedef Unit<double, unit_dimention::volt, prefix::none>;
using MilliVolt
using cpp_robotics::unit::MilliVolt = typedef Unit<double, unit_dimention::volt, prefix::milli>;
using Ohm
using cpp_robotics::unit::Ohm = typedef Unit<double, unit_dimention::ohm, prefix::none>;
using MilliOhm
using cpp_robotics::unit::MilliOhm = typedef Unit<double, unit_dimention::ohm, prefix::milli>;
using Henry
using cpp_robotics::unit::Henry = typedef Unit<double, unit_dimention::henry, prefix::none>;
using MilliHenry
using cpp_robotics::unit::MilliHenry = typedef Unit<double, unit_dimention::henry, prefix::milli>;
using Farad
using cpp_robotics::unit::Farad = typedef Unit<double, unit_dimention::farad, prefix::none>;
using MilliFarad
using cpp_robotics::unit::MilliFarad = typedef Unit<double, unit_dimention::farad, prefix::milli>;
using MicroFarad
using cpp_robotics::unit::MicroFarad = typedef Unit<double, unit_dimention::farad, prefix::micro>;
using NanoFarad
using cpp_robotics::unit::NanoFarad = typedef Unit<double, unit_dimention::farad, prefix::nano>;
using Radian
using cpp_robotics::unit::Radian = typedef Unit<double, unit_dimention::angle, prefix::none, tag::angle::radian>;
using Degree
using cpp_robotics::unit::Degree = typedef Unit<double, unit_dimention::angle, prefix::none, tag::angle::degree>;
using AngularVelocity
using cpp_robotics::unit::AngularVelocity = typedef Unit<double, unit_dimention::angular_velocity, prefix::none, tag::angular_vel::rad_per_sec>;
using Rps
using cpp_robotics::unit::Rps = typedef Unit<double, unit_dimention::angular_velocity, prefix::none, tag::angular_vel::rps>;
using Rpm
using cpp_robotics::unit::Rpm = typedef Unit<double, unit_dimention::angular_velocity, prefix::none, tag::angular_vel::rpm>;
using AngularAcceleration
using cpp_robotics::unit::AngularAcceleration = typedef Unit<double, unit_dimention::angular_acceleration, prefix::none>;
using UniformIntRandomEngine
using cpp_robotics::UniformIntRandomEngine = typedef RandomGenerator<std::uniform_int_distribution<> >;
整数型一様分布乱数生成エンジン
using UniformRealRandomEngine
using cpp_robotics::UniformRealRandomEngine = typedef RandomGenerator<std::uniform_real_distribution<> >;
実数型一様分布乱数生成エンジン
using BernoulliRandomEngine
using cpp_robotics::BernoulliRandomEngine = typedef RandomGenerator<std::bernoulli_distribution>;
ベルヌーイ分布乱数生成エンジン
using BinomialRandomEngine
using cpp_robotics::BinomialRandomEngine = typedef RandomGenerator<std::binomial_distribution<> >;
二項分布乱数生成エンジン
using GeometricRandomEngine
using cpp_robotics::GeometricRandomEngine = typedef RandomGenerator<std::geometric_distribution<> >;
幾何学分布乱数生成エンジン
using NegativeBinomialRandomEngine
using cpp_robotics::NegativeBinomialRandomEngine = typedef RandomGenerator<std::negative_binomial_distribution<> >;
負の二項分布乱数生成エンジン
using PoissonRandomEngine
using cpp_robotics::PoissonRandomEngine = typedef RandomGenerator<std::poisson_distribution<> >;
ポワソン分布乱数生成エンジン
using ExponentialRandomEngine
using cpp_robotics::ExponentialRandomEngine = typedef RandomGenerator<std::exponential_distribution<> >;
指数分布乱数生成エンジン
using GammaRandomEngine
using cpp_robotics::GammaRandomEngine = typedef RandomGenerator<std::gamma_distribution<> >;
ガンマ分布乱数生成エンジン
using WeibullRandomEngine
using cpp_robotics::WeibullRandomEngine = typedef RandomGenerator<std::weibull_distribution<> >;
ワイブル分布乱数生成エンジン
using ExtremeValueRandomEngine
using cpp_robotics::ExtremeValueRandomEngine = typedef RandomGenerator<std::extreme_value_distribution<> >;
極値分布乱数生成エンジン
using NormalRandomEngine
using cpp_robotics::NormalRandomEngine = typedef RandomGenerator<std::normal_distribution<> >;
正規分布乱数生成エンジン
using LognormalRandomEngine
using cpp_robotics::LognormalRandomEngine = typedef RandomGenerator<std::lognormal_distribution<> >;
対数正規分布乱数生成エンジン
using ChiSquaredRandomEngine
using cpp_robotics::ChiSquaredRandomEngine = typedef RandomGenerator<std::chi_squared_distribution<> >;
カイ二乗分布乱数生成エンジン
using CauchyRandomEngine
using cpp_robotics::CauchyRandomEngine = typedef RandomGenerator<std::cauchy_distribution<> >;
コーシー分布乱数生成エンジン
using FisherFRandomEngine
using cpp_robotics::FisherFRandomEngine = typedef RandomGenerator<std::fisher_f_distribution<> >;
フィッシャーのF分布乱数生成エンジン
using StudentTRandomEngine
using cpp_robotics::StudentTRandomEngine = typedef RandomGenerator<std::student_t_distribution<> >;
ステューデントのt分布乱数生成エンジン
using DiscreteRandomEngine
using cpp_robotics::DiscreteRandomEngine = typedef RandomGenerator<std::discrete_distribution<> >;
整数のインデックスごとに離散した確率分布の乱数生成エンジン
using PiecewiseConstantRandomEngine
using cpp_robotics::PiecewiseConstantRandomEngine = typedef RandomGenerator<std::piecewise_constant_distribution<> >;
区間ごとの重み付けを定数値とした分布の乱数生成エンジン
using PiecewiseLinearRandomEngine
using cpp_robotics::PiecewiseLinearRandomEngine = typedef RandomGenerator<std::piecewise_linear_distribution<> >;
区間ごとの重み付けを線形に接続した分布の乱数生成エンジン
using Quaternionf
using cpp_robotics::Quaternionf = typedef Quaternion<float>;
using Quaterniond
using cpp_robotics::Quaterniond = typedef Quaternion<double>;
using Transformf
using cpp_robotics::Transformf = typedef Transform<float>;
using Transformd
using cpp_robotics::Transformd = typedef Transform<double>;
using Vector2f
using cpp_robotics::Vector2f = typedef Vector2<float>;
using Vector2d
using cpp_robotics::Vector2d = typedef Vector2<double>;
using Vector3f
using cpp_robotics::Vector3f = typedef Vector3<float>;
using Vector3d
using cpp_robotics::Vector3d = typedef Vector3<double>;
using Vector4f
using cpp_robotics::Vector4f = typedef Vector4<float>;
using Vector4d
using cpp_robotics::Vector4d = typedef Vector4<double>;
Functions Documentation
function calcu_transformatoin
template <int DIM>
static std::pair< Eigen::Matrix< double, DIM, DIM >, Eigen::Matrix< double, DIM, 1 > > calcu_transformatoin(
std::vector< Eigen::Matrix< double, DIM, 1 >> dest,
std::vector< Eigen::Matrix< double, DIM, 1 >> fixed
)
function icp
template <int DIM>
static std::tuple< std::vector< Eigen::Matrix< double, DIM, 1 > >, Eigen::MatrixXd, size_t > icp(
std::vector< Eigen::Matrix< double, DIM, 1 >> dest,
const std::vector< Eigen::Matrix< double, DIM, 1 >> & fixed,
double eps =1e-4,
size_t max_iter =100
)
function mahalanobis
double mahalanobis(
const Eigen::VectorXd & a,
const Eigen::VectorXd & b,
const Eigen::MatrixXd cov_inv
)
マハラノビス距離の計算
Parameters:
- a
- b
- cov_inv 分散の逆行列
Return: double マハラノビス距離
function poly_regression
Polynomial poly_regression(
const std::vector< double > & x,
const std::vector< double > & y,
const size_t degree
)
回帰曲線
Parameters:
- x
- y
- degree 回帰曲線の次元
Return: Polynomial
function homogeneous
static Eigen::MatrixXd homogeneous(
const Eigen::MatrixXd & R,
const Eigen::VectorXd & T
)
function transform_by_homogeneous
static Eigen::VectorXd transform_by_homogeneous(
const Eigen::MatrixXd & H,
const Eigen::VectorXd & x
)
function solve_riccati_arimoto_potter
static std::optional< Eigen::MatrixXd > solve_riccati_arimoto_potter(
const Eigen::MatrixXd & A,
const Eigen::MatrixXd & B,
const Eigen::MatrixXd & Q,
const Eigen::MatrixXd & R
)
有本-ポッターの方法によるリカッチ方程式の解法
Parameters:
- A
- B
- Q
- R
Return: std::optional
function lqr
static Eigen::MatrixXd lqr(
const Eigen::MatrixXd & A,
const Eigen::MatrixXd & B,
const Eigen::MatrixXd & Q,
const Eigen::MatrixXd & R
)
function controllability_matrix
static Eigen::MatrixXd controllability_matrix(
const Eigen::MatrixXd & A,
const Eigen::VectorXd & B
)
可制御性行列の計算
Parameters:
- A
- B
Return: Eigen::MatrixXd
function is_controllable
static bool is_controllable(
const Eigen::MatrixXd & A,
const Eigen::VectorXd & B
)
可制御性の判別
Parameters:
- A
- B
Return:
- true システムが可制御である
- false システムが可制御でない
function is_controllable
static bool is_controllable(
const StateSpaceSystem & sys
)
function observability_matrix
static Eigen::MatrixXd observability_matrix(
const Eigen::MatrixXd & A,
const Eigen::RowVectorXd & C
)
可観測性行列を計算する
Parameters:
- A
- C
Return: Eigen::MatrixXd
function is_observable
static bool is_observable(
const Eigen::MatrixXd & A,
const Eigen::RowVectorXd & C
)
可観測性の判別
Parameters:
- A
- C
Return:
- true システムが可観測である
- false システムが可観測でない
function is_observable
static bool is_observable(
const StateSpaceSystem & sys
)
Parameters:
- sys 可観測性の判別
Return:
- true システムが可観測である
- false システムが可観測でない
function canonicalize_system
static std::tuple< Eigen::MatrixXd, Eigen::MatrixXd, Eigen::MatrixXd > canonicalize_system(
const Eigen::MatrixXd & A,
const Eigen::MatrixXd & B,
const Eigen::MatrixXd & C,
CanonicalizeMode mode =CanonicalizeMode::COMPANION
)
同値変換による可制御正準形への変換
Parameters:
- A
- B
- C
- mode
Return: std::tuple
function canonicalize_system
static std::tuple< Eigen::MatrixXd, Eigen::MatrixXd, Eigen::MatrixXd > canonicalize_system(
const StateSpaceSystem & sys,
CanonicalizeMode mode =CanonicalizeMode::COMPANION
)
同値変換による可制御正準形への変換
Parameters:
- sys
- mode
Return: std::tuple
function place
static Eigen::VectorXd place(
const StateSpaceSystem & sys,
std::vector< double > poles
)
アッカーマン法によるSISOモデルの極配置
Parameters:
- sys
- poles
Return: Eigen::VectorXd
function OCPInputBoundConstraints
static OCPConstraintArray OCPInputBoundConstraints(
const Eigen::VectorXd & lb,
const Eigen::VectorXd & ub,
double slope =10.0
)
function OCPStateBoundConstrants
static OCPConstraintArray OCPStateBoundConstrants(
const Eigen::VectorXd & lb,
const Eigen::VectorXd & ub,
double slope =10.0
)
function vrft_leastsq
Eigen::VectorXd vrft_leastsq(
const Eigen::VectorXd & u,
const Eigen::VectorXd & y,
const double Ts,
TransferFunction ref_model,
std::vector< TransferFunction > & control_base,
std::optional< TransferFunction > prefilter
)
function vrft_pid
Eigen::VectorXd vrft_pid(
const Eigen::VectorXd & u,
const Eigen::VectorXd & y,
const double Ts,
TransferFunction ref_model,
std::optional< TransferFunction > prefilter,
double Td =0.01
)
function vrft_p
Eigen::VectorXd vrft_p(
const Eigen::VectorXd & u,
const Eigen::VectorXd & y,
const double Ts,
TransferFunction ref_model,
std::optional< TransferFunction > prefilter
)
function vrft_pi
Eigen::VectorXd vrft_pi(
const Eigen::VectorXd & u,
const Eigen::VectorXd & y,
const double Ts,
TransferFunction ref_model,
std::optional< TransferFunction > prefilter
)
function vrft_pd
Eigen::VectorXd vrft_pd(
const Eigen::VectorXd & u,
const Eigen::VectorXd & y,
const double Ts,
TransferFunction ref_model,
std::optional< TransferFunction > prefilter,
double Td =0.01
)
function operator<<
std::ostream & operator<<(
std::ostream & os,
const Vector2d & v
)
function operator<<
std::ostream & operator<<(
std::ostream & os,
const Vector3d & v
)
function operator<<
std::ostream & operator<<(
std::ostream & os,
const Vector4d & v
)
function operator<<
std::ostream & operator<<(
std::ostream & os,
const Transformd & v
)
function intersect
bool intersect(
const Vector2d & a,
const Vector2d & b
)
function intersect
bool intersect(
const Vector2d & a,
const Line & b
)
function intersect
bool intersect(
const Vector2d & a,
const Rect & b
)
function intersect
bool intersect(
const Vector2d & a,
const Circle & b
)
function intersect
bool intersect(
const Vector2d & a,
const Triangle & b
)
function intersect
bool intersect(
const Vector2d & a,
const Quad & b
)
function intersect
bool intersect(
const Line & a,
const Vector2d & b
)
function intersect
bool intersect(
const Line & a,
const Line & b
)
function intersect
bool intersect(
const Line & a,
const Circle & b
)
function intersect
bool intersect(
const Rect & a,
const Vector2d & b
)
function intersect
bool intersect(
const Circle & a,
const Vector2d & b
)
function intersect_at
std::optional< std::vector< Vector2d > > intersect_at(
const Vector2d & a,
const Vector2d & b
)
function intersect_at
std::optional< std::vector< Vector2d > > intersect_at(
const Vector2d & a,
const Line & b
)
function intersect_at
std::optional< std::vector< Vector2d > > intersect_at(
const Vector2d & a,
const Rect & b
)
function intersect_at
std::optional< std::vector< Vector2d > > intersect_at(
const Vector2d & a,
const Circle & b
)
function intersect_at
std::optional< std::vector< Vector2d > > intersect_at(
const Line & a,
const Vector2d & b
)
function intersect_at
std::optional< std::vector< Vector2d > > intersect_at(
const Line & a,
const Line & b
)
function intersect_at
std::optional< std::vector< Vector2d > > intersect_at(
const Rect & a,
const Vector2d & b
)
function intersect_at
std::optional< std::vector< Vector2d > > intersect_at(
const Circle & a,
const Vector2d & b
)
function generate_mabuchi_motor_param
inline constexpr DCMotorParam generate_mabuchi_motor_param(
Volt nominal_voltage,
Rpm free_speed,
Ampere free_current,
Torque stall_torque,
Ampere stall_current,
Henry inductance,
Inertia rotor_inertia
)
function generate_maxon_brush_motor_param
inline constexpr DCMotorParam generate_maxon_brush_motor_param(
Volt nominal_voltage,
Rpm free_speed,
Ampere free_current,
Ohm resistance,
Henry inductance,
TorqueConstant Kt,
Inertia rotor_inertia
)
function make_motor_vel_tf
static TransferFunction make_motor_vel_tf(
const DCMotorParam & motor,
const double dt
)
DCモーターのモデルから角速度の伝達関数を生成する
Parameters:
- motor
- dt
Return: TransferFunction
function make_motor_pos_tf
static TransferFunction make_motor_pos_tf(
const DCMotorParam & motor,
const double dt
)
DCモーターのモデルから角度の伝達関数を生成する
Parameters:
- motor
- dt
Return: TransferFunction
function make_geared_motor_vel_tf
static TransferFunction make_geared_motor_vel_tf(
const DCGearedMotorParam & geared_motor,
const double dt
)
ギアヘッド付きDCモーターのモデルから角速度の伝達関数を生成する
Parameters:
- geared_motor
- dt
Return: TransferFunction
function make_geared_motor_pos_tf
static TransferFunction make_geared_motor_pos_tf(
const DCGearedMotorParam & geared_motor,
const double dt
)
ギアヘッド付きDCモーターのモデルから角度の伝達関数を生成する
Parameters:
- geared_motor
- dt
Return: TransferFunction
function barrier_method
static std::tuple< bool, Eigen::VectorXd, size_t > barrier_method(
std::function< double(const Eigen::VectorXd &)> f,
ConstraintArray constraint,
Eigen::VectorXd x_init,
const double r_init =10.0,
const double tol =1e-3,
const size_t max_iter =1000
)
バリア法
function bfgs_step
static void bfgs_step(
Eigen::MatrixXd & hess,
Eigen::VectorXd s,
Eigen::VectorXd y
)
BFGS法
Parameters:
- hess 前ステップまでの近似ヘッシアン
- s x_k+1 - x_k
- y \grad_x L(x_k+1, u_k+1) - \grad_x L(x_k, u_k)
function powells_modified_bfgs_step
static void powells_modified_bfgs_step(
Eigen::MatrixXd & hess,
Eigen::VectorXd s,
Eigen::VectorXd y,
Eigen::VectorXd dgg,
double gamma =0.2
)
パウエルの修正BFGS法
Parameters:
- hess 前ステップまでの近似ヘッシアン
- s x_k+1 - x_k
- y \grad_x L(x_k+1, u_k+1) - \grad_x L(x_k, u_k)
- w \grad g(x+1)g(x+1) - \grad g(x)g(x)
- gamma
function powells_modified_bfgs_step
static void powells_modified_bfgs_step(
Eigen::MatrixXd & hess,
Eigen::VectorXd s,
Eigen::VectorXd y,
double gamma =0.2
)
function bracketing_serach
static double bracketing_serach(
std::function< double(Eigen::VectorXd)> func,
std::function< Eigen::VectorXd(Eigen::VectorXd)> grad,
const Eigen::VectorXd & x,
const Eigen::VectorXd & d,
double gamma =0.3,
double tau =0.9,
const size_t max_iter =1000
)
アルミホ条件を満たすステップ幅を求める囲い込み法
Parameters:
- func
- grad
- x
- d
- gamma
- tau
- max_iter
Return: double
function bracketing_serach
static double bracketing_serach(
std::function< double(double)> func,
const double init =1.0,
const double beta =0.9,
const size_t max_iter =1000
)
囲い込み法
Parameters:
- func
- init
- beta
- max_iter
Return: double
function derivative
static double derivative(
std::function< double(double)> f,
double x,
double eps =std::pow(std::numeric_limits< double >::epsilon(), 0.5)
)
R -> Rの数値微分
Parameters:
- f
- x
- eps
Return: double
function derivative
static Eigen::VectorXd derivative(
std::function< double(Eigen::VectorXd)> f,
Eigen::VectorXd x,
double eps =std::pow(std::numeric_limits< double >::epsilon(), 0.5)
)
R^n -> Rの数値微分
Parameters:
- f
- x
- eps
Return: Eigen::VectorXd
function derivative
static Eigen::MatrixXd derivative(
std::function< Eigen::VectorXd(Eigen::VectorXd)> f,
Eigen::VectorXd x,
double eps =std::pow(std::numeric_limits< double >::epsilon(), 0.5)
)
R^n -> R^mの数値微分
Parameters:
- f
- x
- eps
Return: Eigen::MatrixXd
function second_derivative
static double second_derivative(
std::function< double(double)> f,
double x,
double eps =std::pow(std::numeric_limits< double >::epsilon(), 0.5)
)
R -> Rの2回数値微分
Parameters:
- f
- x
- eps
Return: double
function second_derivative
static Eigen::MatrixXd second_derivative(
std::function< double(Eigen::VectorXd)> f,
Eigen::VectorXd x,
double eps =std::pow(std::numeric_limits< double >::epsilon(), 0.5)
)
R^n -> Rの2回数値微分
Parameters:
- f
- x
- eps
Return: Eigen::MatrixXd
function mixed_derivative
static Eigen::MatrixXd mixed_derivative(
std::function< double(Eigen::VectorXd, Eigen::VectorXd)> f,
Eigen::VectorXd x,
Eigen::VectorXd y,
double eps =std::pow(std::numeric_limits< double >::epsilon(), 0.5)
)
R^(n, m) -> Rのn,mでの偏微分
Parameters:
- f
- x
- eps
Return: Eigen::MatrixXd
function approx_hessian
static Eigen::MatrixXd approx_hessian(
std::function< double(Eigen::VectorXd)> f,
Eigen::VectorXd x,
double eps =std::pow(std::numeric_limits< double >::epsilon(), 0.5)
)
Parameters:
- f
- x
- eps
Return: Eigen::MatrixXd
function golden_search
static double golden_search(
std::function< double(double)> f,
double low,
double high,
const double tol =1e-6,
const size_t max_iter =100
)
黄金探索
Parameters:
- f
- low
- high
- tol
- max_iter
Return: double
function leastsq
Eigen::VectorXd leastsq(
const Eigen::MatrixXd & A,
const Eigen::VectorXd & b
)
function lsi2qp
std::tuple< Eigen::MatrixXd, Eigen::VectorXd > lsi2qp(
const Eigen::MatrixXd & C,
const Eigen::VectorXd & d
)
function newton_method
static std::tuple< bool, Eigen::VectorXd, size_t > newton_method(
std::function< Eigen::VectorXd(const Eigen::VectorXd &)> grad,
std::function< Eigen::MatrixXd(const Eigen::VectorXd &)> hesse,
Eigen::VectorXd x_init,
const double tol =1e-6,
const size_t max_iter =1000
)
ニュートン法
Parameters:
- grad
- hesse
- x_init
- tol
- max_iter
Return: std::tuple
function penalty_method
static std::tuple< bool, Eigen::VectorXd, size_t > penalty_method(
std::function< double(const Eigen::VectorXd &)> f,
ConstraintArray constraint,
Eigen::VectorXd x_init,
const double r_init =1.0,
const double tol =1e-3,
const size_t max_iter =1000
)
ペナルティ法
Parameters:
- f
- constraint
- x_init
- r_init
- tol
- max_iter
Return: std::tuple
function quadprog
static QuadProg::Result quadprog(
const QuadProgProblem & prob,
const Eigen::VectorXd & x0,
QuadProg::Method method =QuadProg::Method::ADMM
)
function quadprog
static QuadProg::Result quadprog(
const Eigen::MatrixXd & Q,
const Eigen::VectorXd & c,
const Eigen::VectorXd & x0,
QuadProg::Method method =QuadProg::Method::ADMM
)
function quadprog
static QuadProg::Result quadprog(
const Eigen::MatrixXd & Q,
const Eigen::VectorXd & c,
const Eigen::MatrixXd & A,
const Eigen::VectorXd & b,
const Eigen::VectorXd & x0,
QuadProg::Method method =QuadProg::Method::ADMM
)
function quadprog
static QuadProg::Result quadprog(
const Eigen::MatrixXd & Q,
const Eigen::VectorXd & c,
const Eigen::MatrixXd & A,
const Eigen::VectorXd & b,
const Eigen::MatrixXd & Aeq,
const Eigen::VectorXd & beq,
const Eigen::VectorXd & lb,
const Eigen::VectorXd & ub,
const Eigen::VectorXd & x0,
QuadProg::Method method =QuadProg::Method::ADMM
)
function quadprog_ineq_con
static QuadProg::Result quadprog_ineq_con(
const Eigen::MatrixXd & Q,
const Eigen::VectorXd & c,
const Eigen::MatrixXd & A,
const Eigen::VectorXd & b,
const Eigen::VectorXd & x0,
QuadProg::Method method =QuadProg::Method::ADMM
)
function quadprog_eq_con
static QuadProg::Result quadprog_eq_con(
const Eigen::MatrixXd & Q,
const Eigen::VectorXd & c,
const Eigen::MatrixXd & Aeq,
const Eigen::VectorXd & beq,
const Eigen::VectorXd & x0,
QuadProg::Method method =QuadProg::Method::ADMM
)
function quadprog_bound_con
static QuadProg::Result quadprog_bound_con(
const Eigen::MatrixXd & Q,
const Eigen::VectorXd & c,
const Eigen::VectorXd & lb,
const Eigen::VectorXd & ub,
const Eigen::VectorXd & x0,
QuadProg::Method method =QuadProg::Method::ADMM
)
function quasi_newton_method
static std::tuple< bool, Eigen::VectorXd, size_t > quasi_newton_method(
std::function< double(const Eigen::VectorXd &)> f,
std::function< Eigen::VectorXd(const Eigen::VectorXd &)> grad,
Eigen::VectorXd x_init,
const double tol =1e-6,
const size_t max_iter =1000
)
準ニュートン法
Parameters:
- f
- grad
- x_init
- tol
- max_iter
Return: std::tuple
function steepest_descent_method
static std::tuple< bool, Eigen::VectorXd, size_t > steepest_descent_method(
std::function< double(const Eigen::VectorXd &)> f,
std::function< Eigen::VectorXd(const Eigen::VectorXd &)> grad,
Eigen::VectorXd x_init,
const double tol =1e-6,
const size_t max_iter =1000
)
最急降下法
Parameters:
- f
- grad
- x_init
- tol
- max_iter
Return: std::tuple
function a_star
static std::vector< Eigen::Vector2i > a_star(
const Eigen::Vector2i & start,
const Eigen::Vector2i & end,
const Eigen::MatrixXi & map
)
A*法
Parameters:
- start
- end
- map
Return: std::vector
function fmt_star
template <class EigenVector ,
class Map >
static std::vector< EigenVector > fmt_star(
const Map & map,
const EigenVector & x_init,
const EigenVector & x_goal,
const FMTStarConfig & config =FMTStarConfig()
)
function normalized_mjm_position
static double normalized_mjm_position(
double t
)
function normalized_mjm_velocity
static double normalized_mjm_velocity(
double t
)
function normalized_mjm_acceleration
static double normalized_mjm_acceleration(
double t
)
function normalized_mjm_jerk
static double normalized_mjm_jerk(
double t
)
function wave_propagation
std::vector< Eigen::Vector2i > wave_propagation(
const Eigen::Vector2i & start,
const Eigen::Vector2i & end,
const Eigen::MatrixXi & map
)
Wave propagation法
Parameters:
- start
- end
- map
Return: std::vector
function bode
static std::tuple< std::vector< double >, std::vector< double > > bode(
TransferFunction & tf,
const std::vector< double > & omegas =logspace(-2, 2, 500),
bool gain_db_mode =true,
bool phase_deg_mode =true
)
ボード線図の応答を計算する
Parameters:
- tf
- omegas
- gain_db_mode
- phase_deg_mode
Return: std::tuple
function integrate_forward_euler
template <class T >
static T integrate_forward_euler(
double dt,
const T & x,
const T & u,
std::function< T(const T &, const T &)> dynamics
)
function integrate_modified_euler
template <class T >
static T integrate_modified_euler(
double dt,
const T & x,
const T & u,
std::function< T(const T &, const T &)> dynamics
)
function integrate_rk4
template <class T >
static T integrate_rk4(
double dt,
const T & x,
const T & u,
std::function< T(const T &, const T &)> dynamics
)
function nyquist
static std::tuple< std::vector< double >, std::vector< double > > nyquist(
TransferFunction & tf,
const std::vector< double > & omegas =logspace(-2, 2, 500)
)
ナイキスト線図の応答を計算する
Parameters:
- tf
- omegas
Return: std::tuple
function operator<<
static std::ostream & operator<<(
std::ostream & os,
const Polynomial & v
)
function make_feedback_system
template <class CONTROLLER_T ,
class SYSTEM_T >
static SisoFeedbackSystem make_feedback_system(
CONTROLLER_T & controller,
SYSTEM_T & system
)
function set_controller
static void set_controller(
SisoFeedbackSystem::func_list_t & fn,
PID & controller
)
function set_controller
static void set_controller(
SisoFeedbackSystem::func_list_t & fn,
NctfController & controller
)
function set_system
static void set_system(
SisoFeedbackSystem::func_list_t & fn,
TransferFunction & system
)
function tf2ss
StateSpaceSystem tf2ss(
const TransferFunction & tf
)
function impulse
static std::tuple< std::vector< double >, std::vector< double > > impulse(
const std::function< double(double)> & sys,
double dt,
double time
)
インパルス応答を求める
Parameters:
- sys
- dt
- time
Return: std::tuple
function impulse
template <class SysType ,
typename std::enable_if< internal::is_system_class< SysType >::value >::type * =nullptr>
static std::tuple< std::vector< double >, std::vector< double > > impulse(
SysType & sys,
double time
)
function step
static std::tuple< std::vector< double >, std::vector< double > > step(
const std::function< double(double)> & sys,
double dt,
double time,
const double gain =1.0
)
ステップ応答を求める
Parameters:
- sys
- dt
- time
- gain
Return: std::tuple
function step
template <class SysType ,
typename std::enable_if< internal::is_system_class< SysType >::value >::type * =nullptr>
static std::tuple< std::vector< double >, std::vector< double > > step(
SysType & sys,
double time,
const double gain =1.0
)
function step
template <class FilterType ,
typename std::enable_if< internal::is_pure_filter_class< FilterType >::value >::type * =nullptr>
static std::tuple< std::vector< double >, std::vector< double > > step(
FilterType & filter,
double time,
const double gain =1.0
)
function lsim
template <class DataIterativeType >
static std::tuple< DataIterativeType, DataIterativeType > lsim(
const std::function< double(double)> & sys,
double dt,
const DataIterativeType & input
)
任意の入力による応答を求める
Parameters:
- sys
- dt
- input
Template Parameters:
- DataIterativeType
Return: std::tuple
function lsim
template <class DataIterativeType ,
class SysType ,
typename std::enable_if< internal::is_system_class< SysType >::value >::type * =nullptr>
static std::tuple< DataIterativeType, DataIterativeType > lsim(
SysType sys,
const DataIterativeType & input,
bool skip_reset =false
)
function lsim
template <class DataIterativeType >
static std::tuple< DataIterativeType, DataIterativeType > lsim(
TransferFunction::tf_t sys_config,
const DataIterativeType & input
)
function lsim
template <class DataIterativeType >
static std::tuple< DataIterativeType, DataIterativeType, DataIterativeType > lsim(
SisoFeedbackSystem sys,
const DataIterativeType & input,
bool skip_reset =false
)
function lsim_y
template <class DataIterativeType >
static DataIterativeType lsim_y(
const std::function< double(double)> & sys,
double dt,
const DataIterativeType & input
)
function lsim_y
template <class DataIterativeType ,
class SysType ,
typename std::enable_if< internal::is_system_class< SysType >::value >::type * =nullptr>
static DataIterativeType lsim_y(
SysType sys,
const DataIterativeType & input,
bool skip_reset =false
)
function lsim_y
template <class DataIterativeType >
static DataIterativeType lsim_y(
TransferFunction::tf_t sys_config,
const DataIterativeType & input
)
function lsim_uy
template <class DataIterativeType >
static std::tuple< DataIterativeType, DataIterativeType > lsim_uy(
SisoFeedbackSystem sys,
const DataIterativeType & input,
bool skip_reset =false
)
function lsim_y
template <class DataIterativeType >
static DataIterativeType lsim_y(
SisoFeedbackSystem sys,
const DataIterativeType & input,
bool skip_reset =false
)
function conv_factor
template <class UnitDimType ,
int FromTag,
int ToTag,
bool IsNormalTag =tag::is_normal_tag<FromTag>::value && tag::is_normal_tag<ToTag>::value>
constexpr double conv_factor()
function operator*
template <typename T1 ,
typename T2 ,
class UnitDim ,
class Prefix ,
int Tag>
constexpr auto operator*(
const Unit< T1, UnitDim, Prefix, Tag > & l_value,
const T2 & r_value
)
function operator*
template <typename T1 ,
typename T2 ,
class UnitDim ,
class Prefix ,
int Tag>
constexpr auto operator*(
const T1 & l_value,
const Unit< T2, UnitDim, Prefix, Tag > & r_value
)
function operator/
template <typename T1 ,
typename T2 ,
class UnitDim ,
class Prefix ,
int Tag>
constexpr auto operator/(
const T1 & l_value,
const Unit< T2, UnitDim, Prefix, Tag > & r_value
)
function operator/
template <typename T1 ,
typename T2 ,
class UnitDim ,
class Prefix ,
int Tag>
constexpr auto operator/(
const Unit< T1, UnitDim, Prefix, Tag > & l_value,
const T2 & r_value
)
function operator*
template <typename T1 ,
class UnitDim1 ,
class Prefix1 ,
int Tag1,
typename T2 ,
class UnitDim2 ,
class Prefix2 ,
int Tag2>
constexpr auto operator*(
const Unit< T1, UnitDim1, Prefix1, Tag1 > & lhl,
const Unit< T2, UnitDim2, Prefix2, Tag2 > & rhl
)
function operator/
template <typename T1 ,
class UnitDim1 ,
class Prefix1 ,
int Tag1,
typename T2 ,
class UnitDim2 ,
class Prefix2 ,
int Tag2>
constexpr auto operator/(
const Unit< T1, UnitDim1, Prefix1, Tag1 > & lhl,
const Unit< T2, UnitDim2, Prefix2, Tag2 > & rhl
)
function operator+
template <typename T ,
class UnitDim ,
class Prefix1 ,
class Prefix2 ,
int Tag>
constexpr auto operator+(
const Unit< T, UnitDim, Prefix1, Tag > & lhl,
const Unit< T, UnitDim, Prefix2, Tag > & rhl
)
function operator-
template <typename T ,
class UnitDim ,
class Prefix1 ,
class Prefix2 ,
int Tag>
constexpr auto operator-(
const Unit< T, UnitDim, Prefix1, Tag > & lhl,
const Unit< T, UnitDim, Prefix2, Tag > & rhl
)
function shift_left
template <class ForwardIterator >
constexpr ForwardIterator shift_left(
ForwardIterator first,
ForwardIterator last,
typename std::iterator_traits< ForwardIterator >::difference_type n
)
Substitute shift_left function in C++20 alogorithm.
Parameters:
- first
- last
- n
Template Parameters:
- ForwardIterator
Return: constexpr ForwardIterator
function shift_right
template <class ForwardIterator >
constexpr ForwardIterator shift_right(
ForwardIterator first,
ForwardIterator last,
typename std::iterator_traits< ForwardIterator >::difference_type n
)
Substitute shift_right function in C++20 alogorithm.
Parameters:
- first
- last
- n
Template Parameters:
- ForwardIterator
Return: constexpr ForwardIterator
function c_format
template <typename... Args>
std::string c_format(
const std::string & format,
Args const &... args
)
printfと同様の操作でstd::stringを得る
Parameters:
- format
- args
Template Parameters:
- Args
Return: std::string
function isPositiveDefinite
template <typename MatrixType >
bool isPositiveDefinite(
const MatrixType & matrix
)
function pseudo_inverse
template <typename MatrixType >
MatrixType pseudo_inverse(
const MatrixType & a,
double epsilon =std::numeric_limits< double >::epsilon()
)
function sr_inverse
template <typename MatrixType >
MatrixType sr_inverse(
const MatrixType & a,
double w0 =1e-2,
Eigen::MatrixXd W =Eigen::MatrixXd()
)
function in_range_open
template <typename T >
static constexpr bool in_range_open(
T x,
T min,
T max
)
Parameters:
- x
- min
- max
Template Parameters:
- T
Return:
- true
- false
function in_range
template <typename T >
static constexpr bool in_range(
T x,
T min,
T max
)
Parameters:
- x
- min
- max
Template Parameters:
- T
Return:
- true
- false
function sgn
template <typename T >
static constexpr int sgn(
T x
)
Parameters:
- x
Template Parameters:
- T
Return: constexpr int
function radians
template <typename T >
static constexpr double radians(
T deg
)
Parameters:
- deg
Template Parameters:
- T
Return: constexpr double
function degrees
template <typename T >
static constexpr double degrees(
T rad
)
Parameters:
- rad
Template Parameters:
- T
Return: constexpr double
function normalize_angle_positive
static inline double normalize_angle_positive(
double angle
)
Parameters:
- angle
Return: double
function normalize_angle
static inline double normalize_angle(
double angle
)
Parameters:
- angle
Return: double
function shortest_angular_distance
static inline double shortest_angular_distance(
double from,
double to
)
Parameters:
- from
- to
Return: double
function nearest_angle
static inline double nearest_angle(
double from,
double to
)
function square
inline constexpr double square(
const double x
)
function cubic
inline constexpr double cubic(
const double x
)
function lerp
inline constexpr double lerp(
const double a,
const double b,
const double t
)
function approx_eq
inline constexpr double approx_eq(
const double a,
const double b
)
function approx_zero
inline constexpr double approx_zero(
const double a
)
function gererate_random
template <typename Real =double>
static Real gererate_random()
0.0〜1.0までの一様分布の乱数を生成する
Template Parameters:
- Real 浮動小数点型
Return: Real 乱数
function arrange
template <class DataType =std::vector<double>>
static DataType arrange(
double start,
double end,
double step =1.0
)
startからendまでstepずつ増える点のベクトルを返す
Parameters:
- start
- end
- step
Return: std::vector
function linspace
template <class DataType =std::vector<double>>
static DataType linspace(
double start,
double end,
size_t n =100
)
startからendまでをn分割した点のベクトルを返す
Parameters:
- start
- end
- n
Return: std::vector
function implusespace
template <class DataType =std::vector<double>>
static DataType implusespace(
double time,
double dt =1.0
)
function stepspace
template <class DataType =std::vector<double>>
static DataType stepspace(
double time,
double dt =1.0
)
function logspace
template <class DataType =std::vector<double>>
static DataType logspace(
double start,
double end,
size_t n =100
)
10^startから10^endまで対数的に等間隔なn個の点のベクトルを返す
Parameters:
- start
- end
- n
Return: std::vector
function funcspace
static std::vector< double > funcspace(
std::function< double(size_t, size_t)> f,
size_t n =100
)
Parameters:
- f
- n
Return: std::vector
function sinspace
static std::vector< double > sinspace(
double a,
double b,
size_t n =100
)
Attributes Documentation
variable RZ_735VA_9517
constexpr DCMotorParam RZ_735VA_9517 = generate_mabuchi_motor_param(
18_V,
20400_rpm,
2.8_A,
1265_mmNm,
156_A,
7.088e-5_H,
2.46e-5
);
variable RS_775_8513
constexpr DCMotorParam RS_775_8513 = generate_mabuchi_motor_param(
18_V,
18400_rpm,
2.7_A,
1216_mmNm,
130_A,
5.872e-5_H,
2.46e-5
);
variable RS_555VC_5524
constexpr DCMotorParam RS_555VC_5524 = generate_mabuchi_motor_param(
12_V,
9100_rpm,
0.8_A,
450_mmNm,
36_A,
1.820e-4_H,
2.46e-5
);
variable RS_380PH_4045
constexpr DCMotorParam RS_380PH_4045 = generate_mabuchi_motor_param(
6_V,
12500_rpm,
0.56_A,
77.5_mmNm,
18_A,
1.521e-4_H,
2.46e-5
);
variable RS_385PH_2465
constexpr DCMotorParam RS_385PH_2465 = generate_mabuchi_motor_param(
18_V,
17500_rpm,
0.23_A,
76.9_mmNm,
7.91_A,
1.521e-4_H,
2.46e-5
);
variable RE_65_250_18
constexpr DCMotorParam RE_65_250_18 = generate_maxon_brush_motor_param(
18_V,
3520_rpm,
755_mA,
0.0609_ohm,
0.0226_mH,
46e-3_Nm_per_A,
1.38
);
variable IG42C_4
constexpr GearHeadParam IG42C_4 = { 1/4.0f, 0.8f };
variable IG42C_14
constexpr GearHeadParam IG42C_14 = { 1/14.0f, 0.7f };
variable IG42C_17
constexpr GearHeadParam IG42C_17 = { 1/17.0f, 0.7f };
variable IG32_27
constexpr GearHeadParam IG32_27 = { 1/27.0f, 0.7f };
variable IG32_71
constexpr GearHeadParam IG32_71 = { 1/71.0f, 0.6f };
variable IG32_100
constexpr GearHeadParam IG32_100 = { 1/100.0f, 0.6f };
variable PI
constexpr double PI = 3.1415926535897932384626433832795;
円周率
variable HALF_PI
constexpr double HALF_PI = PI / 2.0;
円周率 / 2
variable TWO_PI
constexpr double TWO_PI = PI * 2.0;
円周率 * 2
variable DEG_TO_RAD
constexpr double DEG_TO_RAD = PI / 180.0;
degree -> radians
variable RAD_TO_DEG
constexpr double RAD_TO_DEG = 180.0 / PI;
radian -> degree
variable EULER
constexpr double EULER = 2.718281828459045235360287471352;
ネイピア数
variable GRAVITY
constexpr double GRAVITY = 9.807;
重力
variable Nm2gfm
constexpr double Nm2gfm = (1/GRAVITY);
variable gfm2Nm
constexpr double gfm2Nm = GRAVITY;
variable mNm2gfcm
constexpr double mNm2gfcm = (Nm2gfm * 100);
variable gfcm2mNm
constexpr double gfcm2mNm = (gfm2Nm / 100);
Updated on 2024-05-28 at 06:55:39 +0000