Ubuntu 20 + Python3 setup


#21

I just would like to thank you dash for sharing your experience here. Thanks to your information, I just went through the DPP course successfully! Mine was as follows.

$ pip freeze | grep -i mav
MAVProxy==1.8.40
pymavlink==2.4.15

$ pip freeze | grep -i drone
dronekit==2.9.2
dronekit-sitl==3.3.0

As you suggested, what I did was to downgrade pymavlink==2.4.15–>>pymavlink==2.4.8 in the virtual environment and hand over vehicle object to some functions. Since I use a very old laptop (EPSON Endeavor) in which Ubuntu 20.04.2 LTS was already installed, your information helped me a lot!


#22

I tried this with 21.04 but no luck. Got stuck installing prior version of pymavlink.


#23

You are welcome, glad to be of help!


#24

Hey sorry for the late reply. Did you figure it out? Is it still relevant for you?


#25

NBD. 20.04 worked, tried 21.04 just for kicks.


#26

Hi, thank you so much for your help!

I have however been experiencing the following timeout error and have no idea why…

Starting copter simulator (SITL)
SITL already Downloaded and Extracted.
Ready to boot.

Connecting to vehicle on: tcp:127.0.0.1:5760
WARNING:dronekit:Link timeout, no heartbeat in last 5 seconds
ERROR:dronekit.mavlink:Exception in MAVLink input loop
Traceback (most recent call last):
File “/usr/local/lib/python3.8/dist-packages/dronekit/mavlink.py”, line 211, in mavlink_thread_in
fn(self)
File “/usr/local/lib/python3.8/dist-packages/dronekit/init.py”, line 1370, in listener
raise APIException(‘No heartbeat in %s seconds, aborting.’ %
dronekit.APIException: No heartbeat in 30 seconds, aborting.
Traceback (most recent call last):
File “vehicle_state.py”, line 38, in
vehicle = connect(connection_string, wait_ready=True)
File “/usr/local/lib/python3.8/dist-packages/dronekit/init.py”, line 3166, in connect
vehicle.initialize(rate=rate, heartbeat_timeout=heartbeat_timeout)
File “/usr/local/lib/python3.8/dist-packages/dronekit/init.py”, line 2275, in initialize
raise APIException(‘Timeout in initializing connection.’)
dronekit.APIException: Timeout in initializing connection

Any advice would be appreciated


#27

I am running SITL in 20.04 without issue.

I can tell from your other posts you have a better grasp on code than I, so my only take is either you did not install something correctly or you ran the SITL incorrectly.

Is this through the bash launchSitl or sim_vehicle.py ?

Are you in virtualenv ?

If you want to print out your install steps and how you executed the SITL I would be happy to look at it. Maybe list out your bash file too.