SPIKE-RT C++ API Reference
Loading...
Searching...
No Matches
IMU.h
1
//
2
// IMU.h
3
//
4
// Copyright (c) 2025 Embedded Technology Software Design Robot Contest
5
//
6
7
#ifndef SPIKE_CPP_API_IMU_H_
8
#define SPIKE_CPP_API_IMU_H_
9
10
extern
"C"
{
11
#include <spike/hub/imu.h>
12
}
13
14
namespace
spikeapi {
18
class
IMU
19
{
20
public
:
21
22
/* 加速度 mm/s^2*/
23
struct
Acceleration
{
24
float
x;
25
float
y;
26
float
z;
27
};
28
29
/* 角速度 degree/s */
30
struct
AngularVelocity
{
31
float
x;
32
float
y;
33
float
z;
34
};
35
36
42
IMU
(
void
) {
43
// このinitは2回目以降エラーとなるが、値を取る上では問題ないためそのままとする
44
hub_imu_init();
45
}
46
52
void
getAcceleration
(Acceleration &accel);
53
59
void
getAngularVelocity
(AngularVelocity &ang);
60
66
float
getTemperature
()
const
{
67
return
hub_imu_get_temperature();
68
}
69
74
bool
hasError
() {
return
false
; }
75
76
77
};
// class IMU
78
}
// namespace spikeapi
79
80
#endif
// !SPIKE_CPP_API_IMU_H_
spikeapi::IMU::getAngularVelocity
void getAngularVelocity(AngularVelocity &ang)
Definition
IMU.cpp:25
spikeapi::IMU::getTemperature
float getTemperature() const
Definition
IMU.h:66
spikeapi::IMU::hasError
bool hasError()
Definition
IMU.h:74
spikeapi::IMU::IMU
IMU(void)
Definition
IMU.h:42
spikeapi::IMU::getAcceleration
void getAcceleration(Acceleration &accel)
Definition
IMU.cpp:16
spikeapi::IMU::Acceleration
Definition
IMU.h:23
spikeapi::IMU::AngularVelocity
Definition
IMU.h:30
libcpp-spike
include
IMU.h
Generated by
1.14.0