ME 405 Romi
Loading...
Searching...
No Matches
bump_task.Bump_Task Class Reference

Collision detector for cooperative scheduler. More...

Public Member Functions

 __init__ (self, c_state, bump_sensor_right, bump_sensor_left, bump_on_off, bump_flg)
 Shares are passed as parameters, used to communicate between tasks in the cooperative scheduler.
 run (self)
 This function runs via the cooperative scheduler.

Public Attributes

 c_state = c_state
 bump_sensor_right = bump_sensor_right
 bump_sensor_left = bump_sensor_left
int state = 0
 bump_on_off = bump_on_off
 bump_flg = bump_flg

Detailed Description

Collision detector for cooperative scheduler.

This class runs continuously, setting flags that are shared with other tasks.

The Bump task uses two sensor objects, for left and right side of the Romi. Any collision with either side will be treated the same.

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

Definition at line 10 of file bump_task.py.

Constructor & Destructor Documentation

◆ __init__()

bump_task.Bump_Task.__init__ ( self,
c_state,
bump_sensor_right,
bump_sensor_left,
bump_on_off,
bump_flg )

Shares are passed as parameters, used to communicate between tasks in the cooperative scheduler.


Parameters
c_stateA flag used to tell which control state is desired
bump_sensor_rightThe right bump Sensor Object
bump_sensor_leftThe left bump Sensor Object
bump_on_offA flag to tell bump_task to read if the sensors are pressed
bump_flgA flag set if a sensor was pressed while being read

Definition at line 17 of file bump_task.py.

Member Function Documentation

◆ run()

bump_task.Bump_Task.run ( self)

This function runs via the cooperative scheduler.

State 0 Not reading sensors

State 1 Reading sensors

Effects

Sets bump_flg to 1 when a sensor is pressed from left or right side

Definition at line 35 of file bump_task.py.

Member Data Documentation

◆ bump_flg

bump_task.Bump_Task.bump_flg = bump_flg

Definition at line 23 of file bump_task.py.

◆ bump_on_off

bump_task.Bump_Task.bump_on_off = bump_on_off

Definition at line 22 of file bump_task.py.

◆ bump_sensor_left

bump_task.Bump_Task.bump_sensor_left = bump_sensor_left

Definition at line 20 of file bump_task.py.

◆ bump_sensor_right

bump_task.Bump_Task.bump_sensor_right = bump_sensor_right

Definition at line 19 of file bump_task.py.

◆ c_state

bump_task.Bump_Task.c_state = c_state

Definition at line 18 of file bump_task.py.

◆ state

int bump_task.Bump_Task.state = 0

Definition at line 21 of file bump_task.py.


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