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 serial | |
import pynmea2 | |
# Open the serial port | |
ser = serial.Serial('/dev/ttyUSB0', 115200) | |
# Read and print the output | |
while True: | |
try: | |
data = ser.readline().decode('ascii', errors='ignore').strip() |
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
from pymavlink import mavutil | |
# Create the connection | |
master = mavutil.mavlink_connection('udpin:0.0.0.0:14540') | |
# Wait a heartbeat before sending commands | |
master.wait_heartbeat() | |
master.mav.command_long_send( | |
master.target_system, |
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 python3 | |
import asyncio | |
from mavsdk import System | |
import mavsdk.mission_raw | |
async def run(): | |
drone = System() |
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 python3 | |
import rospy | |
from std_msgs.msg import String | |
from sensor_msgs.msg import NavSatFix | |
from mavros_msgs.msg import * | |
from mavros_msgs.srv import * | |
def create_waypoint(): |
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 mavsdk | |
import asyncio | |
from mavsdk import mocap | |
from mavsdk import System | |
from mavsdk.mocap import (Odometry) | |
initial = time.time() |
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 serial | |
import pynmea2 | |
serialPort = serial.Serial("/dev/ttyUSB0", 9600, timeout=0.5) | |
def parseGPS(str): | |
if str.find("GPGGA") > 0: | |
msg = pynmea2.parse(str) | |
print (msg) | |
print ("Timestamp: %s -- Lat: %s %s -- Lon: %s %s -- Altitude: %s %s" % (msg.timestamp,msg.lat,msg.lat_dir,msg.lon,msg.lon_dir,msg.altitude,msg.altitude_units)) |
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
//Adding Libraries | |
#include <Servo.h> | |
//Pin Numbers | |
int led_1pin = 13; | |
int led_2pin = 2; | |
Servo servo1; // create servo object to control a servo | |
int val = 45; | |
int val2 = 170; |
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
//5 DOF Manipulator | |
// FARHANG NADERI | |
// 2019 Robotics Advanced Course | |
#include <Servo.h> | |
//Servo initiation | |
Servo servo1; | |
Servo servo2; | |
Servo servo3; |