Skip to content

Commit

Permalink
Addition of gamepad_teleop_node.py and joy node
Browse files Browse the repository at this point in the history
  • Loading branch information
jordy-van-appeven committed Oct 10, 2019
1 parent 3b9399d commit c615fd1
Show file tree
Hide file tree
Showing 12 changed files with 230 additions and 284 deletions.
54 changes: 46 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# tello_driver

[![Build Status](http://build.ros.org/job/Ksrc_uX__tello_driver__ubuntu_xenial__source/badge/icon)](http://build.ros.org/job/Ksrc_uX__tello_driver__ubuntu_xenial__source/)

## 1. Overview
Communicating with the Tello drone can be done either using official [Tello SDK](https://dl-cdn.ryzerobotics.com/downloads/Tello/Tello%20SDK%202.0%20User%20Guide.pdf) or one of the unofficial libraries. The unofficial libraries originated from the reverse-engineering the raw packages broadcasted by the Tello. This ROS package is build on top of the unofficial [TelloPy](https://github.com/hanyazou/TelloPy) library. The [TelloPy](https://github.com/hanyazou/TelloPy) library is used at this moment since it offers more functionalities than the official [Tello SDK](https://dl-cdn.ryzerobotics.com/downloads/Tello/Tello%20SDK%202.0%20User%20Guide.pdf) or any other unofficial library.

Expand All @@ -23,7 +25,6 @@ Developing of the tello_driver ROS package is inspired by [tello_driver](https:/
* Connect to drone's WiFi access point (```TELLO_XXXXXX)```
* ```$ roslaunch tello_driver tello_node.launch```


## 2. Nodes

### tello_driver_node.py
Expand All @@ -40,19 +41,17 @@ Main node running as interface for the TelloPy library
* ```/tello/takeoff``` [std_msgs/Empty](http://docs.ros.org/api/std_msgs/html/msg/Empty.html)
* ```/tello/throw_takeoff``` [std_msgs/Empty](http://docs.ros.org/api/std_msgs/html/msg/Empty.html)

### Published topics
#### Published topics
* ```/tello/camera/camera_info``` [sensor_msgs/CameraInfo](http://docs.ros.org/api/sensor_msgs/html/msg/CameraInfo.html)
* ```/tello/image_raw``` [sensor_msgs/Image](http://docs.ros.org/api/sensor_msgs/html/msg/Image.html)
* ```/tello/imag/raw/h264``` [h264_image_transport/H264Packet](https://github.com/tilk/h264_image_transport/blob/master/msg/H264Packet.msg)
* ```/tello/odom``` [nav_msgs/Odometry](http://docs.ros.org/api/nav_msgs/html/msg/Odometry.html)
* ```/tello/status``` [tello_driver/TelloStatus](https://github.com/appie-17/tello_driver/blob/development/msg/TelloStatus.msg)

### Services
#### Services
TODO

### Parameters
* ```~/image_raw/compressed/format```
* ```~/image_raw/compressed/jpeg_quality```
* ```~/image_raw/compressed/png_level```
#### Parameters
* ```~/tello_driver_node/connect_timeout_sec```
* ```~/tello_driver_node/fixed_video_rate```
* ```~/tello_driver_node/local_cmd_client_port```
Expand All @@ -63,12 +62,51 @@ Main node running as interface for the TelloPy library
* ```~/tello_driver_node/vel_cmd_scale```
* ```~/tello_driver_node/video_req_sps_hz```

### gamepad_teleop_node.py
Converting gamepad input controls from ```joy_node``` to commands for ```tello_driver_node.py```

#### Subscribed topics
* ```/joy``` [sensor_msgs/Joy](http://docs.ros.org/api/sensor_msgs/html/msg/Joy.html)
* ```/tello/agent_cmd_vel_in``` [geometry_msgs/Twist](http://docs.ros.org/api/geometry_msgs/html/msg/Twist.html)

#### Published topic
* ```/tello/cmd_vel``` [geometry_msgs/Twist](http://docs.ros.org/api/geometry_msgs/html/msg/Twist.html)
* ```/tello/fast_mode``` [std_msgs/Empty](http://docs.ros.org/api/std_msgs/html/msg/Empty.html)
* ```/tello/flattrim``` [std_msgs/Empty](http://docs.ros.org/api/std_msgs/html/msg/Empty.html)
* ```/tello/flip``` [std_msgs/Uint8](http://docs.ros.org/api/std_msgs/html/msg/UInt8.html)
* ```/tello/land``` [std_msgs/Empty](http://docs.ros.org/api/std_msgs/html/msg/Empty.html)
* ```/tello/palm_land``` [std_msgs/Empty](http://docs.ros.org/api/std_msgs/html/msg/Empty.html)
* ```/tello/reset``` [std_msgs/Empty](http://docs.ros.org/api/std_msgs/html/msg/Empty.html)
* ```/tello/takeoff``` [std_msgs/Empty](http://docs.ros.org/api/std_msgs/html/msg/Empty.html)
* ```/tello/throw_takeoff``` [std_msgs/Empty](http://docs.ros.org/api/std_msgs/html/msg/Empty.html)

#### Services
None

#### Parameters

### joy_node
Receive input from gamepad controller and publish into ```sensor_msgs/Joy``` message

### Subscribed topics
None

### Published topics
* ```/joy``` [sensor_msgs/Joy](http://docs.ros.org/api/sensor_msgs/html/msg/Joy.html)

### Services
None

### Parameters
* ```~/joy_node/deadzone```
* ```~/joy_node/dev```

## 3. Troubleshooting

## 4. Notes
*When using PyAV to decode raw video instead of streaming h264 video, required to relaunch the ```tello_driver_node.py``` to continue the video stream after disconnected WiFi connection.

## 5. WIP
## 5. Work-in-progress

## 6. License

Expand Down
20 changes: 20 additions & 0 deletions cfg/960x720.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
image_width: 960
image_height: 720
camera_name: camera_front
camera_matrix:
rows: 3
cols: 3
data: [929.562627, 0.000000, 487.474037, 0.000000, 928.604856, 363.165223, 0.000000, 0.000000, 1.000000]
distortion_model: plumb_bob
distortion_coefficients:
rows: 1
cols: 5
data: [-0.016272, 0.093492, 0.000093, 0.002999, 0.000000]
rectification_matrix:
rows: 3
cols: 3
data: [1.000000, 0.000000, 0.000000, 0.000000, 1.000000, 0.000000, 0.000000, 0.000000, 1.000000]
projection_matrix:
rows: 3
cols: 4
data: [937.878723, 0.000000, 489.753885, 0.000000, 0.000000, 939.156738, 363.172139, 0.000000, 0.000000, 0.000000, 1.000000, 0.000000]
5 changes: 4 additions & 1 deletion cfg/Tello.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,10 @@ gen.add("video_req_sps_hz", double_t, 0,
"Rate for regularly requesting SPS data from drone (0: disabled)",
0.5, 0.0, 4.0)

# Limit velocity control (Jordy)
# Scale velocity control (Jordy)
gen.add("vel_cmd_scale", double_t, 0, "Scale (down) vel_cmd value", 0.5, 0.01, 1.0)

# Limit attitude control (Jordy)
gen.add("att_limit", double_t, 0, "Limit attitude of Tello", 15, 5, 90)

exit(gen.generate(PACKAGE, "tello_driver_node.py", "Tello"))
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_marshall_node.py" name="joy_teleop" />
<node pkg="tello_driver" type="gamepad_teleop_node.py" name="gamepad_teleop" />
</group>

</launch>
1 change: 1 addition & 0 deletions launch/logger.launch
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
<?xml version="1.0" ?>
<launch>
<arg name="bag.name" default="$(env HOME)/tello"/>
<arg name="bag.topics" default="
Expand Down
37 changes: 21 additions & 16 deletions launch/tello_node.launch
Original file line number Diff line number Diff line change
@@ -1,21 +1,26 @@
<?xml version="1.0"?>
<launch>
<arg name="tello_ip" default="192.168.10.1" />
<arg name="tello_cmd_server_port" default="8889" />
<arg name="local_cmd_client_port" default="8890" />
<arg name="local_vid_server_port" default="6038" />
<arg name="namespace" default="tello" />
<arg name="tello_ip" default="192.168.10.1" />
<arg name="tello_cmd_server_port" default="8889" />
<arg name="local_cmd_client_port" default="8890" />
<arg name="local_vid_server_port" default="6038" />
<arg name="camera_calibration" default="$(find tello_driver)/cfg/960x720.yaml" />
<arg name="namespace" default="tello" />

<group ns="$(arg namespace)">
<node pkg="tello_driver" name="tello_driver_node" type="tello_driver_node.py" 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)" />
<param name="tello_cmd_server_port" value="$(arg tello_cmd_server_port)" />
<param name="connect_timeout_sec" value="10.0" />
<param name="stream_h264_video" value="true" />
</node>
<group ns="$(arg namespace)">

<node pkg="tello_driver" name="tello_driver_node" type="tello_driver_node.py" 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)" />
<param name="tello_cmd_server_port" value="$(arg tello_cmd_server_port)" />
<param name="connect_timeout_sec" value="10.0" />
<param name="stream_h264_video" value="true" />
<param name="camera_calibration" value="$(arg camera_calibration)" />
</node>

<node pkg="image_transport" name="image_compressed" type="republish" args="raw in:=image_raw compressed out:=image_raw" />

</group>

<node pkg="image_transport" name="image_compressed" type="republish" args="raw in:=image_raw compressed out:=image_raw" />
</group>
</launch>
27 changes: 0 additions & 27 deletions launch/two_drones_test.launch

This file was deleted.

5 changes: 4 additions & 1 deletion package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
<package format="2">
<name>tello_driver</name>
<version>0.2.0</version>

<description>>This package provides a ROS interface for the TelloPy library.
Development of this ROS package pursues not to modify the TelloPy library,
instead apply any modification or addition to the ros_driver package in an encapsulated manner.</description>
Expand All @@ -12,8 +13,10 @@
<!-- Url tags are optional, but mutiple are allowed, one per tag -->
<!-- Optional attribute type can be: website, bugtracker, or repository -->
<!-- Example: -->
<url>http://www.ros.org/wiki/tello_driver</url>
<url type="website">https://github.com/appie-17/tello_driver</url>

<url type="bugtracker">https://github.com/appie-17/tello_driver/issues</url>


<license>Apache2</license>

Expand Down
Loading

0 comments on commit c615fd1

Please sign in to comment.