diff --git a/driving.py b/driving.py index 3168a06c100460c1ee7120b35e7a85d28d67ddfd..e1c2ebac594efe1bfd996261b84a61aab5cbf67c 100644 --- a/driving.py +++ b/driving.py @@ -14,17 +14,17 @@ L = 2 # Value for a left turn #%% Classes """ -# This class countaions some functions to analyse data from the lego robot EV3. -# It detects the type of the section depending on the rotationspeed of the robot. -# Also it calculate the odometrie for x-position, y-position an direction of the robot -# and can calculate the driven distance on a section. +# This class contains some functions to analyze data from the LEGO robot EV3. +# It detects the section type depending on the rotationspeed of the robot. +# It calculates the odometrie for x-position, y-position and direction of the robot. +# It calculates the driven distance on a section. """ class Driving_Analyser: """ # Constructor of the driving analyser. - # Need threshold values of rotationspeed for left and right turn - # and also a block size represent the number of left and right turns which are sumed up to classifie the section type. + # Needs threshold values of rotationspeed for left and right turn + # and a block size which represents the number of iterations to analyze the section type """ def __init__(self, threshold_left, threshold_right, block_size): self.threshold_left = threshold_left @@ -39,14 +39,14 @@ class Driving_Analyser: self.driven_distance_on_section = 0 """ - # This function detect the section type. - # For the detection is use the given threshold for left and right turns - # and the block size to sum up the values. + # This function detects the section type. + # For the detection the given threshold for left and right turns + # and the block size to sum up the values are used. # The function decides on the basis of the threshold values # whether the current rotation speed is a left or a right turn # and sums up these types in the amount of the block size to make the decision for the section type. - # If the function is called and the sum of values are lower than the block size it's return None - # If the detection of the section is completed, the function will return a integer value. + # If the function is called and the sum of values is lower than the block size it returns None + # If the detection of the section is completed, the function will return an integer value. # 0 # Value for a straight part of the track # 1 # Value for a right turn # 2 # Value for a left turn @@ -71,8 +71,8 @@ class Driving_Analyser: return (section_type, self.counter_left, self.counter_right, self.counter_straight) """ - # This function caluates the continues odometrie which add the new positon to the old one. - # The calculation of the position depending on the speed, rotationspeed and the time.span. + # This function calcuates the continues odometrie which adds the new positon to the old one. + # The calculation of the position depends on the speed, rotationspeed and the time span. """ def calculate_odometrie_continues (self, w, v, time_delta): @@ -94,8 +94,8 @@ class Driving_Analyser: return (self.x_old, self.y_old, self.theta_old) """ - # This function caluates the delta odometrie which return only the delta position of the given time span. - # The calculation of the position depending on the speed, rotationspeed and the time.span. + # This function calcuates the delta odometrie which returns only the delta position of the given time span. + # The calculation of the position depends on the speed, rotationspeed and the time span. """ def calculate_odometrie_delta (self, w, v, time_delta): @@ -119,14 +119,14 @@ class Driving_Analyser: return self.driven_distance_on_section """ - # This function will reset the drivien distance. + # This function resets the drivien distance. """ def reset_driven_distance_on_section (self): self.driven_distance_on_section = 0 """ - # This function is only for internal use and printing. - # Its convert the integer values for the section type to the correct discription of the section type. + # This function is for internal use and printing only. + # It converts the integer values for the section type to the correct discription of the section type. """ def __get_section_type(self, section_type_int): section_type_string = ""