Lamp-Da
0.1
A compact lantern project
Loading...
Searching...
No Matches
src
modes
include
imu
utils.hpp
Go to the documentation of this file.
1
5
#ifndef MODES_INCLUDE_IMU_UTILS_HPP
6
#define MODES_INCLUDE_IMU_UTILS_HPP
7
8
#include "
src/system/component/imu.h
"
9
10
#include "
src/system/utils/vector_math.h
"
11
12
#include "
src/modes/include/particle_system/particle_system.hpp
"
13
15
17
namespace
lampda::modes::imu
{
18
19
template
<
int
temp = 0>
struct
ImuEventTy
20
{
22
bsp::imu::Reading
lastReading
;
23
26
void
reset
(
auto
& ctx)
27
{
28
// reset filter
29
component::imu::get_filtered_reading
(
true
);
30
31
// reset particles
32
particuleSystem
.reset();
33
particuleSystem
.set_max_particle_count(512);
34
}
35
37
void
update
(
auto
& ctx)
38
{
39
//
40
lastReading
=
component::imu::get_filtered_reading
(
false
);
41
}
42
45
inline
static
auto
particuleSystem
=
modes::get_shared_particle_system
();
46
47
private
:
48
};
49
50
}
// namespace lampda::modes::imu
51
52
#endif
imu.h
Interface for the physical components of the InertialMotionUnit.
lampda::component::imu::get_filtered_reading
bsp::imu::Reading get_filtered_reading(const bool resetFilter)
get the filtered IMU readings
Definition:
imu.cpp:256
lampda::modes::imu
User modes imu utilities.
Definition:
utils.hpp:17
lampda::modes::get_shared_particle_system
static ParticleSystem & get_shared_particle_system()
Access the main level shared particle system.
Definition:
particle_system.hpp:261
particle_system.hpp
Define a particle system, with particle based logic.
lampda::bsp::imu::Reading
IMU reading.
Definition:
imu_wrapper.h:19
lampda::modes::imu::ImuEventTy
Definition:
utils.hpp:20
lampda::modes::imu::ImuEventTy::reset
void reset(auto &ctx)
Reset the IMU events. Should be called before any use.
Definition:
utils.hpp:26
lampda::modes::imu::ImuEventTy::particuleSystem
static auto particuleSystem
ALL IMU ANIMATIONS SHARE THIS PARTICLE SYSTEM. Spawn another if multiple systems should run in parral...
Definition:
utils.hpp:45
lampda::modes::imu::ImuEventTy::lastReading
bsp::imu::Reading lastReading
last reading of the IMU
Definition:
utils.hpp:22
lampda::modes::imu::ImuEventTy::update
void update(auto &ctx)
Call this once every tick inside the mode loop callback.
Definition:
utils.hpp:37
vector_math.h
Define vectors and rotation matrices, and the possibility to rotate vectors.
Generated by
1.9.6