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
9
using namespace
rct
;
10
11
Motor
motors[3] = {{
D10
,
D11
}, {
D12
,
D13
}, {
D12
,
D13
}};
13
Omni<3>
omni
{[](std::array<float, 3>
pwm
) {
14
for
(
int
i
= 0;
i
< 3; ++
i
) {
15
motors[
i
] =
pwm
[
i
];
16
}
17
}};
19
20
int
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
Omni< 3 > omni
[construct]
Definition
main.cpp:13
main
int main()
[construct]
Definition
main.cpp:20
Omni.h
オムニの制御を行う Omni クラスを提供する。
rct
robot control library
Definition
Chassis.h:16
rct::Omni
N輪オムニの制御を行うクラス。
Definition
Omni.h:25
rct::Omni::move
void move(const Velocity &vel, const float offset_rad=0.0)
モータへのPWM出力を計算する。その後callback関数にPWM出力を渡す。
Definition
Omni.h:43
examples
Mbed
Omni3
main.cpp
Generated by
1.9.8