TinyRobotics
Loading...
Searching...
No Matches
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
IMU3D< T > Class Template Reference

Basic 3D IMU dead-reckoning class. More...

#include <IMU3D.h>

Inheritance diagram for IMU3D< T >:
Inheritance graph
[legend]
Collaboration diagram for IMU3D< T >:
Collaboration graph
[legend]

Public Member Functions

bool begin (const Coordinate< T > &initialPosition={0, 0, 0}, Orientation3D initialOrientation=Orientation3D())
 
void end ()
 
void update (T accelX, T accelY, T accelZ, T gyroX, T gyroY, T gyroZ, unsigned long nowMillis)
 
Distance3D getLastDelta () const
 Get the last delta update (dx, dy, dz)
 
AngularVelocity3D getLastAngularVelocity () const
 Get the last angular velocity (rad/s)
 
Speed3D getLinearVelocity () const
 Get the current linear velocity (m/s)
 
Coordinate< DistanceM > getPosition () const override
 Get the current position (IMotionState3D)
 
Orientation3D getOrientation () const override
 Get the current orientation (IMotionState3D)
 
Speed3D getSpeed () const override
 
AngularVelocity3D getAngularVelocity () const override
 
- Public Member Functions inherited from MessageSource
void subscribe (MessageHandler &handler, MessageOrigin origin=MessageOrigin::Undefined, MessageContent content=MessageContent::Undefined)
 Subscribe a message handler to this source, with optional filtering.
 
void unsubscribeAll ()
 Remove all registered message handlers.
 
void sendMessage (Message< float > &msg)
 Publish a message to all registered handlers.
 
void sendMessage (const Message< Coordinate< float > > &msg)
 Publish a message to all registered handlers.
 
void sendMessage (const Message< GPSCoordinate > &msg)
 Publish a message to all registered handlers.
 
void sendMessage (const Message< MotionState3D > &msg)
 Overload for MotionState3D messages.
 
virtual Coordinate< DistanceM > getPosition () const =0
 
virtual Orientation3D getOrientation () const =0
 
virtual Speed3D getSpeed () const =0
 
virtual AngularVelocity3D getAngularVelocity () const =0
 

Protected Member Functions

void publish ()
 

Protected Attributes

bool is_active = false
 
Orientation3D orientation
 
Speed3D speed = Speed3D(0.0f, 0.0f, 0.0f, SpeedUnit::MPS)
 
Coordinate< T > position
 
unsigned long lastUpdateMillis = 0
 
Distance3D lastDelta = Distance3D(0.0f, 0.0f, 0.0f, DistanceUnit::M)
 
AngularVelocity3D lastAngularVelocity = AngularVelocity3D(0.0f, 0.0f, 0.0f, AngularVelocityUnit::RadPerSec)
 
- Protected Attributes inherited from MessageSource
std::vector< MessageHandlerEntrymessageHandlers_
 

Detailed Description

template<typename T = float>
class tinyrobotics::IMU3D< T >

Basic 3D IMU dead-reckoning class.

This class estimates 3D position, velocity, and orientation (yaw, pitch, roll) for robotics applications by integrating gyroscope and accelerometer data over time.

Limitations:

Template Parameters
TNumeric type (float or double recommended)

Member Function Documentation

◆ getAngularVelocity()

AngularVelocity3D getAngularVelocity ( ) const
inlineoverridevirtual

Implements IMotionState3D.

◆ getOrientation()

Orientation3D getOrientation ( ) const
inlineoverridevirtual

Get the current orientation (IMotionState3D)

Implements IMotionState3D.

◆ getPosition()

Coordinate< DistanceM > getPosition ( ) const
inlineoverridevirtual

Get the current position (IMotionState3D)

Implements IMotionState3D.

◆ getSpeed()

Speed3D getSpeed ( ) const
inlineoverridevirtual

Implements IMotionState3D.

◆ update()

void update ( accelX,
accelY,
accelZ,
gyroX,
gyroY,
gyroZ,
unsigned long  nowMillis 
)
inline

Update with accelerometer and gyro measurements accelX, accelY, accelZ in sensor frame (m/s^2) gyroX, gyroY, gyroZ in rad/s (roll, pitch, yaw rates)


The documentation for this class was generated from the following file: