TelloPy icon indicating copy to clipboard operation
TelloPy copied to clipboard

Question and parameters passed

Open mattganis opened this issue 6 years ago • 3 comments

I don't see it documented anywhere - but when I used the clockwise(x) method (or any other method that has the drone rotate) - what does the 'x' represent ?

For the forward(x) method, I see the 'x' represents cm/sec speed - but I can't figure out the rotations

thanks.....Matt

mattganis avatar Sep 13 '19 13:09 mattganis

If you go to _internal folder then tello.py

    def clockwise(self, val):
        """
        Clockwise tells the drone to rotate in a clockwise direction.
        Pass in an int from 0-100.
        """
        log.info('clockwise(val=%d)' % val)
        self.left_x = val / 100.0

self.left_x is used in __send_stick_command() __recv_thread

If you want something more discrete try the official tello official commands or easytello which uses rotation 0-360 degrees

perhaps something like this if using tellopy

command = "cw 360"
try:
    self.sock.sendto(command.encode('utf-8'), self.tello_addr)

sonaurea avatar Oct 15 '19 16:10 sonaurea

So looking at the code above: self.left_x = val / 100.0

doe the value passed (val) represent a percent around a circle ? For example if I pass 50, self.left_x is going to be 0.5 (so is that halfway around ?).

I guess I'm trying to figure out to tell it simply: Rotate 180 degrees

mattganis avatar Feb 29 '20 18:02 mattganis

No, I believe it is the speed, you can see it being used in the joystick example in the examples folder. So 100 is max speed turning clockwise, 0 is no speed turning clock wise.

From the official sdk, You can just do this for a 0-360 discrete turn

command = "cw 180"
try:
    self.sock.sendto(command.encode('utf-8'), self.tello_addr)

https://dl-cdn.ryzerobotics.com/downloads/Tello/Tello%20SDK%202.0%20User%20Guide.pdf image

sonaurea avatar Mar 02 '20 14:03 sonaurea