Fix up some more commenting

This commit is contained in:
Piv
2020-04-05 18:59:38 +09:30
parent 685f2ad35b
commit 9deaeb3294

View File

@@ -136,6 +136,19 @@ def calc_groups(scan):
def find_centre(group):
"""
Gets a tuple (x,y) of the centre of the group.
Parameters
----------
group: Group
A group of points to find the centre of.
Returns
-------
tuple (x,y)
The centre in the form of a tuple (x,y)
"""
return ((group.get_maxX() + group.get_minX()) / 2, (group.get_maxY() + group.get_minY()) / 2)
@@ -159,8 +172,21 @@ def updateCarVelocity(oldGroup, newGroup):
Return a tuple (DistanceChange, AngleChange) indicating how the tracked groups have changed, which can
be used to then update the steering/throttle of the car (or other vehicle that
may be used)
Parameters
----------
oldGroup: Group
The positioning of points for the group in the last scan.
newGroup: Group
The positioning of points for the group in the latest scan.
Returns
-------
tuple (DistanceChange, AngleChange)
A tuple containing how the groups' centres changed in the form (distance,angle)
"""
pass
return (find_centre(newGroup))
def dualServoChange(newCentre, changeTuple):