en:api_1 [ОрбиКрафт 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_1

API for Python language

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

Functions

gyroGetRaw(self, waitingTime : float = 2.0)

Returns list of raw values of angular rate sensor (x, y, z) from OrbiCraft's telemetry or empty list if timeout of waiting messages was exceeded.

waitingTime : float - timeout of waiting message (default 2 sec)

gyroRequestRaw(self, waitingTime : float = 2.0)

Request regular telemetry of carrier and return list of raw values of AVS (x, y, z) or empty list if timeout of waiting messages was exceeded. Telemetry is received at the rate of requests.

waitingTime : float - timeout of waiting message (default 2 sec)

gyroSetOffset(self, x : float, y : float, z : float, waitingMsgid : float = 2.0)

Sets the zero offset for AVS. Return True if succsess or False if timeout of waiting ACK messages was exceeded.

  x : float - zero offset for x

  y : float - zero offset for y

  z : float - zero offset for z

  waitingTime : float - timeout of waiting message (default 2 sec)

magGyroSetTelemetryPeriod(self, period : int, waitingTime : float = 2.0)

Sets period for magnetometr and AVS regular telemetry. Return True if success or False if timeout of waiting ACK messages was exceeded.

waitingTime : float - timeout of waiting message (default 2 sec)

magGetRaw(self, waitingTime : float = 2.0)

Returns list of raw values of magnetometer (x, y, z) from OrbiCraft telemetry or empty list if timeout of waiting messages was exceeded. Telemetry is received at regular telemetry intervals.

waitingTime : float - timeout of waiting message (default 2 sec)

magRequestRaw(self, waitingTime : float = 2.0)

Request regular telemetry of carrier and return list of raw values of magnetometer (x, y, z) or empty list if timeout of waiting messages was exceeded. Telemetry is received at the rate of requests.

waitingTime : float - timeout of waiting message (default 2 sec)

magSetOffset(self, x : int, y : int, z : int, waitingTime : float = 2.0)

Sets zero offset for magnetometer. Every value need to devide by 14 before writing. Return True if success or False if timeout of waiting ACK messages was exceeded.

  x : float - zero offset for x

  y : float - zero offset for y

  z : float - zero offset for z

waitingTime : float - timeout of waiting message (default 2 sec)

motorGetSpeed(self, motorAddr : str, waitingTime : float = 2.0)

Returns angular velocity of specified reaction wheel from OrbiCraft 3D telemetry or None if timeout of waiting message was exceeded.

motorAddr : str - address of reaction wheel('0xA', '0xB', '0xC')

waitingTime : float - timeout of waiting message (default 2 sec)

motorGetTorque(self, motorAddr : str, waitingTime : float = 2.0)

Returns torque of specified reaction wheel from OrbiCraft telemetry or None if timeout of waiting message was exceeded.

motorAddr : str - address of reaction wheel('0xA', '0xB', '0xC')

waitingTime : float - timeout of waiting message (default 2 sec)

motorSetSpeed(self, motorAddr : str, speed : float, waitingTime : float = 2.0)

Sets angular velocity of selected reaction wheel. Return True if success or False if timeout of waiting ACK message was exceeded.

motorAddr : str - address of reaction wheel('0xA', '0xB', '0xC')

speed : float - speed of motor in rpm

waitingTime : float - timeout of waiting message (default 2 sec)

motorSetTorque(self, motorAddr : str, torque : float, time : int, waitingTime : float = 2.0)

Sets torque of selected reaction wheel. Return True if success or False if timeout of waiting ACK message was exceeded.

motorAddr : str - address of reaction wheel('0xA', '0xB', '0xC')

torque : float - torque

time : int - torque application time in ms

waitingTime : float - timeout of waiting message (default 2 sec)

motorSetTelemetryPeriod(self, motorAddr : str, period : int, waitingTime : float = 2.0)

Sets period of regular telemetry for the specified reaction wheel. Return True if success or False if timeout of waiting ACK message was exceeded.

motorAddr : str - address of reaction wheel('0xA', '0xB', '0xC')

period : int - telemetry period in ms(50..5000)

waitingTime : float - timeout of waiting message (default 2 sec)

motorSetPeriodAll(self, period : int, waitingTime : float = 2.0)

Sets telemetry period for 0xA, 0xB and 0xC reaction wheels. Return True if success or False if timeout of waiting ACK messages was exceeded.

period : int - telemetry period in ms(50..5000)

waitingTime : float - timeout of waiting message for every reaction wheel (default 2 sec)

sunSensorGetRaw(self, sensorAddr : str, waitingTime : float = 2.0)

Return list componetns(x, y, z) of vector directed at the Sun of specified sun sensor from OrbiCraft telemetry or empty list if timeout of waiting messages was exceeded. In order to recieve normalized vector component need x_norm = x / sqrt(x^2 + y^2 + z^2).

sensorAddr : str - address of sun sensor ('0x10', '0x11', ..)

waitingTime : float - timeout of waiting message (default 2 sec)

sunSensorGetDeltaPhi(self, sensorAddr : str, waitingTime : float = 2.0)

Return list with Delta and Phi angles from specified sun sensor from OrbiCraft telemetry or empty list if timeout of waiting messages was exceeded or messages had invalid flag. Delta - the angle between the normal to the sun sensor and the vector directed towards the sun. Phi - angle of rotation around the normal to the solar sensor.

sensorAddr : str - address of sun sensor ('0x10', '0x11', ..)

waitingTime : float - timeout of waiting message (default 2 sec)

sunSensorsSetTelemetryPeriod(self, sensorAddr : str, period : int, waitingTime : float = 2.0)

Sets telemetry period for specified sun sensor. Return True if success or False if timeout of waiting ACK messages was exceeded.

sensorAddr : str - address of sun sensor ('0x10', '0x11', ..)

period : int - period in ms

waitingTime : float - timeout of waiting message (default 2 sec)

sunSensorsSetPeriodAll(self, period : int, waitingTime : float = 2.0)

Sets telemetry period for all sun sensors. Return True if success or False if timeout of waiting ACK messages was exceeded.

period : int - period in ms

waitingTime : float - timeout of waiting message (default 2 sec)

cameraTakePhoto(self, angle : int)

Take photo to Raspberry camera. Return True when succsess, otherwise False.

angle : int - rotation of camera (0, 90, 180, 270), deg

receiveMsg(self, msgid : str, addrFrom : str, waitingTime=2.0)

Waiting for a message. If a message is received within the time, waitingTime returns the received message, otherwise None.

msgid : str - id of expected message

addrFrom : str - address of the sender's device (waiting for a response) in the format '0xF'

waitingTime : float - time of waiting message

receiveMsgs(self, waitingMsgids, addrFrom : str, waitingTime=2.0)

Waiting for messages. If messages were received within the time, waitingTime returns the list of received messages in the order of the waitingMsgids list, otherwise the list is empty.

waitingMsgids - list of expected messages in hex format('0xB10')

addrFrom : str - address of the sender's device (waiting for a response) in the format '0xF'

waitingTime : float - time of waiting message

sendMsgAndWaitAnswer(self, msgidToSend: str, addrFrom: str , addrTo: str, length: int, data, waitingMsgid: str, waitingTime=2.0)

Send a message and expect one message in response. If messages are received within waitingTime, returns message waitingMsgid, otherwise None.

msgidToSend : str - id of message for sending

addrFrom : str - sender's address in hex format ('0xF')

addrTo : str - reciever's address in hex format ('0xA')

length : int - data packet message length in bytes

data - package data (bytearray)

waitingMsgid : str - id of expected message

waitingTime : float - time of waiting message

sendMsgAndWaitAnswers(self, msgidToSend: str, addrFrom: str , addrTo: str, length: int, data, waitingMsgids, waitingTime=2.0)

Send a message and expect one message in response. If messages are received within waitingTime, returns message waitingMsgid, otherwise None.

msgidToSend : str - id of message for sending

addrFrom : str - sender's address in hex format ('0xF')

addrTo : str - reciever's address in hex format ('0xA')

length : int - data packet message length in bytes

data - package data (bytearray)

waitingMsgid - list of expected messages

waitingTime : float - time of waiting message

pushThumbsToTerra2(self, num: int)

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

num : int - number of thumb from which starts transmitting

pushPhotoToTerra2(self, num: int)

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

num : int - number of photo

en/api_1.txt · Last modified: 2023/02/28 09:35 by ekaterina.manucharova