Chassis v2.1.1
Chassisはロボコンでの足回り制御を行うためのC++ライブラリである。
Loading...
Searching...
No Matches
main.cpp
Go to the documentation of this file.
1
3#include <../snippets/Motor.h>
4#include <Omni.h>
5#include <mbed.h>
6
7#include <array>
8
9using namespace rct;
10
11Motor motors[3] = {{D10, D11}, {D12, D13}, {D12, D13}};
13Omni<3> omni{[](std::array<float, 3> pwm) {
14 for(int i = 0; i < 3; ++i) {
15 motors[i] = pwm[i];
16 }
17}};
19
20int main() {
21 // put your setup code here, to run once:
22 while(1) {
23 // put your main code here, to run repeatedly:
25 Velocity vel = {0, 0.5, 0};
26 omni.move(vel);
28 }
29}
Omni< 3 > omni
[construct]
Definition main.cpp:13
int main()
[construct]
Definition main.cpp:20
オムニの制御を行う Omni クラスを提供する。
robot control library
Definition Chassis.h:16
N輪オムニの制御を行うクラス。
Definition Omni.h:25
void move(const Velocity &vel, const float offset_rad=0.0)
モータへのPWM出力を計算する。その後callback関数にPWM出力を渡す。
Definition Omni.h:43