Takeoff_and_land


#1

Hello, I went through the arm_test code that was posted on YouTube and got my drone arming itself through the code. I am currently trying out Script for Autonomous Mission: Takeoff and Land (Navio and PixhawkNow. The problem is when I try to test out the takeoff _and_land.py code nothing happens. When I click enter nothing happens. I ran through the whole code and everyhthing is exactly what was in the video.

This is what is happening when I click enter, it just ignores it

python takeoff_and_land.py --connect /dev/ttyAMA0 I click enter
pi@raspberrypi:-$

nothing happens
Thank you in advance


#2

You are doing this powered with a LiPo, or just with a USB connection? Which code are you using? Did you get it from github? If so, you might need to edit the connect statement as per your setting.


#3

Hey Jax, Lipo everything is hooked up. I got the arm_test.py code to work connecting to my drone from this YouTube video https://www.youtube.com/watch?v=kB9YyG2V-nA and armed my drone from the code. I am using the code from the takeoff and land mission video in the build drone course(not from GitHub but followed the video).

This Is how the beginning of my code looks

from dronekit import connect, VehicleMode, LocationGlobalRelative
import time
import socket
import exceptions
import argparse

def connectMyCopter():
parser = argparse.ArgumentParser(description=‘commands’)
parser.add_argument(’–connect’)
args = parser.parse_args()

 connection_string = args.connect
 baud_rate = 57600

vehicle = connect(connection_string,baud=baud_rate,wait_ready=True)

return vehicle


#4

Could you paste the similar portion of arm_test.py which worked for you? The difference might reveal why there is a connection issue. I assume this is for a Pixhawk build?


#5

Yes.

from dronekit import connect, VehicleMode, LocationGlobalRelative, APIException
import Time
import socket
import exceptions
import math
import argparse

def connectMyCopter():
parser = argparse.ArgumentParser(description=‘commands’)
parser.add_argument(’–connect’)
args = parser.parse_args()

 connection_string = args.connect
 baud_rate = 57600

 vehicle = connect(connection_string,baud=baud_rate, wait_ready=True)
 return vehicle 

def arm():


#6

So essentially the same? Makes it difficult to diagnose over the forum. If you want to send me both files to me I can test myself. jax0623@gmail.com


#7

Hey Jax appreciate thanks, will do. Could you jut help me out , I have been typing In those codes to the forum how would I copy it from VI and paste it somewhere else? (on Windows laptop). Thank you.


#8

I’m not sure how to copy (vim “yank”) to a windows clipboard using vim. I would suggest using nano or gedit.


#9

ok thanks, sent.