- Configure servo\d_function to RC_IN, one for each channel
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
use bluerobotics_ping::{device::Ping1D, error::PingError}; | |
use tokio_serial::{SerialPort, SerialPortBuilderExt}; | |
#[tokio::main] | |
async fn main() -> Result<(), PingError> { | |
let port = tokio_serial::new("/dev/ttyUSB0", 115200) | |
.open_native_async() | |
.map_err(|e| { | |
eprintln!("Error opening serial port: {}", e); |
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
#include <iostream> | |
#include <fcntl.h> | |
#include <unistd.h> | |
#include <sys/ioctl.h> | |
#include <linux/gpio.h> | |
#include <linux/spi/spidev.h> | |
#include <cstring> | |
#define GPIO_CHIP_PATH "/dev/gpiochip4" | |
#define SPI_DEVICE_PATH "/dev/spidev1.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
use std::error::Error; | |
pub trait AnyHardware { | |
fn as_any(&self) -> &dyn std::any::Any; | |
fn as_any_mut(&mut self) -> &mut dyn std::any::Any; | |
fn as_accelerometer_sensor(&mut self) -> Option<&mut dyn AccelerometerSensor> { | |
None | |
} | |
fn as_gyroscope_sensor(&mut self) -> Option<&mut dyn GyroscopeSensor> { |
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
#include <Arduino.h> | |
#include <WiFi.h> | |
#include <zenoh-pico.h> | |
#define SSID "aaa" | |
#define PASS "aaa" | |
// Client mode values | |
#define MODE "peer" // Change to "peer" or "client" as needed | |
#define CONNECT "" // If empty, it will scout in 'peer' mode |
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
// This code runs in the ESP32S2 | |
#include <Arduino.h> | |
#include <WiFi.h> | |
#include <zenoh-pico.h> | |
#define SSID "ssid" | |
#define PASS "PASS" | |
// Client mode values |
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
multifilesrc location="example.jpeg" ! jpegdec ! videoconvert ! imagefreeze ! videobox ! video/x-raw,format=I420,width=240,height=480,framerate=30/1 ! x264enc ! rtph264pay config-interval=1 pt=96 ! udpsink host=192.168.0.55 port=5600 |
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
extern crate serde; // 1.0.79 | |
#[macro_use] | |
extern crate serde_derive; // 1.0.79 | |
extern crate serde_json; // 1.0.30, features = ["raw_value"] | |
#[derive(Serialize, Deserialize, Debug)] | |
struct DataBlob<'a> { | |
id: &'a str, | |
priority: u8, | |
payload: &'a serde_json::value::RawValue, |
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 QtQuick 2.7 | |
import QtQuick.Controls 2.3 | |
Rectangle { | |
color: "red" | |
anchors.fill: parent | |
AnimatedImage { | |
id: oldFrame | |
source: "https://cdn.pixabay.com/animation/2022/10/11/09/05/09-05-26-529_512.gif" |
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 selenium import webdriver | |
from PIL import Image | |
import time | |
from imageio import imwrite | |
url = "http://blueos-avahi.local" | |
paths = [ | |
'/', | |
'/vehicle/autopilot', |
NewerOlder