Chassis v2.1.1
Chassisはロボコンでの足回り制御を行うためのC++ライブラリである。
Loading...
Searching...
No Matches
Omni.cpp
Go to the documentation of this file.
1
3
4#include <../snippets/Motor.h>
5#include <Arduino.h>
6#include <Omni.h>
7
8Motor motors[3] = {{D10, D11}, {D12, D13}, {D12, D13}};
9Omni<3> omni{[](std::array<float, 3> pwm) {
10 for(int i = 0; i < 3; ++i) {
11 motors[i] = pwm[i];
12 }
13}};
14
15void setup() {
16 // put your setup code here, to run once:
17}
18
19void loop() {
20 // put your main code here, to run repeatedly:
21 Velocity vel = {0, 0.5, 0};
22 omni.move(vel);
23}
24
25int main() {
26 setup();
27 while(1) {
28 loop();
29 }
30}
オムニの制御を行う Omni クラスを提供する。
CoordinateUnit<-1 > Velocity
速度を示す構造体