Skip to content

Commit

Permalink
toggled tf to default and workaround baro for tf
Browse files Browse the repository at this point in the history
  • Loading branch information
Patrick Wiesen committed Aug 17, 2022
1 parent 76d3de5 commit e5c3630
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions tello/tello/tello_node.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ def __init__(self, node):
self.node.declare_parameter('tello_ip', '192.168.10.1')
self.node.declare_parameter('tf_base', 'map')
self.node.declare_parameter('tf_drone', 'drone')
self.node.declare_parameter('tf_pub', False)
self.node.declare_parameter('tf_pub', True)
self.node.declare_parameter('camera_info_file', '')

# Get parameters
Expand Down Expand Up @@ -128,7 +128,11 @@ def status_odom():
t.child_frame_id = self.tf_drone
t.transform.translation.x = 0.0
t.transform.translation.y = 0.0
t.transform.translation.z = (self.tello.get_barometer()) / 100.0
try:
baro = self.tello.get_barometer() / 100.0
except:
baro = 0.0
t.transform.translation.z = baro
self.tf_broadcaster.sendTransform(t)

# IMU
Expand Down

0 comments on commit e5c3630

Please sign in to comment.