Skip to content

Instantly share code, notes, and snippets.

import numpy as np
import cv2
import random
import math
from pymavlink import mavutil
import sys
import time
import tkinter as tk
from PIL import Image, ImageTk
import threading
class JPEGDisplay:
def __init__(self, image_path):
"""Initialize the display window and load the JPEG image.
Args:
def batch_generate(dataset, batch_size=16):
output = []
for i in range(0, len(dataset), batch_size):
batch = dataset[i:i+batch_size]["text"]
model_inputs = tokenizer(
[text for text in batch],
return_tensors="pt",
padding=True,
truncation=True,
#include <HardwareSerial.h>
// Configure DAC pins
const int DAC1_PIN = 25;
const int DAC2_PIN = 26;
// Set voltage range
const float VOLT_RANGE = 3.3;
void setup() {
import pygame
import argparse
import serial
parser = argparse.ArgumentParser(description='channel')
parser.add_argument('-t', "--throttle", type=int, default=0, help='throttle value')
# Initialize Pygame
pygame.init()
import time
import socket
import exceptions
import math
import argparse
from dronekit import connect, VehicleMode, LocationGlobalRelative, APIException
from pymavlink import mavutil
import cv2
import math
from pymavlink import mavutil
import sys
class mission_item:
def __init__(self, l, current, x,y,z):
self.seq = l
self.frame = mavutil.mavlink.MAV_FRAME_GLOBAL_RELATIVE_ALT
self.command = mavutil.mavlink.MAV_CMD_NAV_WAYPOINT
import cv2 as cv
import keyPressModule as kp
from djitellopy import tello
import socket
from threading import Thread
import os
from multiprocessing import Process
from time import sleep
import math
from pymavlink import mavutil
import time
class mission_item:
def __init__(self, l, current, x,y,z):
self.seq = l
self.frame = mavutil.mavlink.MAV_FRAME_GLOBAL_RELATIVE_ALT
self.command = mavutil.mavlink.MAV_CMD_NAV_WAYPOINT