Connecting python script to SITL drone


#1

Hello everyone :slight_smile:

I’m currently stuck om trying to connect the connection_template.py with the SITL drone. I’ve made the script to match as shown in the course, and launched the sim_vehicle.py before running the python script. However, after running the script this is all i got :


as you can see, it it does not return me the >>APM and >>FRAME like shown in the video. However i got no heartbeat warning so I know it is connected to the SITL drone, just not returning me the APM version and frame type. Anything I can do to resolve this? thanks in advance!


#2

Hi there @AgastyaB!

This is a good question.

It appears newer versions of ArduPilot or Pymavlink/mavproxy aren’t writing out vehicle information automatically to the console, as previous versions had.

The absence of the connection error/timeout is indicative of a successful dronekit connection, so you should be good to go!


#3

Do someone understand why i get an invalid syntax?

Thanks beforehand!


#4

Hey there,

Try removing the space between “connection_string” and the “=” sign. The syntax error should disappear. Also remove the space between the “=” and “args.connect”. This should solve the issue.

Thanks

Jash


#5

There is a missing closed parenthesis