ME 405 Term Project
Loading...
Searching...
No Matches
stream_task.StreamTask Class Reference

Public Member Functions

 __init__ (self, stream_data, uart, time_sh, left_pos_sh, right_pos_sh, left_vel_sh, right_vel_sh, motor_data_ready, abort)
 run (self)

Public Attributes

 ser = uart
 stream_data = stream_data
 motor_data_ready = motor_data_ready
 abort = abort
 time_sh = time_sh
 left_pos_sh = left_pos_sh
 right_pos_sh = right_pos_sh
 left_vel_sh = left_vel_sh
 right_vel_sh = right_vel_sh
int sent_end = 0
 0: INIT STATE -----------------------------------------------—
int lines_sent = 0
 0: INIT STATE -----------------------------------------------—
int state = self.S0_INIT
 0: INIT STATE -----------------------------------------------—

Static Public Attributes

int S0_INIT = 0
int S1_WAIT_FOR_TRIGGER = 1
int S2_STREAM_DATA = 2

Detailed Description

Streams data (in CSV format) over Bluetooth if enabled.

Attributes:
    ser: Serial interface (Bluetooth UART).
    stream_data: Flag to control whether streaming is active.
    time_sh: Share for the current time.
    left_pos_sh: Share for the left encoder position.
    right_pos_sh: Share for the right encoder position.
    left_vel_sh: Share for the left encoder velocity.
    right_vel_sh: Share for the right encoder velocity.
    motor_data_ready: Flag indicating new motor data is available.
    abort: Flag to abort streaming immediately.

Constructor & Destructor Documentation

◆ __init__()

stream_task.StreamTask.__init__ ( self,
stream_data,
uart,
time_sh,
left_pos_sh,
right_pos_sh,
left_vel_sh,
right_vel_sh,
motor_data_ready,
abort )

Initialize the object's attributes

Member Function Documentation

◆ run()

stream_task.StreamTask.run ( self)

FINITE STATE MACHINE

Finite state machine for data streaming.

Member Data Documentation

◆ abort

stream_task.StreamTask.abort = abort

◆ left_pos_sh

stream_task.StreamTask.left_pos_sh = left_pos_sh

◆ left_vel_sh

stream_task.StreamTask.left_vel_sh = left_vel_sh

◆ lines_sent

int stream_task.StreamTask.lines_sent = 0

0: INIT STATE -----------------------------------------------—

1: WAIT FOR TRIGGER STATE -----------------------------------—

2: STREAM DATA STATE ----------------------------------------—

◆ motor_data_ready

stream_task.StreamTask.motor_data_ready = motor_data_ready

◆ right_pos_sh

stream_task.StreamTask.right_pos_sh = right_pos_sh

◆ right_vel_sh

stream_task.StreamTask.right_vel_sh = right_vel_sh

◆ S0_INIT

int stream_task.StreamTask.S0_INIT = 0
static

◆ S1_WAIT_FOR_TRIGGER

int stream_task.StreamTask.S1_WAIT_FOR_TRIGGER = 1
static

◆ S2_STREAM_DATA

int stream_task.StreamTask.S2_STREAM_DATA = 2
static

◆ sent_end

int stream_task.StreamTask.sent_end = 0

0: INIT STATE -----------------------------------------------—

1: WAIT FOR TRIGGER STATE -----------------------------------—

2: STREAM DATA STATE ----------------------------------------—

◆ ser

stream_task.StreamTask.ser = uart

◆ state

int stream_task.StreamTask.state = self.S0_INIT

0: INIT STATE -----------------------------------------------—

1: WAIT FOR TRIGGER STATE -----------------------------------—

◆ stream_data

stream_task.StreamTask.stream_data = stream_data

◆ time_sh

stream_task.StreamTask.time_sh = time_sh

The documentation for this class was generated from the following file: