|
TR-mbed 1.0
|
#include "Jetson.h"Macros | |
| #define | DATA_HEADER 0xAA |
| #define | REF_HEADER 0xBB |
| #define | AIM_HEADER 0xCC |
| #define | ODOM_HEADER 0xDD |
| #define | JETSON_READ_BUFF_SIZE 500 |
| #define | JETSON_READ_MSG_SIZE 11 |
| #define | JETSON_MAX_PACKET_SIZE 117 |
Functions | |
| void | getBytesFromFloat (char *byteArr, float value) |
| void | getBytesFromInt16 (char *byteArr, int16_t value) |
| void | getBytesFromInt8 (char *byteArr, int8_t 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_ref &ref_data, const Jetson_send_data &data, int msg_type) |
| ssize_t | jetson_read_values (BufferedSerial &bcJetson, Jetson_read_data &read_data, Jetson_read_odom &odom_data) |
| ssize_t | jetson_send_read_spi (SPI &spiJetson, const Jetson_send_data &input, Jetson_read_data &output) |
Variables | |
| char | nucleo_value [50] = {0} |
| char | jetson_read_buff [JETSON_READ_BUFF_SIZE] = {0} |
| int | jetson_read_buff_pos = 0 |
| #define AIM_HEADER 0xCC |
| #define DATA_HEADER 0xAA |
| #define JETSON_MAX_PACKET_SIZE 117 |
| #define JETSON_READ_BUFF_SIZE 500 |
| #define JETSON_READ_MSG_SIZE 11 |
| #define ODOM_HEADER 0xDD |
| #define REF_HEADER 0xBB |
| void copy4Char | ( | char * | srcBuf, |
| char * | destBuf, | ||
| int | offset | ||
| ) |
Copies 4 bytes from srcBuf[0] into destBuf[offset]
| srcBuf | source buffer |
| destBuf | destination buffer |
| offset | the starting position into destBuf |
| 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.
| read_buf | - Source data |
| received_one | - Destination buffer |
| void getBytesFromFloat | ( | char * | byteArr, |
| float | value | ||
| ) |
Copy float value bytes into single bytes in byteArr array
| byteArr | destination char array for value individual bytes |
| value | float value to copy into byteArr |
| void getBytesFromInt16 | ( | char * | byteArr, |
| int16_t | value | ||
| ) |
| void getBytesFromInt8 | ( | char * | byteArr, |
| int8_t | value | ||
| ) |
| ssize_t jetson_read_values | ( | BufferedSerial & | bcJetson, |
| Jetson_read_data & | read_data, | ||
| Jetson_read_odom & | odom_data | ||
| ) |
Read desired pitch and yaw position data from Jetson
| pitch_move | buffer to store desired pitch position |
| yaw_move | buffer to store desired yaw position |
| void jetson_send_feedback | ( | BufferedSerial & | bcJetson, |
| const Jetson_send_ref & | ref_data, | ||
| const Jetson_send_data & | data, | ||
| int | msg_type | ||
| ) |
Read motor values and send to CV
| ssize_t jetson_send_read_spi | ( | SPI & | spiJetson, |
| const Jetson_send_data & | input, | ||
| Jetson_read_data & | output | ||
| ) |
| char jetson_read_buff[JETSON_READ_BUFF_SIZE] = {0} |
| int jetson_read_buff_pos = 0 |
| char nucleo_value[50] = {0} |