Skip to content

Commit

Permalink
add type annotation in septentrio_heading_converter.py
Browse files Browse the repository at this point in the history
Signed-off-by: Kento Yabuuchi <[email protected]>
  • Loading branch information
KYabuuchi committed Jan 6, 2025
1 parent ca1594c commit 533a502
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions aip_xx1_gen2_launch/scripts/septentrio_heading_converter.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ def __init__(self):
)
self.subscription # prevent unused variable warning

def heading_to_quaternion(self, heading):
def heading_to_quaternion(self, heading: float) -> Quaternion:
# The input heading is in a North-East coordinate system and measured in degrees.
# Heading values range from [0, 360).
# Examples:
Expand All @@ -56,7 +56,7 @@ def heading_to_quaternion(self, heading):
q.w = np.cos(np.deg2rad(90 - heading) / 2.0)
return q

def attitude_callback(self, attitude_msg):
def attitude_callback(self, attitude_msg: AttEuler) -> None:
# When septentrio driver cannot measure the heading, it will publish -20000000000.0
if attitude_msg.heading < 0:
return
Expand All @@ -77,7 +77,7 @@ def attitude_callback(self, attitude_msg):
self.publisher.publish(orientation_msg)


def main(args=None):
def main(args=None) -> None:
rclpy.init(args=args)

converter = OrientationConverter()
Expand Down

0 comments on commit 533a502

Please sign in to comment.