Lidar fixes
This commit is contained in:
@@ -83,11 +83,11 @@ def convert_cartesian_to_lidar(x, y):
|
||||
A tuple (distance, angle) that represents the point. Angle is in degrees.
|
||||
"""
|
||||
# Angle depends on x/y position.
|
||||
# if x is positive and y is positive, then angle = 90 - tan-1(y/x)
|
||||
# if x is positive and y is negative, then angle = 90 + tan-1(y/x)
|
||||
# if x is negative and y is positive, then angle = 270 + tan-1(y/x)
|
||||
# if x is negative and y is negative, then angle = 270 - tan-1(y/x)
|
||||
return (math.sqrt(x ** 2 + y ** 2), math.degrees(math.atan(y/x) + (180 if ))
|
||||
# if x is positive and y is positive, then angle = tan-1(y/x)
|
||||
# if x is positive and y is negative, then angle = 360 + tan-1(y/x)
|
||||
# if x is negative and y is positive, then angle = 180 + tan-1(y/x)
|
||||
# if x is negative and y is negative, then angle = 180 + tan-1(y/x)
|
||||
return (math.sqrt(x ** 2 + y ** 2), math.degrees(math.atan(y/x)) + (180 if x < 0 else 270 if y < 0 else 0))
|
||||
|
||||
|
||||
def calc_groups(scan):
|
||||
|
||||
Reference in New Issue
Block a user