-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cannot control the Tello using keystrokes #1
Comments
Hi! Thank you for opening this issue! Unfortunately I do not have a tello with me to test anything. I took a look at the code at https://github.com/mhered/cpp_100daysofcode/tree/main/code/Day053_18-05-23/Tello, but I can't spot a major mistake. Given the error message you are seeing, it seems like the response is not working. Are you sure everything else is working properly? Do all other commands work? What if you simply call takeoff, turn_left() and move() in a row with hardcoded values (preferrably zero), does it work in itself? I modified the execute_command function to print the command instead of sending it and always return ok. This way, it seems like everything is working, when i press the keys in the window, the value changes. I tried it in Ubuntu/WSL because I don't have OpenCV on Windows. You can take a look at send_request() in tello.hpp, it is responsible for actually sending and receiving the commands. Also, there is a #define TELLO_DEFAULT_COMMAND_TIMEOUT which you can alter. send_request() works in a way that it sends the command via one UDP Client and then waits for a response on another UDP Server. As soon as data arrives, this is the response, the function returns, and the response is evaluated. That means, if no data arrives, you will have the timeout you are seeing, or if it is somehow missed. Please check yourself what the response for the rc command is or what it should be, you can also modify the function to simply print the response before returning. Maybe I just never tested the rc command and it does not actually send any response. Please check that. I hope you can do a bit more investigation, I cannot help you directly because I have no tello for testing. PRINTF_DEBUG is your friend :)
Let me know if you know more! |
- `main.cpp`: - activate `tello.hpp` instead of `tello_dummy.hpp` - move `#include "tello.hpp"` before `#include "oldPixelGameEngine.h"` otherwise it does not compile - `tello_dummy.hpp`: - redefine `sleep()` to receive milliseconds instead of seconds - open issue #1 in original repo: HerrNamenlos123/tello#1
Hello,
first, thank you for taking to the time to publish such a nice library to play with the Tello using C++.
I am not sure this is an issue or it's my improper use of the library, but I figured it may happen to other people so I decided to ask here.
I cannot get the Tello to respond to keystrokes using
tello.move()
, I keep getting error messages:Comms seem fine, because I do get the Tello to take off, send video stream, move around e.g. using
turn_right()
/turn_left()
and land. The problem is with controlling it in real time with the keyboard usingmove()
.I assume it is to do with an incorrect configuration of delays and/or not capturing properly the keystrokes.
I tried two different approaches:
cv::waitKey()
from OpenCV to capture the keystrokes - see code here: https://github.com/mhered/cpp_100daysofcode/blob/main/code/Day053_18-05-23/Tellotello_dummy.hpp
header simulating the tello.hpp interface to test that keystrokes were sent properlyI also played with different values of delays using
tello.sleep()
to speed up or slow down the control loop... but all attempts failed similarly.
Any idea of what I am doing wrong?
Thanks for your help!
The text was updated successfully, but these errors were encountered: