viamboatbase

package module
v0.0.0-...-89fcbfa Latest Latest
Warning

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

Go to latest
Published: Sep 12, 2023 License: Apache-2.0 Imports: 19 Imported by: 0

README

viamboatbase

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Model = resource.ModelNamespace("erh").WithFamily("base").WithModel("boat")

Functions

This section is empty.

Types

type Config

type Config struct {
	Motors         []MotorConfig
	LengthMM       float64 `json:"length_mm"`
	WidthMM        float64 `json:"width_mm"`
	MovementSensor string  `json:"movement_sensor"`
}

func (*Config) ComputePower

func (cfg *Config) ComputePower(linear, angular r3.Vector) ([]float64, error)

returns an array of power for each motors forwardPercent: -1 -> 1 percent of power in which you want to move laterally

note only x & y are relevant. y is forward back, x is lateral

angularPercent: -1 -> 1 percent of power you want applied to move angularly

note only z is relevant here

func (*Config) ComputePowerOutput

func (cfg *Config) ComputePowerOutput(powers []float64) motorWeights

func (*Config) ComputePowerOutputAsMatrix

func (cfg *Config) ComputePowerOutputAsMatrix(powers []float64) mat.Dense

func (*Config) Validate

func (cfg *Config) Validate(path string) ([]string, error)

type MotorConfig

type MotorConfig struct {
	Name         string
	XOffsetMM    float64 `json:"x_offset_mm"`
	YOffsetMM    float64 `json:"y_offset_mm"`
	AngleDegrees float64 `json:"angle_degs"` // 0 is thrusting forward, 90 is thrusting to starboard, or positive x
	Weight       float64
}

Directories

Path Synopsis
cmd

Jump to

Keyboard shortcuts

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