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 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 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 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 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 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 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 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 |
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 pyrealsense2 as rs | |
import numpy as np | |
import cv2 | |
import requests | |
import http.client | |
import json | |
# Configure depth and color streams | |
pipeline = rs.pipeline() | |
config = rs.config() |
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
root@1c61c6f03539:/opt/ros/humble/share/realsense2_camera/launch# ros2 launch realsense2_camera rs_launch.py | |
[INFO] [launch]: All log files can be found below /root/.ros/log/2024-03-29-20-10-16-331349-1c61c6f03539-3984 | |
[INFO] [launch]: Default logging verbosity is set to INFO | |
[INFO] [realsense2_camera_node-1]: process started with pid [3985] | |
[realsense2_camera_node-1] [INFO] [1711743016.484734986] [camera.camera]: RealSense ROS v4.54.1 | |
[realsense2_camera_node-1] [INFO] [1711743016.484882040] [camera.camera]: Built with LibRealSense v2.54.1 | |
[realsense2_camera_node-1] [INFO] [1711743016.484907207] [camera.camera]: Running with LibRealSense v2.54.1 | |
[realsense2_camera_node-1] 29/03 20:10:16,486 ERROR [140732102732000] (librealsense-exception.h:52) Cannot identify '/dev/video0 Last Error: No such file or directory | |
[realsense2_camera_node-1] 29/03 20:10:16,486 ERROR [140732102732000] (librealsense-exception.h:52) Cannot identify '/dev/video1 Last Error: No such file or directory | |
[realsense2_camera_node-1] 29/03 |
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 network | |
from time import sleep | |
import machine | |
from picozero import LED | |
from picozero import Button | |
import requests | |
import utime | |
blue = LED(13) |
NewerOlder