en:api [ОрбиКрафт 3D]

Sidebar

What is Orbicraft for?

Assembling the OrbiCraft 3D

OrbiCraft 3D interfaces

Work with earth-based UHF

Work with Wifi

Work through the WEB interface

Required software and library description

Houston Control Center Software

Arduino-Based payload

Laboratory equipment

Feedback

en:api

API for C++ language

This section presents a set of user-defined functions implemented in the libschsat.h library

Functions

int camera_take_photo(uint16_t num, uint8_t rot)

Camera takes photo and saves it in sattelite's memory.

[in] num - numeric device id

[in] rot - rotation of camera (0, 90, 180, 270), deg

gyro_push_data_uhf()

This function sends current raw data from the angular velocity sensor (DPS) by UHF tramsmitter.

int gyro_request_raw(uint16_t num, float *pRAW_dataX, float *pRAW_dataY, float *pRAW_dataZ)

This function gets current raw data from the specified angular rate sensor and saves the data in pRAW_dataX, pRAW_dataY, pRAW_dataZ in DPS.

[in] num - numeric device id

[out] pRAW_dataX - Angular speed around X axis, deg/s

[out] pRAW_dataY - Angular speed around Y axis, deg/s

[out] pRAW_dataZ - Angular speed around Z axis, deg/s

int gyro_set_offset(uint16_t num, float offset_X, float offset_Y, float offset_Z)

This function sets zero offset for angular rate sensor. Arguments are in sensor units (DPS).

[in] num - numeric device id

[in] offset_X - Offset of zero velocity relative to the X axis, deg/s

[in] offset_Y - Offset of zero velocity relative to the Y axis, deg/s

[in] offset_Z - Offset of zero velocity relative to the Z axis, deg/s

int magnetometer_gyro_set_telemetry_period(const uint16_t num, const uint16_t period)

This function sets period (in milliseconds) of regular telemetry from the specified magnetometer and gyro. Period should be in range 50..5000ms. Warning! Small telemetry period from great amount of devices can cause Can-bus overload.

[in] num - numeric device id

[in] period - telemetry period, ms

int magnetometer_push_data_uhf()

This function sends current raw data from the magnetometer (nT) by UHF tramsmitter.

int magnetometer_request_raw(uint16_t num, float *pRAW_dataX, float *pRAW_dataY, float *pRAW_dataZ)

This function gets current raw data from the specified magnetometer and saves the data in pRAW_dataX, pRAW_dataY, pRAW_dataZ in nT.

[in] num - numeric device id

[out] pRAW_dataX - Magnetic field along the X axis, nT

[out] pRAW_dataY - Magnetic field along the Y axis, nT

[out] pRAW_dataZ - Magnetic field along the Z axis, nT

int magnetometer_set_offset(uint16_t num, int16_t offset_X, int16_t offset_Y, int16_t offset_Z)

This function sets zero offset for specified magnetic sensor. Arguments are in sensor units (nT). Attention! Zero offset is transmitted in int16_t variables and must be from -32768 to +32767. If it's not enought you may use additional handling of values in user's code.

[in] num - numeric device id

[in] offset_X - Zero offset of the magnetic field along the X axis, nT

[in] offset_Y - Zero offset of the magnetic field along the Y axis, nT

[in] offset_Z - Zero offset of the magnetic field along the Z axis, nT

int motor_request_speed(uint16_t num, float *pRPM)

This function returns angular velocity of selected reaction wheel.

[in] num - numeric device id

[out] pRPM - angular speed, rpm

int motor_set_speed(uint16_t num, float RPM)

This function sets angular velocity of selected reaction wheel. Arguments are index of the wheel and required velocity in RPM.

[in] num - numeric device id

[in] RPM - angular speed, rpm

int motor_set_telemetry_period(const uint16_t num, const uint16_t period)

This function sets period (in milliseconds) of regular telemetry from the specified reaction wheel. Period should be in range 50..5000ms. Warning! Small telemetry period from great amount of devices can cause Can-bus overload.

[in] num - numeric device id

[in] period - telemetry period, ms

int recieve_unican_message(const uint16_t address_from, const uint16_t msg_id, uint8_t *data, const uint16_t msg_size, const uint16_t timeout)

Receive UniCAN message. If msg_length == 0 *data must be NULL.

[in] address_from - Identifier of the sending device

[in] msg_id - message id

[out] data - Pointer to the buffer for the recieved data, given the format uint8_t

[in] msg_size - data size in bytes

[in] timeout - message timeout, ms

int send_unican_message(const uint16_t address_to, const uint16_t msg_id, uint8_t *data, const uint16_t msg_size)

Send UniCAN message

[in] address_from - Identifier of the sending device

[in] msg_id - message id

[out] data - Pointer to the data, given the format uint8_t

[in] msg_size - data size in bytes

int sunsensor_get_raw(uint16_t num, int32_t *vector)

The function returns the components of the sun vector for the specified sun sensor

[in] num - numeric device id

[out] vector - pointer to 3 components of vector

sunsensor_get_delta_phi(uint16_t num, float* angles)

The function returns angles Delta(the angle between the normal to the sun sensor and the vector directed towards the sun) and Phi(angle of rotation around the normal to the solar sensor) for specified sun sensor

[in] num - numeric device id

[out] angles - pointer to Delta and Phi angles

int sunsensor_push_data_uhf(uint16_t num)

This function sends current raw data from the specified sun sensor by UHF. Data format: components of vector pointing to light source (vector's length: 1e+9). If sun isn't in the sensor visibility range it sends 0-vector with invalidity flag.

[in] num - numeric device id

int sunsensor_set_telemetry_period(const uint16_t num, const uint16_t period)

This function takes RAW values from two adjusted sunsensors, to calculate angle (deg) between them. For more precise calculation value of ambient light should be provided.

[in] num - numeric device id

[in] period - telemetry period, ms

static int transmitter_transmit_photo_ftp(uint16_t num, uint16_t nPhoto)

This function does transmit a photo: transfers a local copy to the specified FTP server with curl under $LOGNAME directory.

[in] num - device number(by default 0)

[in] nPhoto - photo number

void turn_on_transmitter()

Turning on transmitter for connection with Terra 1.0

void turn_off_transmitter()

Turning off the transmitter for connection with Terra 1.0

push_thumbs_terra2(uint8_t numFrom)

Runs transmitting all thumbs from OrbiCraft 3D to TerraGround. Return True when success, else False.

[in] numFrom - num of thumb from which starts trinsmitting

push_photo_terra2(uint8_t photoNum)

Runs transmitting photo from OrbiCraft 3D to TerraGround. Return True when success, else False.

[in] photoNum - num of photo

en/api.txt · Last modified: 2023/02/28 15:26 by maria.milkina