Pluto Logo

by Drona Aviation

Profile
Menu
Documentation
Pluto-IDE & MagisV2 SDK
Pluto-IDE & MagisV2 API Reference

FC Data

Code with Pluto-IDE

Pluto-IDE is the professional development environment required to build, flash, and monitor firmware using the MagisV2 library on Pluto Drones.

Get Pluto-IDE

FC-Data.h

Flight controller data access for sensors and state estimation.

Enumerations

FC_Sensors_e

typedef enum {
    Accelerometer,    // Acceleration sensor
    Gyroscope,        // Rotation rate sensor
    Magnetometer,     // Magnetic field sensor
    Barometer         // Pressure sensor
} FC_Sensors_e;

BARO_Data_e

typedef enum {
    Pressure,         // Barometric pressure
    Temperature       // Temperature reading
} BARO_Data_e;

FC_Estimate_e

typedef enum {
    Angle,           // Attitude angles
    Rate,            // Rotation rates
    Position,        // Position estimates
    Velocity         // Velocity estimates
} FC_Estimate_e;

Functions

uint32_t Sensor_Get(FC_Sensors_e _sensor, axis_e _axis)

Retrieves sensor data for specified sensor and axis.

Parameters:

  • _sensor - Sensor type (Accelerometer, Gyroscope, Magnetometer)
  • _axis - Axis (X, Y, Z, Net_Acc for accelerometer)

Returns: Scaled sensor reading or 0 if unsupported

uint32_t Sensor_Get(FC_Sensors_e _sensor, BARO_Data_e _data)

Retrieves barometer data.

Parameters:

  • _sensor - Must be Barometer
  • _data - Pressure or Temperature

Returns: Pressure in 100millibar or temperature in 100°C

int16_t Estimate_Get(FC_Estimate_e _estimateOf, axis_e _axis)

Gets estimated values for position, velocity, or rate.

Parameters:

  • _estimateOf - Type of estimate (Rate, Position, Velocity)
  • _axis - Axis (X, Y, Z)

int16_t Estimate_Get(FC_Estimate_e _estimateOf, angle_e _angle)

Gets estimated angle measurements.

Parameters:

  • _estimateOf - Must be Angle
  • _angle - Angle type (AG_ROLL, AG_PITCH, AG_YAW)

Returns: Angle in deciDegrees (roll/pitch) or degrees (yaw)

Usage Example

// Read IMU sensors
uint32_t accelX = Sensor_Get(Accelerometer, X);
uint32_t gyroZ = Sensor_Get(Gyroscope, Z);
uint32_t magY = Sensor_Get(Magnetometer, Y);

// Read barometer
uint32_t pressure = Sensor_Get(Barometer, Pressure);
uint32_t temp = Sensor_Get(Barometer, Temperature);

// Get attitude estimates
int16_t roll = Estimate_Get(Angle, AG_ROLL);
int16_t pitch = Estimate_Get(Angle, AG_PITCH);
int16_t heading = Estimate_Get(Angle, AG_YAW);

// Get position (requires localization)
int16_t altitude = Estimate_Get(Position, Z);