SPIKE-RT C API Reference [English]
An RTOS-based software platform for LEGO® Education SPIKE™.
Loading...
Searching...
No Matches
imu.h
Go to the documentation of this file.
1/*
2 * SPDX-License-Identifier: MIT
3 *
4 * API for the hub built-in IMU.
5 *
6 * Copyright (c) 2022 Embedded and Real-Time Systems Laboratory,
7 * Graduate School of Information Science, Nagoya Univ., JAPAN
8 */
9
35#ifndef _HUB_IMU_H_
36#define _HUB_IMU_H_
37
38#ifdef __cplusplus
39extern "C" {
40#endif
41
42#include <stdint.h>
43#include <stdbool.h>
44#include <pbio/error.h>
45
57pbio_error_t hub_imu_init(void);
58
70bool hub_imu_is_ready(void);
71
83bool hub_imu_is_stationary(void);
84
94void hub_imu_set_tilt(float angle);
95
105void hub_imu_get_acceleration(float accel[3]);
106
116void hub_imu_get_angular_velocity(float angv[3]);
117
127float hub_imu_get_temperature(void);
128
138float hub_imu_get_heading(void);
139
147void hub_imu_reset_heading(void);
148
149#ifdef __cplusplus
150}
151#endif
152
153#endif // _HUB_IMU_H_
154
pbio_error_t hub_imu_init(void)
Initialize the IMU driver.
Definition imu.c:32
bool hub_imu_is_ready(void)
Check if the IMU module is "ready.".
Definition imu.c:70
bool hub_imu_is_stationary(void)
Check if the IMU module is "stationary.".
Definition imu.c:74
void hub_imu_get_angular_velocity(float angv[3])
Get the angular velocity by the IMU.
Definition imu.c:91
void hub_imu_get_acceleration(float accel[3])
Get the acceleration by the IMU.
Definition imu.c:87
void hub_imu_reset_heading(void)
Reset the heading angle of the IMU.
Definition imu.c:103
float hub_imu_get_heading(void)
Get the heading angle of the IMU.
Definition imu.c:99
void hub_imu_set_tilt(float angle)
Set the tilt angle of the IMU module.
Definition imu.c:78
float hub_imu_get_temperature(void)
Get the temperature by the IMU.
Definition imu.c:95