This file contains hidden or 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 cv2 | |
| import numpy as np | |
| import os | |
| TARGET_WIDTH = 2048 | |
| TARGET_HEIGHT = 1536 | |
| FOV_WIDTH = 3.54 | |
| FOV_HEIGHT = 2.62 | |
| DPP_HORIZONTAL = FOV_WIDTH/TARGET_WIDTH # Degree/px | |
| DPP_VERTICAL = FOV_HEIGHT/TARGET_HEIGHT # Degree/px |
This file contains hidden or 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 gpiod | |
| import time | |
| from gpiod.line import Direction, Value | |
| PINS = [17, 18, 19, 20, 21] | |
| CHIP = "/dev/gpiochip4" # Path is required in v2 | |
| # Request all pins at once | |
| with gpiod.request_lines( | |
| CHIP, |
This file contains hidden or 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 nicegui import ui | |
| import math | |
| ALT = 0.0 | |
| SVG_SIZE = 200 | |
| CENTER = SVG_SIZE // 2 | |
| RADIUS = SVG_SIZE // 4 # 120 | |
| svg_container = None |
This file contains hidden or 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
| { | |
| "annotations": { | |
| "list": [ | |
| { | |
| "builtIn": 1, | |
| "datasource": { | |
| "type": "grafana", | |
| "uid": "-- Grafana --" | |
| }, | |
| "enable": true, |
This file contains hidden or 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 requests | |
| from datetime import datetime, timedelta | |
| from PIL import Image | |
| import os | |
| # Starting time | |
| start_time = datetime.strptime("20251101_0000", "%Y%m%d_%H%M") | |
| # 20251101_0000 | |
| # Furthest is approximately 89 days from current date |
This file contains hidden or 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 numpy as np | |
| import matplotlib.pyplot as plt | |
| # Parameters for the simulation | |
| max_acceleration = 2 | |
| max_velocity = 4 # max velocity in degrees per second | |
| remaining_angle = 5 # target angle to reach in degrees | |
| time_step = 0.02 # time step for simulation in seconds | |
| acc_ratio = 0.05 # Front and back, (0.01 - 0.99) |
This file contains hidden or 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 xml.etree.ElementTree as ET | |
| import numpy as np | |
| import trimesh | |
| def parse_sdf_to_stl(sdf_path, output_stl): | |
| tree = ET.parse(sdf_path) | |
| root = tree.getroot() | |
| all_meshes = [] | |
This file contains hidden or 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
| def euler_from_quaternion(quaternion): | |
| """ | |
| Converts quaternion (w in last place) to euler roll, pitch, yaw | |
| quaternion = [x, y, z, w] | |
| Bellow should be replaced when porting for ROS 2 Python tf_conversions is done. | |
| """ | |
| x = quaternion.x | |
| y = quaternion.y | |
| z = quaternion.z | |
| w = quaternion.w |
This file contains hidden or 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
| #!/bin/bash | |
| # Set the monitoring duration in seconds | |
| DURATION=300 | |
| # Set the interval between samples in seconds | |
| INTERVAL=1 | |
| # Get the current date and time | |
| CURRENT_DATE=$(date +%Y-%m-%d) |
This file contains hidden or 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
| #!/bin/bash | |
| TOPIC_LIST="list.txt" | |
| echo "" | |
| echo "=== Topic Info Extractor ===" | |
| echo "" | |
| echo "Topic list file: $TOPIC_LIST" | |
| ros2 topic list > $TOPIC_LIST | |
| TOPIC_COUNT=$(cat $TOPIC_LIST | wc -l) |
NewerOlder