master board program  v. 2 - 2018
Jetson communication

All functions, variables, threads and macros used to communicate with Jetson. More...

Macros

#define JETSON_SERIAL   &SD6
 
#define LOAD_JETSON_VALUES   1
 
#define SAVE_JETSON_VALUES   2
 
#define JETSON_MOVE_COMMAND   255
 
#define KICK_COMMAND   254
 
#define START_COMMAND   251
 
#define LINE_CALIBRATION_COMMAND   250
 
#define INIT_COMMAND   249
 
#define RESET_COMMAND   248
 
#define DRIBLER_COMMAND   247
 
#define LINE_DETECTED_COMMAND   246
 
#define STOP_COMMAND   245
 
#define START_ULTRASONIC_COMMAND   244
 
#define STOP_ULTRASONIC_COMMAND   243
 
#define LEFT_TRUE   242
 
#define LEFT_FALSE   241
 
#define RIGHT_TRUE   240
 
#define RIGHT_FALSE   239
 
#define LEFT_CLOSE   238
 
#define RIGHT_CLOSE   237
 
#define START   3
 
#define STOP   5
 
#define START_STOP   6
 
#define DRIBLER_ON_OFF   4
 
#define KICK   2
 

Functions

msg_t send_jetson (msg_t command)
 Send message to Jetson write thread. More...
 
static THD_WORKING_AREA (waJetsonWriteThread, 128)
 
static THD_FUNCTION (JetsonWriteThread, arg)
 

Jetson write thread

Waits for the command, which then correctly sends to Jetson. More...
 
static THD_WORKING_AREA (waJetsonReadThread, 128)
 
static THD_FUNCTION (JetsonReadThread, arg)
 

Jetson read thread

Receives all commands from Jetson and sends them for further processing. More...
 
msg_t get_jetson_values (void)
 Send message to Jetson save thread which load movement values from jetson to main variables. More...
 
static THD_WORKING_AREA (waJetsonSaveThread, 128)
 
static THD_FUNCTION (JetsonSaveThread, arg)
 

Jetson save thread

Makes copies of movement values from Jetson read thread and makes them available from outside with function get_jetson_values. More...
 
static THD_WORKING_AREA (waButtonGoThread, 128)
 
static THD_FUNCTION (ButtonGoThread, arg)
 

Button go thread

check go button on top of robot More...
 
void jetson_init (void)
 

Init of all 3 Jetson processing threads:

More...
 

Variables

thread_t * jetson_write_thread
 
thread_t * jetson_save_thread
 
uint16_t ball_degree
 
int16_t robot_speed
 
int16_t robot_azimuth
 
uint8_t received_command
 
uint16_t jetson_degree
 
int16_t jetson_speed
 
int16_t jetson_azimuth
 
uint16_t ball_degree
 
int16_t robot_speed
 
int16_t robot_azimuth
 

Detailed Description

All functions, variables, threads and macros used to communicate with Jetson.

3 threads communicating with Nvidia Jetson tx2 via serial communication (USART). Sends commands to other parts of program to next processing.

Macro Definition Documentation

#define DRIBLER_COMMAND   247
#define DRIBLER_ON_OFF   4
#define INIT_COMMAND   249
#define JETSON_MOVE_COMMAND   255
#define JETSON_SERIAL   &SD6
#define KICK   2
#define KICK_COMMAND   254
#define LEFT_CLOSE   238
#define LEFT_FALSE   241
#define LEFT_TRUE   242
#define LINE_CALIBRATION_COMMAND   250
#define LINE_DETECTED_COMMAND   246
#define LOAD_JETSON_VALUES   1
#define RESET_COMMAND   248
#define RIGHT_CLOSE   237
#define RIGHT_FALSE   239
#define RIGHT_TRUE   240
#define SAVE_JETSON_VALUES   2
#define START   3
#define START_COMMAND   251
#define START_STOP   6
#define START_ULTRASONIC_COMMAND   244
#define STOP   5
#define STOP_COMMAND   245
#define STOP_ULTRASONIC_COMMAND   243

Function Documentation

msg_t get_jetson_values ( void  )

Send message to Jetson save thread which load movement values from jetson to main variables.

Returns
chMsgSend(jetson_save_thread, LOAD_JETSON_VALUES);
Warning
movement values load to main variables

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void jetson_init ( void  )

Init of all 3 Jetson processing threads:

+ Here is the caller graph for this function:

msg_t send_jetson ( msg_t  command)

Send message to Jetson write thread.

Parameters
command
Returns
chMsgSend(jetson_write_thread, command);

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static THD_FUNCTION ( JetsonWriteThread  ,
arg   
)
static

Jetson write thread

Waits for the command, which then correctly sends to Jetson.

Parameters
JetsonWriteThread
arg
Returns

+ Here is the call graph for this function:

static THD_FUNCTION ( JetsonReadThread  ,
arg   
)
static

Jetson read thread

Receives all commands from Jetson and sends them for further processing.

Parameters
JetsonReadThread
arg
Returns

+ Here is the call graph for this function:

static THD_FUNCTION ( JetsonSaveThread  ,
arg   
)
static

Jetson save thread

Makes copies of movement values from Jetson read thread and makes them available from outside with function get_jetson_values.

Parameters
JetsonSaveThread
arg
Returns

+ Here is the call graph for this function:

static THD_FUNCTION ( ButtonGoThread  ,
arg   
)
static

Button go thread

check go button on top of robot

Parameters
ButtonGoThread
arg
Returns

+ Here is the call graph for this function:

static THD_WORKING_AREA ( waJetsonWriteThread  ,
128   
)
static

+ Here is the caller graph for this function:

static THD_WORKING_AREA ( waJetsonReadThread  ,
128   
)
static
static THD_WORKING_AREA ( waJetsonSaveThread  ,
128   
)
static
static THD_WORKING_AREA ( waButtonGoThread  ,
128   
)
static

Variable Documentation

uint16_t ball_degree
uint16_t ball_degree
int16_t jetson_azimuth
uint16_t jetson_degree
thread_t* jetson_save_thread
int16_t jetson_speed
thread_t* jetson_write_thread
uint8_t received_command

command received from jetson

int16_t robot_azimuth
int16_t robot_azimuth
int16_t robot_speed
int16_t robot_speed