English 中文(简体)
副校长: Tello 物体没有属性地址(Tello Ryze Drone PetroOn误差,不能称流功能):
原标题:AttributeError: Tello object has no attribute address (Tello Ryze Drone StreamOn error, unable to call streamon function:)
from djitellopy import tello
import cv2
# Create instances for each Tello drone
drone1 = tello.Tello(ip= 192.168.10.2 )  # Replace with your first Wi-Fi adapter s IP
#drone2 = tello.Tello(ip= 192.168.10.3 )  # Replace with your second Wi-Fi adapter s IP
# ... Add more instances for additional drones

# Connect to drones
drone1.connect()
#drone2.connect()
# ... Connect other drones

# Send commands to drones
# drone1.takeoff()
# drone2.takeoff()
# ... Send other commands

# Clean up
drone1.streamon()



# while True:
#     img = drone1.get_frame_read().frame
#     img = cv2.resize(img, (360, 240))
#     cv2.imshow("results", img)
#     if cv2.waitKey(1) & 0xFF == ord( q ):
#         break

每当我试图称之为“上游”功能时,我就发现这一错误,试图询问“查谟和克什米尔”,但不会给我一个答案。

Traceback (most recent call last):
  File "C:UsersorigiPycharmProjectsDroneProjectvenvInterface.py", line 4, in <module>
    drone1 = tello.Tello(ip= 192.168.10.2 )  # Replace with your first Wi-Fi adapter s IP
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:UsersorigiPycharmProjectsDroneProjectvenvLibsite-packagesdjitellopyenforce_types.py", line 54, in wrapper
    return func(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^
TypeError: Tello.__init__() got an unexpected keyword argument  ip 
Exception ignored in: <function Tello.__del__ at 0x000001FAE5924720>
Traceback (most recent call last):
  File "C:UsersorigiPycharmProjectsDroneProjectvenvLibsite-packagesdjitellopyenforce_types.py", line 54, in wrapper
    return func(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^
  File "C:UsersorigiPycharmProjectsDroneProjectvenvLibsite-packagesdjitellopy	ello.py", line 1028, in __del__
    self.end()
  File "C:UsersorigiPycharmProjectsDroneProjectvenvLibsite-packagesdjitellopyenforce_types.py", line 54, in wrapper
    return func(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^
  File "C:UsersorigiPycharmProjectsDroneProjectvenvLibsite-packagesdjitellopy	ello.py", line 1023, in end
    host = self.address[0]
           ^^^^^^^^^^^^
AttributeError:  Tello  object has no attribute  address 

Process finished with exit code 1

我正在利用多个网络改编器连接多台风ze,但甚至能够打上溪流,为首批1台工作。

第一个计票仪的IP地址,即指定我网络的适应者,因为计票人拥有相同的IP

3. 任何答复都值得赞赏:

问题回答

您的法典中的主要问题不是:AttributeError,而是在构造中的TypeError:

TypeError: Tello.__init__() got an unexpected keyword argument  ip 

You are either using an outdated version of the library, or ChatGPT just hallucinated and generated invalid code. If you take a look at the constructor of the Tello class (here), you can see that it accepts these parameters:

    def __init__(self,
                 host=TELLO_IP,
                 retry_count=RETRY_COUNT,
                 vs_udp=VS_UDP_PORT):

So you should use host instead of ip when creating the Tello instance.





相关问题
Can Django models use MySQL functions?

Is there a way to force Django models to pass a field to a MySQL function every time the model data is read or loaded? To clarify what I mean in SQL, I want the Django model to produce something like ...

An enterprise scheduler for python (like quartz)

I am looking for an enterprise tasks scheduler for python, like quartz is for Java. Requirements: Persistent: if the process restarts or the machine restarts, then all the jobs must stay there and ...

How to remove unique, then duplicate dictionaries in a list?

Given the following list that contains some duplicate and some unique dictionaries, what is the best method to remove unique dictionaries first, then reduce the duplicate dictionaries to single ...

What is suggested seed value to use with random.seed()?

Simple enough question: I m using python random module to generate random integers. I want to know what is the suggested value to use with the random.seed() function? Currently I am letting this ...

How can I make the PyDev editor selectively ignore errors?

I m using PyDev under Eclipse to write some Jython code. I ve got numerous instances where I need to do something like this: import com.work.project.component.client.Interface.ISubInterface as ...

How do I profile `paster serve` s startup time?

Python s paster serve app.ini is taking longer than I would like to be ready for the first request. I know how to profile requests with middleware, but how do I profile the initialization time? I ...

Pragmatically adding give-aways/freebies to an online store

Our business currently has an online store and recently we ve been offering free specials to our customers. Right now, we simply display the special and give the buyer a notice stating we will add the ...

Converting Dictionary to List? [duplicate]

I m trying to convert a Python dictionary into a Python list, in order to perform some calculations. #My dictionary dict = {} dict[ Capital ]="London" dict[ Food ]="Fish&Chips" dict[ 2012 ]="...

热门标签