Damond Li Project
task_motor.Task_Motor Class Reference

Interface with two DR8847 motors. More...

Public Member Functions

def __init__ (self, dutyX, dutyY, state)
 Constructs a motor driver object and creates two motor objects. More...
 
def run (self)
 Updates each motor to run at the specified duty cycle. More...
 
def enable (self)
 This method enables the motors. More...
 
def disable (self)
 This method disables the motors. More...
 

Public Attributes

 motor_drv
 This object is the motor driver.
 
 motor1
 This object is the first motor constructed from the driver.
 
 motor2
 This object is the second motor constructed from the driver.
 
 dutyX
 This object is a shares object describing the duty cycle to run motor 1.
 
 dutyY
 This object is a shares object describing the duty cycle to run motor 2.
 
 state
 This object is a shares object describing the state of the finite state machine.
 
 motorboolvalue
 This value is used to quickly enable and disable the motors, primarily for debugging.
 

Detailed Description

Interface with two DR8847 motors.

This class has one main function that runs the two motors.

Constructor & Destructor Documentation

◆ __init__()

def task_motor.Task_Motor.__init__ (   self,
  dutyX,
  dutyY,
  state 
)

Constructs a motor driver object and creates two motor objects.

The contructor function creates a motor driver object and creates two motor objects from the motor driver.

Parameters
dutyXA shares. Share object describing the duty cycle to run the motor responsible for controlling the x direction.
dutyYA shares. Share object describing the duty cycle to run the motor responsible for controlling the y direction.

Member Function Documentation

◆ disable()

def task_motor.Task_Motor.disable (   self)

This method disables the motors.

This changes a value that is multiplied to the duty cycle. This multiplier is "0" in this method.

◆ enable()

def task_motor.Task_Motor.enable (   self)

This method enables the motors.

This changes a value that is multiplied to the duty cycle. This multiplier is "1" in this method.

◆ run()

def task_motor.Task_Motor.run (   self)

Updates each motor to run at the specified duty cycle.

This function reads from the duty cycle shares object. The data from the duty cycle is then used to run a method of the motor driver class to set the duty cycle.


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