dronekit / dronekit-python

DroneKit-Python library for communicating with Drones via MAVLink.
https://readthedocs.org/projects/dronekit-python/
Apache License 2.0
1.5k stars 1.42k forks source link

problem with the heartbeat #1201

Closed naorwaiss closed 7 months ago

naorwaiss commented 11 months ago

/home/fhsbs/.virtualenvs/pythonProject2/bin/python /tmp/pycharm_project_173/test.py WARNING:dronekit:Link timeout, no heartbeat in last 5 seconds

i onley try to start this code:

rom dronekit import connect, VehicleMode import time

Connect to the simulator running on the local machine

connection_string = "/dev/ttyTHS1" vehicle = connect(connection_string, wait_ready=True)

def check_armable(): while not vehicle.is_armable: print("Waiting for GPS and armability...") time.sleep(1)

print("Vehicle is armable")

def main(): check_armable()

# The rest of your code here
# arm_and_takeoff(target_altitude)
# ... other code ...

if name == "main": main()

i use python 3.9.12 at my jetson nano dronekit 2.9.2 dronekit-sitl 3.3.0 exceptiongroup 1.1.2 future 0.18.3 gpxpy 1.5.0 idna 3.4 iniconfig 2.0.0 jmespath 1.0.1 lxml 4.9.3 marshmallow 3.17.0 MAVProxy 1.8.65

another things... i try to activate the simulation - dronekit-sitl but it didnt gave me to start the simulation... mabey i need another python verson ??

ShafiqSadat commented 7 months ago

Use ArduPilot SITL for simulation!

sim_vehicle.py -v ArduCopter --out=udp:192.168.1.12:14551

and for dronekit

connection_string = "udpin:0.0.0.0:14551" vehicle = connect(connection_string, wait_ready=True)

hamishwillee commented 7 months ago

Thanks @ShafiqSadat - marking this as closed.

That said, this may also be a PYthon issue. Support for Python 3 is only very basic.