model

package
v0.1.11 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 6, 2026 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Battery

type Battery struct {
	Chemistry     string  `yaml:"chemistry"` // e.g. "Li-ion"
	VoltageV      float64 `yaml:"voltage_v"` // nominal
	MaxCurrentA   float64 `yaml:"max_current_a"`
	CapacityAh    float64 `yaml:"capacity_ah"`
	CRating       float64 `yaml:"c_rating"`
	MaxDischargeA float64 `yaml:"max_discharge_a"`
}

type I2CAddress added in v0.1.7

type I2CAddress uint16

func (*I2CAddress) UnmarshalYAML added in v0.1.7

func (a *I2CAddress) UnmarshalYAML(value *yaml.Node) error

type I2CBus added in v0.1.7

type I2CBus struct {
	Name    string      `yaml:"name"`
	Devices []I2CDevice `yaml:"devices"`
}

type I2CDevice added in v0.1.7

type I2CDevice struct {
	Part       string     `yaml:"part,omitempty"`
	Name       string     `yaml:"name"`
	AddressHex I2CAddress `yaml:"address_hex"`
}

type MCU

type MCU struct {
	Part             string  `yaml:"part,omitempty"`
	Name             string  `yaml:"name"`
	LogicVoltageV    float64 `yaml:"logic_voltage_v"` // usually 3.3 for ESP32
	MaxGPIOCurrentmA float64 `yaml:"max_gpio_current_ma"`
}

type Motor

type Motor struct {
	Part            string  `yaml:"part,omitempty"`
	Name            string  `yaml:"name"`
	Count           int     `yaml:"count"`
	VoltageMinV     float64 `yaml:"voltage_min_v"`
	VoltageMaxV     float64 `yaml:"voltage_max_v"`
	StallCurrentA   float64 `yaml:"stall_current_a"`
	NominalCurrentA float64 `yaml:"nominal_current_a"`
}

type MotorDriver

type MotorDriver struct {
	Part             string  `yaml:"part,omitempty"`
	Name             string  `yaml:"name"`
	MotorSupplyMinV  float64 `yaml:"motor_supply_min_v"`
	MotorSupplyMaxV  float64 `yaml:"motor_supply_max_v"`
	ContinuousPerChA float64 `yaml:"continuous_per_channel_a"`
	PeakPerChA       float64 `yaml:"peak_per_channel_a"`
	Channels         int     `yaml:"channels"`
	LogicVoltageMinV float64 `yaml:"logic_voltage_min_v"`
	LogicVoltageMaxV float64 `yaml:"logic_voltage_max_v"`
}

type PowerSpec

type PowerSpec struct {
	Battery Battery `yaml:"battery"`
	Rail    Rail    `yaml:"logic_rail"` // main logic rail after regulation
}

type Rail

type Rail struct {
	VoltageV    float64 `yaml:"voltage_v"`     // e.g. 5.0
	MaxCurrentA float64 `yaml:"max_current_a"` // regulator output capability
}

type RobotSpec

type RobotSpec struct {
	Name     string      `yaml:"name"`
	Power    PowerSpec   `yaml:"power"`
	Motors   []Motor     `yaml:"motors"`
	Driver   MotorDriver `yaml:"motor_driver"`
	MCU      MCU         `yaml:"mcu"`
	I2CBuses []I2CBus    `yaml:"i2c_buses"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL