Skip to content

Commit

Permalink
Remove accepted PRs for TelloPy
Browse files Browse the repository at this point in the history
  • Loading branch information
jordy-van-appeven committed Oct 14, 2019
1 parent ded3d27 commit 5608f35
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 28 deletions.
2 changes: 1 addition & 1 deletion cfg/Tello.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ gen.add("video_req_sps_hz", double_t, 0,
# Limit altitude control (Jordy)
gen.add("altitude_limit", int_t, 0, "Limit altitude of Tello", 10, 1, 100)
# Limit attitude control (Jordy)
gen.add("attitude_limit", int_t, 0, "Limit attitude of Tello", 15, 1, 90)
gen.add("attitude_limit", int_t, 0, "Limit attitude of Tello", 15, 15, 25)
# Set low battery threshold (Jordy)
gen.add("low_bat_threshold", int_t, 0, "Set low battery threshold of Tello", 7, 1, 100)
# Scale velocity control (Jordy)
Expand Down
2 changes: 1 addition & 1 deletion launch/joy_teleop.launch
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
</node>

<group ns="$(arg namespace)">
<node pkg="tello_driver" type="gamepad_teleop_node.py" name="gamepad_teleop" />
<node pkg="tello_driver" type="gamepad_teleop_node" name="gamepad_teleop" />
</group>

</launch>
2 changes: 1 addition & 1 deletion launch/tello_node.launch
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

<group ns="$(arg namespace)">

<node pkg="tello_driver" name="tello_driver_node" type="tello_driver_node.py" output="screen">
<node pkg="tello_driver" name="tello_driver_node" type="tello_driver_node" output="screen">
<param name="local_cmd_client_port" value="$(arg local_cmd_client_port)" />
<param name="local_vid_server_port" value="$(arg local_vid_server_port)" />
<param name="tello_ip" value="$(arg tello_ip)" />
Expand Down
25 changes: 1 addition & 24 deletions nodes/tello_driver_node
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,6 @@ from tellopy._internal.protocol import *
# Add 'EVENT_VIDEO_FRAME_H264' to collect h264 images
from tellopy._internal import event

## Added statics to 'Tello' object, leave 'TelloPy' package untouched (Jordy) ##
THROW_AND_GO_CMD = 0x005d
ATTITUDE_MSG = 0x1056
ATTITUDE_LIMIT_CMD = 0x1059
EMERGENCY_CMD = 'emergency'

########################################END#######################################

class RospyLogger(logger.Logger):
Expand Down Expand Up @@ -151,8 +145,6 @@ class TelloNode(tello.Tello):

#########################################BEGIN#####################################

# video zoom state
self.zoom = False
# Reconstruction H264 video frames
self.prev_seq_id = None
self.seq_block_count = 0
Expand Down Expand Up @@ -284,22 +276,7 @@ class TelloNode(tello.Tello):
else:
frame = b''.join(self.frame_pkts[:sub_id+1])
self._Tello__publish(event=self.EVENT_VIDEO_FRAME_H264,
data=(frame, self.seq_block_count*256+seq_id, self.frame_t))

# video mode command
def __send_video_mode(self, mode):
pkt = Packet(VIDEO_MODE_CMD)
pkt.add_byte(mode)
pkt.fixup()
return self.send_packet(pkt)

def set_video_mode(self, zoom=False):
"""Tell the drone whether to capture 960x720 4:3 video, or 1280x720 16:9 zoomed video.
4:3 has a wider field of view (both vertically and horizontally), 16:9 is crisper."""
self.log.info('set video mode zoom=%s (cmd=0x%02x seq=0x%04x)' % (
zoom, VIDEO_START_CMD, self.pkt_seq_num))
self.zoom = zoom
return self.__send_video_mode(int(zoom))
data=(frame, self.seq_block_count*256+seq_id, self.frame_t))

def send_req_video_sps_pps(self):
"""Manually request drone to send an I-frame info (SPS/PPS) for video stream."""
Expand Down
2 changes: 1 addition & 1 deletion src/TelloPy

0 comments on commit 5608f35

Please sign in to comment.