ME 405 Romi
Loading...
Searching...
No Matches
line_task.py File Reference

This file contains a class to create a line_task object which is compatible with the cotask scheduler to run as a cooperative task. More...

Go to the source code of this file.

Classes

class  line_task.line_task
 line_task class that can be initialized to be run with the cotask scheduler. More...

Namespaces

namespace  line_task

Functions

 line_task.run (self)
 run is the generator that the cotask scheduler will run since our tasks are objects.

Variables

int line_task.SENSOR_START = 0
int line_task.SENSOR_END = 12
int line_task.state = 0:
 line_task.black_data = list(self.lineSensor.read_Calibrate_Data())
bool line_task.got_black = True
 line_task.white_data = list(self.lineSensor.read_Calibrate_Data())
bool line_task.got_white = True

Detailed Description

This file contains a class to create a line_task object which is compatible with the cotask scheduler to run as a cooperative task.

This task is a finite state machine implementation that calibrates the line sensor on startup and then simply reads the centroid of the line sensor forever once its calibrated.

NOTE: The outer 2 ir sensors are turned off by setting the corresponding self.sens_dist value to 0. Helped with line following lines that split.

IMPORTANT: Calibrating the sensor requires a text file name IR_cal.txt. This calibration will write that file but the user will need to stop ROMI, pull the file off onto a local computer and reflash it to the ROMI. If you do not, ROMI will not recognize the new file and will not calibrate.

Author
Alex Power, Lucas Heuchert, Erik Heuchert
Date
2025-Nov-11 Approximate date of creation of file
2025-Dec-12 Final alterations made

Definition in file line_task.py.