mecha10-core 0.8.0

Mecha10 core runtime and foundational types
Documentation
//! Shared actuator message types
//!
//! This module contains common actuator command and status message types.

use crate::messages::Message;
use serde::{Deserialize, Serialize};

#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct Twist {
    pub linear: f32,
    pub angular: f32,
}

impl Message for Twist {}

#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct MotorStatus {
    pub timestamp: u64,
    pub left_motor_rpm: f32,
    pub right_motor_rpm: f32,
    pub battery_voltage: f32,
    pub temperature_c: f32,
}

impl Message for MotorStatus {}

#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct ServoStatus {
    pub timestamp: u64,
    /// Name of the joint this servo drives, e.g. "pan"/"tilt".
    pub joint_name: String,
    /// Commanded joint angle, in radians - matches `JointState.positions`' units.
    pub angle_rad: f32,
    pub pulse_us: u16,
    pub enabled: bool,
}

impl Message for ServoStatus {}