![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
my new gear...
Diff: SLE.hpp
- Revision:
- 0:1456b6f84c75
diff -r 000000000000 -r 1456b6f84c75 SLE.hpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/SLE.hpp Fri Feb 25 05:20:11 2022 +0000 @@ -0,0 +1,27 @@ +//--Self-localization Estimate--// +/* AMT102v*4つを用いてXY座標の自己位置推定(Self-localization Estimate)するライブラリ.4輪を前後左右4方向に均等に配置している場合のみ使える(要はベタな4輪オムニ自動機ならこれ使える).*/ +#pragma once +#include <mbed.h> +#include <portSet.hpp> +#include <rotary_inc_sp.hpp> + +#define NOW 0 +#define PREV 1 +#define X_DATA 0 +#define Y_DATA 1 + +class SLE +{ +public: + SLE(Port enc0,Port enc1,Port enc2,Port enc3,float resolution,float ensyu,float interval); + void update(double theta); + void reset(); + void setPos(float x_pos,float y_pos); + float position[2]; + float velocity[2]; + RotaryInc odometer[4]; +private: + float wheel_ensyu; + float dt; + float Vx[2],Vy[2]; +}; \ No newline at end of file