CALPOLY MECHATRONICS
Documentation for all Mechatronics Labs
shares.py File Reference

A script to store data for sharing between nucleo tasks. More...

Functions

def shares.getMotorState ()
 A method used by nucleoSerial to get the motor position and velocity. More...
 
def shares.logMotorState (state)
 A method used by Controller to update the recorded motor state. More...
 

Variables

list shares.motorState = []
 A list of the most recent motor state. More...
 
bool shares.newMotorState = False
 A boolean for wether or not the motorstate has been updated. More...
 
bool shares.collectData = False
 A boolean for wether or not to collect data. More...
 

Detailed Description

A script to store data for sharing between nucleo tasks.

This script is used to share data between the serial coms task, nucleoSerial.nucleoSerial, and the controller task, controller.Controller to prevent ethier of the tasks from directly acsessing eachothers' data. Link to source code: https://bitbucket.org/ebriefer/me305_lab/src/master/Final%20Project/shares.py

Author
Eliot Briefer

Function Documentation

◆ getMotorState()

def shares.getMotorState ( )

A method used by nucleoSerial to get the motor position and velocity.

Returns
The most recent motor state. Format [time stamp (seconds), velocity (rotations per second), position (rotation)]

◆ logMotorState()

def shares.logMotorState (   state)

A method used by Controller to update the recorded motor state.

Parameters
stateThe state of the motor. Format [time stamp (seconds), velocity (rotations per second), position (rotation)]

Variable Documentation

◆ collectData

bool shares.collectData = False

A boolean for wether or not to collect data.

True = controller and serial tasks should transition to data collection states.

◆ motorState

list shares.motorState = []

A list of the most recent motor state.

Format [time stamp (seconds), velocity (rotations per second), position (rotation)]

◆ newMotorState

bool shares.newMotorState = False

A boolean for wether or not the motorstate has been updated.

True = motorState has been updated since last check.