SAE WS_2324
Loading...
Searching...
No Matches
drive.Drive Class Reference

This is a Drive Module base class. More...

Public Member Functions

 __init__ (self)
 Drive module class initializer.
 
 read_motor_speed_degs (self, motor_speed_degs)
 Function to provide the Drive module with the motor speed in degrees/second.
 
 calc_speed_rps (self)
 Helper function to convert degrees/second to rounds per second.
 
 calc_speed_mmps (self)
 Helper function to convert the rounds per second speed to mm/second.
 
 interpolate_distance (self)
 Function to interpolate the distance travelled by the rear wheels.
 
 get_theta (self, input_theta)
 Function to acquire the heading angle.
 
 calc_coordinates (self)
 Function to calculate the x,y coordinates using the heading angle and the motion model equations.
 

Public Attributes

 drive_distance_mm
 Distance Driven by the Vehicle in mm.
 
 drive_speed_mmps
 Calculated speed of the Vehicle in mm/s using motors speed in deg/s.
 
 drive_speed_rps
 Drive motor Speed in rounds per second.
 
 drive_speed_degs
 Drive motor Speed in degrees per second.
 
 lego_wheel_circumference_mm
 Wheel Circumference of LEGO wheel, tuning required in case of improper distance calculation.
 
 Ts
 Sample time at which the tasks are run, all tasks must run at this sample rate.
 
 xc
 Calculated positional X coordinate.
 
 yc
 Calcualted positional Y coordinate.
 
 theta
 Heading of the vehicle provided as input.
 

Detailed Description

This is a Drive Module base class.

This class defines the methods and data required to run the motion model.

Member Function Documentation

◆ calc_coordinates()

drive.Drive.calc_coordinates ( self)

Function to calculate the x,y coordinates using the heading angle and the motion model equations.

Refer to the motion model part in the Project Documentation.

◆ interpolate_distance()

drive.Drive.interpolate_distance ( self)

Function to interpolate the distance travelled by the rear wheels.

The Function calculates the distance traversed by performing integration of the speed. distance = distance + speed * Sample time

◆ read_motor_speed_degs()

drive.Drive.read_motor_speed_degs ( self,
motor_speed_degs )

Function to provide the Drive module with the motor speed in degrees/second.

Parameters
motor_speed_degsThe motor speed in degrees/second.

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