TR-mbed 1.0
Loading...
Searching...
No Matches
Macros | Functions | Variables
Jetson.cpp File Reference
#include "Jetson.h"

Macros

#define MAGICBYTE   0xEE
 
#define JETSON_READ_BUFF_SIZE   500
 
#define JETSON_READ_MSG_SIZE   11
 

Functions

void getBytesFromFloat (char *byteArr, float value)
 
void decode_toSTM32 (char *read_buf, float &received_one, float &received_two, char &received_three, uint8_t &checksum)
 
void copy4Char (char *srcBuf, char *destBuf, int offset)
 
void jetson_send_feedback (BufferedSerial &bcJetson, const Jetson_send_data &data)
 
ssize_t jetson_read_values (BufferedSerial &bcJetson, Jetson_read_data &read_data)
 

Variables

char nucleo_value [30] = {0}
 
char jetson_read_buff [JETSON_READ_BUFF_SIZE] = {0}
 
int jetson_read_buff_pos = 0
 

Macro Definition Documentation

◆ JETSON_READ_BUFF_SIZE

#define JETSON_READ_BUFF_SIZE   500

◆ JETSON_READ_MSG_SIZE

#define JETSON_READ_MSG_SIZE   11

◆ MAGICBYTE

#define MAGICBYTE   0xEE

Function Documentation

◆ copy4Char()

void copy4Char ( char *  srcBuf,
char *  destBuf,
int  offset 
)

Copies 4 bytes from srcBuf[0] into destBuf[offset]

Parameters
srcBufsource buffer
destBufdestination buffer
offsetthe starting position into destBuf

◆ decode_toSTM32()

void decode_toSTM32 ( char *  read_buf,
float &  received_one,
float &  received_two,
char &  received_three,
uint8_t &  checksum 
)

Writes 9 bytes of read_buf into received_one and received_two as floats for pitch & yaw positions Used for receiving desired position data from CV in read_buf, write out as floats to received_one/two.

Parameters
read_buf- Source data
received_one- Destination buffer

◆ getBytesFromFloat()

void getBytesFromFloat ( char *  byteArr,
float  value 
)

Copy float value bytes into single bytes in byteArr array

Parameters
byteArrdestination char array for value individual bytes
valuefloat value to copy into byteArr

◆ jetson_read_values()

ssize_t jetson_read_values ( BufferedSerial &  bcJetson,
Jetson_read_data read_data 
)

Read desired pitch and yaw position data from Jetson

Parameters
pitch_movebuffer to store desired pitch position
yaw_movebuffer to store desired yaw position

◆ jetson_send_feedback()

void jetson_send_feedback ( BufferedSerial &  bcJetson,
const Jetson_send_data data 
)

Read motor values and send to CV

Variable Documentation

◆ jetson_read_buff

char jetson_read_buff[JETSON_READ_BUFF_SIZE] = {0}

◆ jetson_read_buff_pos

int jetson_read_buff_pos = 0

◆ nucleo_value

char nucleo_value[30] = {0}