-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathconstants.go
More file actions
68 lines (59 loc) · 2.21 KB
/
constants.go
File metadata and controls
68 lines (59 loc) · 2.21 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
package sphero
const (
DataPacketStart = 0x8D
DataPacketEnd = 0xD8
FlagIsResponse = 0x01
FlagRequestsResponse = 0x02
FlagRequestsOnlyErrorResponse = 0x04
FlagResetsInactivityTimeout = 0x08
DeviceAPIProcessor = 0x10
DeviceSystemInfo = 0x11
DevicePowerInfo = 0x13
DeviceDriving = 0x16
DeviceAnimatronics = 0x17
DeviceSensor = 0x18
DeviceUserIO = 0x1a
SystemInfoApplicationVersion = 0x00
SystemInfoCommandsBootLoaderVersion = 0x01
PowerCommandsDeepSleep = 0x00
PowerCommandsSleep = 0x01
PowerCommandsBatteryVoltage = 0x03
PowerCommandsWake = 0x0D
DrivingCommandsRawMotor = 0x01
DrivingCommandsDriveAsRC = 0x02
DrivingCommandsDriveAsSphero = 0x04
DrivingCommandsResetHeading = 0x06
DrivingCommandsWithHeading = 0x07
DrivingCommandsStabilization = 0x0C
SensorCommandMask = 0x00
SensorCommandResponse = 0x02
SensorCommandConfigureCollision = 0x11
SensorCommandCollisionDetectedAsync = 0x12
SensorCommandResetLocator = 0x13
SensorCommandEnableCollisionAsync = 0x14
SensorCommandSensor2 = 0x17
SensorCommandConfigureSensorStream = 0x0c
SensorCommandSensor1 = 0x0f
UserIOCommandsAllLEDs = 0x0e
)
// CollisionConfig provides configuration for the collision detection algorithm.
type CollisionConfig struct {
// Detection method type to use. Methods 01h and 02h are supported as
// of FW ver 1.42. Use 00h to completely disable this service.
Method uint8
// An 8-bit settable threshold for the X (left/right) axes of Sphero.
// A value of 00h disables the contribution of that axis.
Xt uint8
// An 8-bit settable speed value for the X axes. This setting is ranged
// by the speed, then added to Xt to generate the final threshold value.
Xs uint8
// An 8-bit settable threshold for the Y (front/back) axes of Sphero.
// A value of 00h disables the contribution of that axis.
Yt uint8
// An 8-bit settable speed value for the Y axes. This setting is ranged
// by the speed, then added to Yt to generate the final threshold value.
Ys uint8
// An 8-bit post-collision dead time to prevent retriggering; specified
// in 10ms increments.
Dead uint8
}