This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import time | |
# First get an instance of the API endpoint | |
api = local_connect() | |
# Get the connected vehicle (currently only one vehicle can be returned). | |
v = api.get_vehicles()[0] | |
#wait here until mavproxy tells us to exit | |
while not api.exit: | |
time.sleep(0.2) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# | |
# This example shows how to use DroneKit-Python to change the vehicles altitude | |
# | |
import time | |
from pymavlink import mavutil | |
def process_result(result): | |
if result is None: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
from Adafruit_PWM_Servo_Driver import PWM | |
import time | |
import numpy as np | |
import cv2 | |
import math | |
import sys | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
TODO | |
-Handle user input: | |
-during approach(RTL) and during descent | |
-abort landing to loiter or althold | |
-Allow for a pause before starting descent | |
-slow down on final descent | |
-dont allow for a mode switch out of NO_GPS land if there is no gps |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# | |
# This example shows how to use DroneKit-Python to change the vehicles altitude | |
#Usage: api start ChangeAlt.py | |
from pymavlink import mavutil | |
# First get an instance of the API endpoint | |
api = local_connect() | |
# Get the connected vehicle (currently only one vehicle can be returned). | |
v = api.get_vehicles()[0] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#https://ubuntuforums.org/showthread.php?t=1204739 | |
app = shell | |
srcExt = c | |
srcDir = src | |
objDir = build | |
binDir = . | |
inc = include |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#todo | |
# Implement | |
# how to handle sudo | |
# how to handle readline/buffer with errors | |
class process(): | |
#cmd - bash cmd + args |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import time | |
import types | |
class StateMachine(): | |
def __init__(self): | |
self.states = {} | |
self.start_state = None | |
self.current_state = None | |
self.started = False |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
import rospy | |
import IPython | |
from geometry_msgs.msg import PoseStamped, TwistStamped, Twist, Vector3, Pose | |
from mavros_msgs.msg import PositionTarget, AttitudeTarget, State | |
from mavros_msgs.srv import SetMode, SetModeRequest | |
from std_msgs.msg import Float64 | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import math | |
import time | |
class pos_control: | |
def __init__(self, kP, kI, kD, max_int = 100, max_spd=10): | |
limits = [-math.sqrt(2) * max_spd,math.sqrt(2) * max_spd] | |
self.x_pid = PID(kP, kI, kD, max_int = max_int, limits = limits) | |
self.y_pid = PID(kP, kI, kD, max_int = max_int, limits = limits) |
OlderNewer