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
#!/usr/bin/env python3 | |
import pyrealsense2 as rs | |
import numpy as np | |
import cv2 | |
import torch | |
from ultralytics import YOLO | |
import rclpy | |
from rclpy.node import Node | |
from geometry_msgs.msg import Twist |
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 pyrealsense2 as rs | |
import numpy as np | |
import cv2 | |
import json # Add import for JSON | |
# Load YOLOv3 model | |
net = cv2.dnn.readNet("yolov3.weights", "yolov3.cfg") | |
layer_names = net.getLayerNames() | |
output_layers = [layer_names[i - 1] for i in net.getUnconnectedOutLayers()] |
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 pyrealsense2 as rs | |
import numpy as np | |
import cv2 | |
# Load YOLOv3 model | |
net = cv2.dnn.readNet("yolov3.weights", "yolov3.cfg") | |
layer_names = net.getLayerNames() | |
output_layers = [layer_names[i - 1] for i in net.getUnconnectedOutLayers()] | |
# Initialize RealSense camera |
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 robotics from 'robotics-dev'; | |
const robotics = require('robotics-dev'); | |
// Define ROS twist movement commands | |
const moveForward = { | |
linear: {x: 0.2, y: 0.0, z: 0.0}, | |
angular: {x: 0.0, y: 0.0, z: 0.0} | |
}; | |
const turnLeft = { | |
linear: {x: 0.0, y: 0.0, z: 0.0}, |
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
// Raspberry Pi Pico | |
// https://datasheets.raspberrypi.org/pico/Pico-R3-A4-Pinout.pdf | |
#elif defined(TARGET_RP2040) || defined(TARGET_RASPBERRY_PI_PICO) | |
#define TOTAL_ANALOG_PINS 4 | |
#define TOTAL_PINS 30 | |
#define VERSION_BLINK_PIN LED_BUILTIN | |
#define IS_PIN_DIGITAL(p) (((p) >= 0 && (p) < 23) || (p) == LED_BUILTIN) | |
#define IS_PIN_ANALOG(p) ((p) >= 26 && (p) < 26 + TOTAL_ANALOG_PINS) | |
#define IS_PIN_PWM(p) digitalPinHasPWM(p) | |
#define IS_PIN_SERVO(p) (IS_PIN_DIGITAL(p) && (p) != LED_BUILTIN) |
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
#!/usr/bin/env python3 | |
import rclpy | |
from rclpy.node import Node | |
from geometry_msgs.msg import Twist | |
import pyrealsense2 as rs | |
import numpy as np | |
class ObstacleAvoidanceRobot(Node): | |
def __init__(self): |
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
print("hello world") |
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
echo "Hello world!" |
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 sys | |
import rclpy | |
from rclpy.node import Node | |
from geometry_msgs.msg import Twist | |
import cv2 | |
import numpy as np | |
import pyrealsense2 as rs | |
from ultralytics import YOLO | |
def check_dependencies(): |
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 pyrealsense2 as rs | |
import numpy as np | |
import cv2 | |
# Load YOLOv3 model | |
net = cv2.dnn.readNet("yolov3.weights", "yolov3.cfg") | |
layer_names = net.getLayerNames() | |
output_layers = [layer_names[i - 1] for i in net.getUnconnectedOutLayers().flatten()] | |
# Load COCO class labels |
NewerOlder