Documentation
¶
Index ¶
- Constants
- func OIModeStr(mode OpenInterfaceMode) (string, bool)
- type BatteryStatus
- type BaudRateCode
- type ChargingStateCode
- type Direction
- type InfoStatus
- type OIBot
- func (o *OIBot) Battery() (*BatteryStatus, bool)
- func (o *OIBot) Baud(baud int)
- func (o *OIBot) Clean()
- func (o *OIBot) Close()
- func (o *OIBot) Control()
- func (o *OIBot) Drive(velocity int16, radius int16)
- func (o *OIBot) DriveStop()
- func (o *OIBot) DriveWheels(rightVelocity int16, leftVelocity int16)
- func (o *OIBot) Flush()
- func (o *OIBot) Full()
- func (o *OIBot) Info() (*InfoStatus, bool)
- func (o *OIBot) MaxClean()
- func (o *OIBot) Mode() OpenInterfaceMode
- func (o *OIBot) Pack(data ...interface{}) []byte
- func (o *OIBot) Passive()
- func (o *OIBot) Power()
- func (o *OIBot) Read(buf []byte) int
- func (o *OIBot) Reset()
- func (o *OIBot) Safe()
- func (o *OIBot) SeekDock()
- func (o *OIBot) Sensor(packet *SensorPacket) []byte
- func (o *OIBot) SensorList(packet ...*SensorPacket) [][]byte
- func (o *OIBot) Spot()
- func (o *OIBot) Start()
- func (o *OIBot) Stop()
- func (o *OIBot) Write(code OpCode, buf ...interface{}) int
- func (o *OIBot) WriteCode(code OpCode)
- type OpCode
- type OpenInterfaceMode
- type SensorGroup
- type SensorPacket
Constants ¶
const ( MaxDriveVelocityMMPS int16 = 500 MinDriveVelocityMMPS int16 = -500 MaxDriveRadiusMM int16 = 2000 MinDriveRadiusMM int16 = -2000 StraightDriveRadiusMM int16 = 0x7FFF DriveWheelSeparationMM int16 = 298 )
const ( DefaultBaudRateBPS int = 115200 SerialTransferDelayMS time.Duration = 50 * time.Millisecond SensorUpdateDelayMS time.Duration = 15 * time.Millisecond // from OI spec DefaultReadTimeoutMS time.Duration = 500 * time.Millisecond NeverReadTimeoutMS time.Duration = 0 )
const ( AngleRuneWeightMax = byte(4) AngleRuneUnknown = '⮔' )
const (
BootupTimeMS time.Duration = 5000 * time.Millisecond
)
Variables ¶
This section is empty.
Functions ¶
func OIModeStr ¶
func OIModeStr(mode OpenInterfaceMode) (string, bool)
Types ¶
type BatteryStatus ¶
type BaudRateCode ¶
type BaudRateCode byte
=====================================================================================================================
type ChargingStateCode ¶
type ChargingStateCode byte
=====================================================================================================================
type Direction ¶
type Direction uint
=====================================================================================================================
type InfoStatus ¶
type InfoStatus struct {
Mode OpenInterfaceMode
Battery *BatteryStatus
}
type OIBot ¶
type OIBot struct {
// contains filtered or unexported fields
}
func (*OIBot) Battery ¶
func (o *OIBot) Battery() (*BatteryStatus, bool)
func (*OIBot) DriveWheels ¶
func (*OIBot) Info ¶
func (o *OIBot) Info() (*InfoStatus, bool)
func (*OIBot) Mode ¶
func (o *OIBot) Mode() OpenInterfaceMode
func (*OIBot) Sensor ¶
func (o *OIBot) Sensor(packet *SensorPacket) []byte
func (*OIBot) SensorList ¶
func (o *OIBot) SensorList(packet ...*SensorPacket) [][]byte
type OpCode ¶
type OpCode byte
=====================================================================================================================
type OpenInterfaceMode ¶
type OpenInterfaceMode byte
=====================================================================================================================
const ( OIMOff OpenInterfaceMode = 0 OIMPassive OpenInterfaceMode = 1 OIMSafe OpenInterfaceMode = 2 OIMFull OpenInterfaceMode = 3 )
type SensorGroup ¶
type SensorGroup struct {
// contains filtered or unexported fields
}
=====================================================================================================================
type SensorPacket ¶
type SensorPacket struct {
// contains filtered or unexported fields
}
=====================================================================================================================