Skip to content

Commit

Permalink
Added string representation for drone odometry (#38)
Browse files Browse the repository at this point in the history
  • Loading branch information
mgupta27 authored Jul 2, 2024
1 parent efa7a28 commit 2ceb06c
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions mavlink/modules/drone_odometry.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,12 @@ def __init__(
self.longitude = longitude
self.altitude = altitude

def __str__(self) -> str:
"""
To string.
"""
return f"{self.__class__}, latitude: {self.latitude}, longitude: {self.longitude}, altitude: {self.altitude}"


class DroneOrientation:
"""
Expand Down Expand Up @@ -96,6 +102,12 @@ def __init__(
self.pitch = pitch
self.roll = roll

def __str__(self) -> str:
"""
To string.
"""
return f"{self.__class__}, yaw: {self.yaw}, pitch: {self.pitch}, roll: {self.roll}"


class DroneOdometry:
"""
Expand Down Expand Up @@ -132,3 +144,9 @@ def __init__(

self.position = position
self.orientation = orientation

def __str__(self) -> str:
"""
To string.
"""
return f"{self.__class__}, position: {self.position}, orientation: {self.orientation}"

0 comments on commit 2ceb06c

Please sign in to comment.