Documentation ¶
Overview ¶
Created by Michael Dysart
Created by Michael Dysart
Index ¶
- type Config
- type Roboclaw
- func (r *Roboclaw) BackwardM1(address uint8, speed uint8) error
- func (r *Roboclaw) BackwardM2(address uint8, speed uint8) error
- func (r *Roboclaw) BackwardMixed(address uint8, speed uint8) error
- func (r *Roboclaw) Close() error
- func (r *Roboclaw) DutyAccelM1(address uint8, duty int16, accel uint32) error
- func (r *Roboclaw) DutyAccelM1M2(address uint8, duty1 int16, accel1 uint32, duty2 int16, accel2 uint32) error
- func (r *Roboclaw) DutyAccelM2(address uint8, duty int16, accel uint32) error
- func (r *Roboclaw) DutyM1(address uint8, duty int16) error
- func (r *Roboclaw) DutyM1M2(address uint8, duty1 int16, duty2 int16) error
- func (r *Roboclaw) DutyM2(address uint8, duty int16) error
- func (r *Roboclaw) ForwardBackwardM1(address uint8, speed uint8) error
- func (r *Roboclaw) ForwardBackwardM2(address uint8, speed uint8) error
- func (r *Roboclaw) ForwardBackwardMixed(address uint8, speed uint8) error
- func (r *Roboclaw) ForwardM1(address uint8, speed uint8) error
- func (r *Roboclaw) ForwardM2(address uint8, speed uint8) error
- func (r *Roboclaw) ForwardMixed(address uint8, speed uint8) error
- func (r *Roboclaw) GetConfig(address uint8) (uint16, error)
- func (r *Roboclaw) GetDeadBand(address uint8) (uint8, uint8, error)
- func (r *Roboclaw) GetPWMMode(address uint8) (uint8, error)
- func (r *Roboclaw) GetPinFunctions(address uint8) (uint8, uint8, uint8, error)
- func (r *Roboclaw) LeftRightMixed(address uint8, speed uint8) error
- func (r *Roboclaw) ReadBuffers(address uint8) (uint8, uint8, error)
- func (r *Roboclaw) ReadCTRL12(address uint8) (uint16, uint16, error)
- func (r *Roboclaw) ReadCTRLMode(address uint8) (uint8, uint8, error)
- func (r *Roboclaw) ReadCurrents(address uint8) (int16, int16, error)
- func (r *Roboclaw) ReadDefaultAcceleration(address uint8) (uint32, uint32, error)
- func (r *Roboclaw) ReadEncM1(address uint8) (uint32, uint8, error)
- func (r *Roboclaw) ReadEncM2(address uint8) (uint32, uint8, error)
- func (r *Roboclaw) ReadEncoderModes(address uint8) (uint8, uint8, error)
- func (r *Roboclaw) ReadEncoders(address uint8) (uint32, uint32, error)
- func (r *Roboclaw) ReadError(address uint8) (uint32, error)
- func (r *Roboclaw) ReadISpeedM1(address uint8) (uint32, uint8, error)
- func (r *Roboclaw) ReadISpeedM2(address uint8) (uint32, uint8, error)
- func (r *Roboclaw) ReadISpeeds(address uint8) (uint32, uint32, error)
- func (r *Roboclaw) ReadLogicBatteryVoltage(address uint8) (uint16, error)
- func (r *Roboclaw) ReadM1MaxCurrent(address uint8) (uint32, error)
- func (r *Roboclaw) ReadM1PositionPID(address uint8) (float32, float32, float32, uint32, uint32, uint32, uint32, error)
- func (r *Roboclaw) ReadM1VelocityPID(address uint8) (float32, float32, float32, uint32, error)
- func (r *Roboclaw) ReadM2MaxCurrent(address uint8) (uint32, error)
- func (r *Roboclaw) ReadM2PositionPID(address uint8) (float32, float32, float32, uint32, uint32, uint32, uint32, error)
- func (r *Roboclaw) ReadM2VelocityPID(address uint8) (float32, float32, float32, uint32, error)
- func (r *Roboclaw) ReadMainBatteryVoltage(address uint8) (uint16, error)
- func (r *Roboclaw) ReadMinMaxLogicVoltages(address uint8) (uint16, uint16, error)
- func (r *Roboclaw) ReadMinMaxMainVoltages(address uint8) (uint16, uint16, error)
- func (r *Roboclaw) ReadNVM(address uint8) (uint8, uint8, error)
- func (r *Roboclaw) ReadPWMs(address uint8) (int16, int16, error)
- func (r *Roboclaw) ReadSpeedM1(address uint8) (uint32, uint8, error)
- func (r *Roboclaw) ReadSpeedM2(address uint8) (uint32, uint8, error)
- func (r *Roboclaw) ReadTemp(address uint8) (uint16, error)
- func (r *Roboclaw) ReadTemp2(address uint8) (uint16, error)
- func (r *Roboclaw) ReadVersion(address uint8) (string, error)
- func (r *Roboclaw) ResetEncoders(address uint8) error
- func (r *Roboclaw) RestoreDefaults(address uint8) error
- func (r *Roboclaw) SetCTRL1(address uint8, value uint16) error
- func (r *Roboclaw) SetCTRL2(address uint8, value uint16) error
- func (r *Roboclaw) SetCTRLMode(address uint8, ctrl1 uint8, ctrl2 uint8) error
- func (r *Roboclaw) SetConfig(address uint8, config uint16) error
- func (r *Roboclaw) SetDeadBand(address uint8, Min uint8, Max uint8) error
- func (r *Roboclaw) SetEncM1(address uint8, val int32) error
- func (r *Roboclaw) SetEncM2(address uint8, val int32) error
- func (r *Roboclaw) SetLogicVoltages(address uint8, min uint16, max uint16) error
- func (r *Roboclaw) SetM1DefaultAccel(address uint8, accel uint32) error
- func (r *Roboclaw) SetM1EncoderMode(address uint8, mode uint8) error
- func (r *Roboclaw) SetM1MaxCurrent(address uint8, max uint32) error
- func (r *Roboclaw) SetM1PositionPID(address uint8, kp_fp float32, ki_fp float32, kd_fp float32, kiMax uint32, ...) error
- func (r *Roboclaw) SetM1VelocityPID(address uint8, kp_fp float32, ki_fp float32, kd_fp float32, qpps uint32) error
- func (r *Roboclaw) SetM2DefaultAccel(address uint8, accel uint32) error
- func (r *Roboclaw) SetM2EncoderMode(address uint8, mode uint8) error
- func (r *Roboclaw) SetM2MaxCurrent(address uint8, max uint32) error
- func (r *Roboclaw) SetM2PositionPID(address uint8, kp_fp float32, ki_fp float32, kd_fp float32, kiMax uint32, ...) error
- func (r *Roboclaw) SetM2VelocityPID(address uint8, kp_fp float32, ki_fp float32, kd_fp float32, qpps uint32) error
- func (r *Roboclaw) SetMainVoltages(address uint8, min uint16, max uint16) error
- func (r *Roboclaw) SetMaxVoltageLogicBattery(address uint8, voltage uint8) error
- func (r *Roboclaw) SetMaxVoltageMainBattery(address uint8, voltage uint8) error
- func (r *Roboclaw) SetMinVoltageLogicBattery(address uint8, voltage uint8) error
- func (r *Roboclaw) SetMinVoltageMainBattery(address uint8, voltage uint8) error
- func (r *Roboclaw) SetPWMMode(address uint8, mode uint8) error
- func (r *Roboclaw) SetPinFunctions(address uint8, s3mode uint8, s4mode uint8, s5mode uint8) error
- func (r *Roboclaw) SpeedAccelDeccelPositionM1(address uint8, accel uint32, speed int32, deccel uint32, position uint32, ...) error
- func (r *Roboclaw) SpeedAccelDeccelPositionM1M2(address uint8, accel1 uint32, speed1 int32, deccel1 uint32, position1 uint32, ...) error
- func (r *Roboclaw) SpeedAccelDeccelPositionM2(address uint8, accel uint32, speed int32, deccel uint32, position uint32, ...) error
- func (r *Roboclaw) SpeedAccelDistanceM1(address uint8, accel uint32, speed int32, distance uint32, buffer bool) error
- func (r *Roboclaw) SpeedAccelDistanceM1M2(address uint8, accel uint32, speed1 int32, distance1 uint32, speed2 int32, ...) error
- func (r *Roboclaw) SpeedAccelDistanceM1M2_2(address uint8, accel1 uint32, speed1 int32, distance1 uint32, accel2 uint32, ...) error
- func (r *Roboclaw) SpeedAccelDistanceM2(address uint8, accel uint32, speed int32, distance uint32, buffer bool) error
- func (r *Roboclaw) SpeedAccelM1(address uint8, accel uint32, speed int32) error
- func (r *Roboclaw) SpeedAccelM1M2(address uint8, accel uint32, speed1 int32, speed2 int32) error
- func (r *Roboclaw) SpeedAccelM1M2_2(address uint8, accel1 uint32, speed1 int32, accel2 uint32, speed2 int32) error
- func (r *Roboclaw) SpeedAccelM2(address uint8, accel uint32, speed int32) error
- func (r *Roboclaw) SpeedDistanceM1(address uint8, speed int32, distance uint32, buffer bool) error
- func (r *Roboclaw) SpeedDistanceM1M2(address uint8, speed1 int32, distance1 uint32, speed2 int32, distance2 uint32, ...) error
- func (r *Roboclaw) SpeedDistanceM2(address uint8, speed int32, distance uint32, buffer bool) error
- func (r *Roboclaw) SpeedM1(address uint8, speed int32) error
- func (r *Roboclaw) SpeedM1M2(address uint8, speed1 int32, speed2 int32) error
- func (r *Roboclaw) SpeedM2(address uint8, speed int32) error
- func (r *Roboclaw) TurnLeftMixed(address uint8, speed uint8) error
- func (r *Roboclaw) TurnRightMixed(address uint8, speed uint8) error
- func (r *Roboclaw) WriteNVM(address uint8) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Roboclaw ¶
type Roboclaw struct {
// contains filtered or unexported fields
}
A structure for describing the roboclaw interface
func Init ¶
* Initialize the roboclaw with the desired serial port * @param rc (&Config) the roboclaw config struct * @returns (*Roboclaw, error) the reference to the roboclaw and any errors that occur when opening the file
func (*Roboclaw) BackwardM1 ¶
* Drive motor 1 backwards * @param address {uint8} * @param speed {uint8} valid data is 0 to 127 * @return {error}
func (*Roboclaw) BackwardM2 ¶
* Drive motor 2 backwards * @param address {uint8} * @param speed {uint8} valid data is 0 to 127 * @return {error}
func (*Roboclaw) BackwardMixed ¶
* Drive motors backward in mixed mode * @param address {uint8} * @param speed {uint8} valid data is 0 to 127 (0 stop, 127 full speed) * @return {error}
func (*Roboclaw) DutyAccelM1 ¶
* Drive motor 1 with duty and acceleration * @param address {uint8} * @param duty {int16} * @param accel {uint32} the acceleration. Valid data from 0 to 655359 (-100% to 100% in 100ms) * @return {error}
func (*Roboclaw) DutyAccelM1M2 ¶
func (r *Roboclaw) DutyAccelM1M2(address uint8, duty1 int16, accel1 uint32, duty2 int16, accel2 uint32) error
* Drive motors 1 and 2 with duty and acceleration * @param address {uint8} * @param duty1 {int16} * @param accel1 {uint32} the acceleration. Valid data from 0 to 655359 (-100% to 100% in 100ms) * @param duty2 {int16} * @param accel2 {uint32} the acceleration. Valid data from 0 to 655359 (-100% to 100% in 100ms) * @return {error}
func (*Roboclaw) DutyAccelM2 ¶
* Drive motor 2 with duty and acceleration * @param address {uint8} * @param duty {int16} * @param accel {uint32} the acceleration. Valid data from 0 to 655359 (-100% to 100% in 100ms) * @return {error}
func (*Roboclaw) DutyM1 ¶
* Drive motor 1 in duty cycle mode * Values represent +/- 100% duty * @param address {uint8} * @param duty {int16} * @return {error}
func (*Roboclaw) DutyM1M2 ¶
* Drive motor 1 and 2 in duty cycle mode * Values represent +/- 100% duty * @param address {uint8} * @param duty1 {int16} * @param duty2 {int16} * @return {error}
func (*Roboclaw) DutyM2 ¶
* Drive motor 2 in duty cycle mode * Values represent +/- 100% duty * @param address {uint8} * @param duty {int16} * @return {error}
func (*Roboclaw) ForwardBackwardM1 ¶
* Drive motor 1 forward or backward * @param address {uint8} * @param speed {uint8} valid data is 0 to 127 (0 full reverse, 64 stop, 127 full forward) * @return {error}
func (*Roboclaw) ForwardBackwardM2 ¶
* Drive motor 2 forward or backward * @param address {uint8} * @param speed {uint8} valid data is 0 to 127 (0 full reverse, 64 stop, 127 full forward) * @return {error}
func (*Roboclaw) ForwardBackwardMixed ¶
* Drive forward or backward in mixed mode * @param address {uint8} * @param speed {uint8} valid data is 0 to 127 (0 full speed backward, 0 stop, 127 full forward) * @return {error}
func (*Roboclaw) ForwardM1 ¶
* Drive motor 1 forwards * @param address {uint8} * @param speed {uint8} valid data is 0 to 127 * @return {error}
func (*Roboclaw) ForwardM2 ¶
* Drive motor 2 forwards * @param address {uint8} * @param speed {uint8} valid data is 0 to 127 * @return {error}
func (*Roboclaw) ForwardMixed ¶
* Drive motors forward in mixed mode * @param address {uint8} * @param speed {uint8} valid data is 0 to 127 (0 stop, 127 full speed) * @return {error}
func (*Roboclaw) GetConfig ¶
* Read config settings * @param address {uint8} * @return {uint16, error} settings, error
func (*Roboclaw) GetDeadBand ¶
* Read deadband for RC/Analog control * RC/Analog mode control in 10th of a percent * @param address {uint8} * @return {uint8, uint8, error} min, max, error
func (*Roboclaw) GetPWMMode ¶
* Read PWM mode * @param address {uint8} * @return {uint8, error} mode, error
func (*Roboclaw) GetPinFunctions ¶
* Read the pin modes * @param address {uint8} * @return {uint8, uint8, uint8, error} s3 mode, s4 mode, s5 mode, error
func (*Roboclaw) LeftRightMixed ¶
* Turn in mixed mode * @param address {uint8} * @param speed {uint8} valid data is 0 to 127 (0 full speed left, 0 stop, 127 full right) * @return {error}
func (*Roboclaw) ReadBuffers ¶
* Read buffer lengths * Maximum length is 64, * A value of 128 means that the buffer is empty and all commands are finished * A value of 0 means that the last command is executing * @param address {uint8} * @return {uint8, uint8, error} buffer 1 length, buffer 2 length, error
func (*Roboclaw) ReadCTRL12 ¶
* Read CTRL value settings * @param address {uint8} * @return {uint16, uint16, error} ctrl1, ctrl2, error
func (*Roboclaw) ReadCTRLMode ¶
* Read CTRL modes (only certain models) * @param address {uint8} * @return {uint8, uint8, error} ctrl 1 mode, ctrl 2 mode, error
func (*Roboclaw) ReadCurrents ¶
* Read currents * Values in 10 mA increments * Divide by 100 to get A * @param address {uint8} * @return {int16, int16, error} m1 current, m2 current, error
func (*Roboclaw) ReadDefaultAcceleration ¶
* Read the default acceleration values * @param address {uint8} * @return {uint32, uint32, error} acceleration m1, acceleration m2, error
func (*Roboclaw) ReadEncM1 ¶
* Read the encoder count for m1 * @param address {uint8} * @return {uint32, uint8, error} encoder count, encoder status, error
func (*Roboclaw) ReadEncM2 ¶
* Read the encoder count for m2 * @param address {uint8} * @return {uint32, uint8, error} encoder count, encoder status, error
func (*Roboclaw) ReadEncoderModes ¶
* Read encoder modes * @param address {uint8} * @return {uint8, uint8, error} encode 1 mode, encoder 2 mode, error
func (*Roboclaw) ReadEncoders ¶
* Read encoder counters * @param address {uint8} * @return {uint32, uint32, error} encoder 1 counter, encoder 2 counter, error
func (*Roboclaw) ReadError ¶
* Read any statuses from the roboclaw * The reference manual says that the status is a 16 bit int, * but recently the roboclaws have been returning a 32 bit int * This probably occurred due to a firmware update, though * I have not yet found where it is documented * @param address {uint8} * @return {uint16, error} address, error
func (*Roboclaw) ReadISpeedM1 ¶
* Read raw speed for motor 1 * Pulses counted in last 300th of a second, but returned as encoder counts per second * Direction is 0 for forward and 1 for backward * @param address {uint8} * @return {uint32, uint8, error} speed, direction, error
func (*Roboclaw) ReadISpeedM2 ¶
* Read raw speed for motor 2 * Pulses counted in last 300th of a second, but returned as encoder counts per second * Direction is 0 for forward and 1 for backward * @param address {uint8} * @return {uint32, uint8, error} speed, direction, error
func (*Roboclaw) ReadISpeeds ¶
* Read instantaneous speed * Speed is in counter per second measured over last 300th of a second * @param address {uint8} * @return {uint32, uint32, error} speed encoder 1, speed encoder 2 , error
func (*Roboclaw) ReadLogicBatteryVoltage ¶
* Read the logic battery voltage (connected to LB+ and LB- terminals) * @param address {uint8} * @return {uint16, error} voltage is returned in 10ths of a volt
func (*Roboclaw) ReadM1MaxCurrent ¶
* Read m1 max current * Current in in 10 mA units * @param address {uint8} * @return {uint32, error} max current, error
func (*Roboclaw) ReadM1PositionPID ¶
func (r *Roboclaw) ReadM1PositionPID(address uint8) (float32, float32, float32, uint32, uint32, uint32, uint32, error)
* Read position PID constants for motor 2 * @param address {uint8} * @return {float32, float32, float32, uint32, uint32, uint32, uint32, error} proportional, integral, derivative, max integral windup, min position, max position, error
func (*Roboclaw) ReadM1VelocityPID ¶
* Read motor 1 PID and QPPS * @param address {uint8} * @return {float32, float32, float32, uint32, error} proportional, integral, derivative, qpps, error
func (*Roboclaw) ReadM2MaxCurrent ¶
* Read m2 max current * Current in in 10 mA units * @param address {uint8} * @return {uint32, error} max current, error
func (*Roboclaw) ReadM2PositionPID ¶
func (r *Roboclaw) ReadM2PositionPID(address uint8) (float32, float32, float32, uint32, uint32, uint32, uint32, error)
* Read position PID constants for motor 2 * @param address {uint8} * @return {float32, float32, float32, uint32, uint32, uint32, uint32, error} proportional, integral, derivative, max integral windup, min position, max position, error
func (*Roboclaw) ReadM2VelocityPID ¶
* Read motor 2 PID and QPPS * @param address {uint8} * @return {float32, float32, float32, uint32, error} proportional, integral, derivative, qpps, error
func (*Roboclaw) ReadMainBatteryVoltage ¶
* Read the main battery voltage (connected to B+ and B- terminals) * @param address {uint8} * @return {uint16, error} voltage is returned in 10ths of a volt
func (*Roboclaw) ReadMinMaxLogicVoltages ¶
* Reads min and max logic battery voltage * Voltages are in mV * @param address {uint8} * @return {uint16, uint16, error} min, max, error
func (*Roboclaw) ReadMinMaxMainVoltages ¶
* Reads min and max main battery voltage * Voltages are in mV * @param address {uint8} * @return {uint16, uint16, error} min, max, error
func (*Roboclaw) ReadNVM ¶
* Read settings from non-volatile memory * @param address {uint8} * @return {uint8, uint8, error} encoder 1 mode, encoder 2 mode, error
func (*Roboclaw) ReadPWMs ¶
* Read pwm values * PWM values are +/- 32767 * Divide by 327.67 to get duty cycle percent * @param address {uint8} * @return {int16, int16, error} m1 pwm, m2 pwm, error
func (*Roboclaw) ReadSpeedM1 ¶
* Read the encoder speed for m1 * Speed is in pulses per second * Direction is 0 for forward and 1 for backward * @param address {uint8} * @return {uint32, uint8, error} encoder speed, direction, error
func (*Roboclaw) ReadSpeedM2 ¶
* Read the encoder speed for m2 * Speed is in pulses per second * Direction is 0 for forward and 1 for backward * @param address {uint8} * @return {uint32, uint8, error} encoder speed, direction, error
func (*Roboclaw) ReadTemp ¶
* Restore board temperature * Value is in 10th of a degree * @param address {uint8} * @return {error} temp, error
func (*Roboclaw) ReadTemp2 ¶
* Read second board temperature (only on certain devices) * Value is in 10th of a degree * @param address {uint8} * @return {uint16, error} temp, error
func (*Roboclaw) ReadVersion ¶
* Read the roboclaw version * @param address {uint8} * @return {string, error}
func (*Roboclaw) ResetEncoders ¶
* Reset encoder counters to 0 (for quadrature encoders) * @param address {uint8} * @return {error}
func (*Roboclaw) RestoreDefaults ¶
* Restore default values * @param address {uint8} * @return {error}
func (*Roboclaw) SetCTRL1 ¶
* Set CTRL1 output value (only certain models) * @param address {uint8} * @param value {uint16} * @return {error}
func (*Roboclaw) SetCTRL2 ¶
* Set CTRL2 output value (only certain models) * @param address {uint8} * @param value {uint16} * @return {error}
func (*Roboclaw) SetCTRLMode ¶
* Set CTRL mode (only certain models) * NOTE: This function is not properly documented in the user manual * Based on command 101 I have tried to infer the correct command codes * @param address {uint8} * @param ctrl1 {uint8} * @param ctrl2 {uint8} * @return {error}
func (*Roboclaw) SetConfig ¶
* Set config settings * @param address {uint8} * @param config {uint16} * @return {error}
func (*Roboclaw) SetDeadBand ¶
* Set deadband for RC/Analog control * RC/Analog mode control in 10th of a percent * @param address {uint8} * @param Min {uint8} valid data 0 - 250 (0 to 25%) * @param Max {uint8} valid data 0 - 250 (0 to 25%) * @return {error}
func (*Roboclaw) SetEncM1 ¶
* Set encoder 1 counter to 0 (for quadrature encoders) * @param address {uint8} * @param val {int32} * @return {error}
func (*Roboclaw) SetEncM2 ¶
* Set encoder 2 counter to 0 (for quadrature encoders) * @param address {uint8} * @param val {int32} * @return {error}
func (*Roboclaw) SetLogicVoltages ¶
* Sets the minimum and maximum logic battery voltage * @param address {uint8} * @param min {uint16} Values in 10th of a volt * @param max {uint16} Values in 10th of a volt * @return {error}
func (*Roboclaw) SetM1DefaultAccel ¶
* Sets the default accelaration for duty cycle commands with motor 1 * @param address {uint8} * @param accel {uint32} * @return {error}
func (*Roboclaw) SetM1EncoderMode ¶
* Set motor 1 encoder mode * @param address {uint8} * @param mode {uint8} * @return {error}
func (*Roboclaw) SetM1MaxCurrent ¶
* Set m1 max current * @param address {uint8} * @param max {uint32} the maximum current in 10 mA units * @return {error}
func (*Roboclaw) SetM1PositionPID ¶
func (r *Roboclaw) SetM1PositionPID(address uint8, kp_fp float32, ki_fp float32, kd_fp float32, kiMax uint32, deadzone uint32, min uint32, max uint32) error
* Set position PID constants for motor 1 * @param address {uint8} * @param kp_fp {float32} proportional constant. valid data from 0 to 4194304 * @param ki_fp {float32} integral constant. valid data from 0 to 4194304 * @param kd_fp {float32} derivative constant. valid data from 0 to 4194304 * @param kiMax {uint32} maximum integral windup * @param deadzone {uint32} encoder counts deadzone * @param min {uint32} minimum position * @param max {uint32} maximum position * @return {error}
func (*Roboclaw) SetM1VelocityPID ¶
func (r *Roboclaw) SetM1VelocityPID(address uint8, kp_fp float32, ki_fp float32, kd_fp float32, qpps uint32) error
* Set velocity PID constant for motor 1 * @param address {uint8} * @param kp_fp {float32} proportional constant. valid data from 0 to 65536 * @param ki_fp {float32} integral constant. valid data from 0 to 65536 * @param kd_fp {float32} derivative constant. valid data from 0 to 65536 * @param qpps {uint32} speed of encoder when motor is at 100 % * @return {error}
func (*Roboclaw) SetM2DefaultAccel ¶
* Sets the default accelaration for duty cycle commands with motor 2 * @param address {uint8} * @param accel {uint32} * @return {error}
func (*Roboclaw) SetM2EncoderMode ¶
* Set motor 2 encoder mode * @param address {uint8} * @param mode {uint8} * @return {error}
func (*Roboclaw) SetM2MaxCurrent ¶
* Set m2 max current * @param address {uint8} * @param max {uint32} the maximum current in 10 mA units * @return {error}
func (*Roboclaw) SetM2PositionPID ¶
func (r *Roboclaw) SetM2PositionPID(address uint8, kp_fp float32, ki_fp float32, kd_fp float32, kiMax uint32, deadzone uint32, min uint32, max uint32) error
* Set position PID constants for motor 2 * @param address {uint8} * @param kp_fp {float32} proportional constant. valid data from 0 to 4194304 * @param ki_fp {float32} integral constant. valid data from 0 to 4194304 * @param kd_fp {float32} derivative constant. valid data from 0 to 4194304 * @param kiMax {uint32} maximum integral windup * @param deadzone {uint32} encoder counts deadzone * @param min {uint32} minimum position * @param max {uint32} maximum position * @return {error}
func (*Roboclaw) SetM2VelocityPID ¶
func (r *Roboclaw) SetM2VelocityPID(address uint8, kp_fp float32, ki_fp float32, kd_fp float32, qpps uint32) error
* Set velocity PID constant for motor 2 * @param address {uint8} * @param kp_fp {float32} proportional constant. valid data from 0 to 65536 * @param ki_fp {float32} integral constant. valid data from 0 to 65536 * @param kd_fp {float32} derivative constant. valid data from 0 to 65536 * @param qpps {uint32} speed of encoder when motor is at 100 % * @return {error}
func (*Roboclaw) SetMainVoltages ¶
* Sets the minimum and maximum main battery voltage * @param address {uint8} * @param min {uint16} Values in 10th of a volt * @param max {uint16} Values in 10th of a volt * @return {error}
func (*Roboclaw) SetMaxVoltageLogicBattery ¶
* Sets the maximum logic battery voltage * Volts are Desired volts * 5.12 * @param address {uint8} * @param voltage {uint8} valid data from 30 - 175 (6V to 34V) * @return {error}
func (*Roboclaw) SetMaxVoltageMainBattery ¶
* Sets maximum main voltage (command 57 preferred) * Roboclaw shuts down if voltage drops below this point * Volts are Desired volts * 5.12 * @param address {uint8} * @param voltage {uint8} valid data is 30 to 175 (6V to 34 V) * @return {error}
func (*Roboclaw) SetMinVoltageLogicBattery ¶
* Sets the minimum logic battery voltage * Volts are (Desired volts - 6) * 5 * @param address {uint8} * @param voltage {uint8} valid data from 0 - 140 (6V to 34V) * @return {error}
func (*Roboclaw) SetMinVoltageMainBattery ¶
* Sets minimum main voltage (command 57 preferred) * Roboclaw shuts down if voltage drops below this point * Volts are (Desired volts - 6) * 5 * @param address {uint8} * @param voltage {uint8} valid data is 0 to 140 (6V to 34 V) * @return {error}
func (*Roboclaw) SetPWMMode ¶
* Set PWM mode * @param address {uint8} * @param mode {uint8} valid values are 0 and 1 * @return {error}
func (*Roboclaw) SetPinFunctions ¶
* Sets the pin modes * @param address {uint8} * @param s3mode {uint8} valid data 0 - 4 * @param s4mode {uint8} valid data 0 - 4 * @param s5mode {uint8} valid data 0 - 4 * @return {error}
func (*Roboclaw) SpeedAccelDeccelPositionM1 ¶
func (r *Roboclaw) SpeedAccelDeccelPositionM1(address uint8, accel uint32, speed int32, deccel uint32, position uint32, buffer bool) error
* Drive motor 1 with acceleration and speed * @param address {uint8} * @param accel {uint32} acceleration is unsigned * @param speed {int32} * @param deccel {uint32} decceleration is unsigned * @param position {uint32} position is unsigned * @param buffer {bool} true to override the previous command, false to buffer * @return {error}
func (*Roboclaw) SpeedAccelDeccelPositionM1M2 ¶
func (r *Roboclaw) SpeedAccelDeccelPositionM1M2(address uint8, accel1 uint32, speed1 int32, deccel1 uint32, position1 uint32, accel2 uint32, speed2 int32, deccel2 uint32, position2 uint32, buffer bool) error
* Drive motors 1 and 2 with acceleration and speed * @param address {uint8} * @param accel1 {uint32} acceleration is unsigned * @param speed1 {int32} * @param deccel1 {uint32} decceleration is unsigned * @param position1 {uint32} position is unsigned * @param accel2 {uint32} acceleration is unsigned * @param speed2 {int32} * @param deccel2 {uint32} decceleration is unsigned * @param position2 {uint32} position is unsigned * @param buffer {bool} true to override the previous command, false to buffer * @return {error}
func (*Roboclaw) SpeedAccelDeccelPositionM2 ¶
func (r *Roboclaw) SpeedAccelDeccelPositionM2(address uint8, accel uint32, speed int32, deccel uint32, position uint32, buffer bool) error
* Drive motor 2 with acceleration and speed * @param address {uint8} * @param accel {uint32} acceleration is unsigned * @param speed {int32} * @param deccel {uint32} decceleration is unsigned * @param position {uint32} position is unsigned * @param buffer {bool} true to override the previous command, false to buffer * @return {error}
func (*Roboclaw) SpeedAccelDistanceM1 ¶
func (r *Roboclaw) SpeedAccelDistanceM1(address uint8, accel uint32, speed int32, distance uint32, buffer bool) error
* Drive motor 1 with acceleration and speed to distance * @param address {uint8} * @param accel {uint32} acceleration is unsigned * @param speed {int32} * @param distance {uint32} distance is unsigned * @param buffer {bool} true to override the previous command, false to buffer * @return {error}
func (*Roboclaw) SpeedAccelDistanceM1M2 ¶
func (r *Roboclaw) SpeedAccelDistanceM1M2(address uint8, accel uint32, speed1 int32, distance1 uint32, speed2 int32, distance2 uint32, buffer bool) error
* Drive motors 1 and 2 with acceleration and speed to distance * @param address {uint8} * @param accel {uint32} acceleration is unsigned * @param speed1 {int32} * @param distance1 {uint32} distance is unsigned * @param speed2 {int32} * @param distance2 {uint32} distance is unsigned * @param buffer {bool} true to override the previous command, false to buffer * @return {error}
func (*Roboclaw) SpeedAccelDistanceM1M2_2 ¶
func (r *Roboclaw) SpeedAccelDistanceM1M2_2(address uint8, accel1 uint32, speed1 int32, distance1 uint32, accel2 uint32, speed2 int32, distance2 uint32, buffer bool) error
* Drive motors 1 and 2 with acceleration and speed * @param address {uint8} * @param accel1 {uint32} acceleration is unsigned * @param speed1 {int32} * @param distance1 {uint32} distance is unsigned * @param accel2 {uint32} acceleration is unsigned * @param speed2 {int32} * @param distance2 {uint32} distance is unsigned * @param buffer {bool} true to override the previous command, false to buffer * @return {error}
func (*Roboclaw) SpeedAccelDistanceM2 ¶
func (r *Roboclaw) SpeedAccelDistanceM2(address uint8, accel uint32, speed int32, distance uint32, buffer bool) error
* Drive motor 2 with acceleration and speed to distance * @param address {uint8} * @param accel {uint32} acceleration is unsigned * @param speed {int32} * @param distance {uint32} distance is unsigned * @param buffer {bool} true to override the previous command, false to buffer * @return {error}
func (*Roboclaw) SpeedAccelM1 ¶
* Drive motor 1 with speed and acceleration * @param address {uint8} * @param accel {uint32} acceleration is unsigned * @param speed {int32} * @return {error}
func (*Roboclaw) SpeedAccelM1M2 ¶
* Drive motors 1 and 2 with speed and acceleration * @param address {uint8} * @param accel {uint32} acceleration is unsigned * @param speed1 {int32} * @param speed2 {int32} * @return {error}
func (*Roboclaw) SpeedAccelM1M2_2 ¶
func (r *Roboclaw) SpeedAccelM1M2_2(address uint8, accel1 uint32, speed1 int32, accel2 uint32, speed2 int32) error
* Drive motors 1 and 2 with acceleration and speed * @param address {uint8} * @param accel1 {uint32} acceleration is unsigned * @param speed1 {int32} * @param accel2 {uint32} acceleration is unsigned * @param speed2 {int32} * @return {error}
func (*Roboclaw) SpeedAccelM2 ¶
* Drive motor 2 with speed and acceleration * @param address {uint8} * @param accel {uint32} acceleration is unsigned * @param speed {int32} * @return {error}
func (*Roboclaw) SpeedDistanceM1 ¶
* Drive motors 1 with speed to distance * @param address {uint8} * @param speed {int32} * @param distance {uint32} distance is unsigned * @param buffer {bool} true to override the previous command, false to buffer * @return {error}
func (*Roboclaw) SpeedDistanceM1M2 ¶
func (r *Roboclaw) SpeedDistanceM1M2(address uint8, speed1 int32, distance1 uint32, speed2 int32, distance2 uint32, buffer bool) error
* Drive motors 1 and 2 with speed to distance * @param address {uint8} * @param speed1 {int32} * @param distance1 {uint32} distance is unsigned * @param speed2 {int32} * @param distance2 {uint32} distance is unsigned * @param buffer {bool} true to override the previous command, false to buffer * @return {error}
func (*Roboclaw) SpeedDistanceM2 ¶
* Drive motors 2 with speed to distance * @param address {uint8} * @param speed {int32} * @param distance {uint32} distance is unsigned * @param buffer {bool} true to override the previous command, false to buffer * @return {error}
func (*Roboclaw) SpeedM1 ¶
* Drive motor 1 at given speed. Sign indicates direction. * @param address {uint8} * @param speed {int32} * @return {error}
func (*Roboclaw) SpeedM1M2 ¶
* Drive motors 1 and 2 at the given speeds. Sign indicates direction. * @param address {uint8} * @param speed1 {int32} * @param speed2 {int32} * @return {error}
func (*Roboclaw) SpeedM2 ¶
* Drive motor 2 at given speed. Sign indicates direction. * @param address {uint8} * @param speed {int32} * @return {error}
func (*Roboclaw) TurnLeftMixed ¶
* Turn left in mixed mode * @param address {uint8} * @param speed {uint8} valid data is 0 to 127 (0 stop, 127 full speed) * @return {error}
func (*Roboclaw) TurnRightMixed ¶
* Turn right in mixed mode * @param address {uint8} * @param speed {uint8} valid data is 0 to 127 (0 stop, 127 full speed) * @return {error}