task_line_follow module

task_line_follow.py

Cooperative task that runs a PI controller to keep a line centered under the Romi robot. The centroid reported by the reflectance sensor is used as the feedback signal. The controller output is applied as a differential speed offset to the left and right motors so that the robot steers toward the line.

class task_line_follow.task_line_follow(lineFollowGo, lineFollowSetPoint, lineFollowKp, lineFollowKi, lineCentroid, lineFollowKff, rightMotorSetPoint, leftMotorSetPoint)[source]

Bases: object

Cooperative scheduler task for line following on a differential-drive Romi.

A PIController tracks the line centroid (feedback) and outputs a speed correction that is added to the nominal forward velocity on one wheel and subtracted from the other, steering the robot back onto the line.

run()[source]

Cooperative task for scheduler