// DefaultCollisionConfig returns a CollisionConfig with sensible collision defaults
funcDefaultCollisionConfig()CollisionConfig{
returnCollisionConfig{
Method:0x01,
Xt:0x80,
Yt:0x80,
Xs:0x80,
Ys:0x80,
Dead:0x60,
}
}
// CollisionConfig provides configuration for the collision detection alogorithm.
// For more information refer to the offical api specification https://github.com/orbotix/DeveloperResources/blob/master/docs/Collision%20detection%201.2.pdf.
typeCollisionConfigstruct{
// Detection method type to use. Methods 01h and 02h are supported as
// of FW ver 1.42. Use 00h to completely disable this service.
Methoduint8
// An 8-bit settable threshold for the X (left/right) axes of Sphero.
// A value of 00h disables the contribution of that axis.
Xtuint8
// An 8-bit settable threshold for the Y (front/back) axes of Sphero.
// A value of 00h disables the contribution of that axis.
Ytuint8
// 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.
Xsuint8
// 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.
Ysuint8
// An 8-bit post-collision dead time to prevent retriggering; specified
// in 10ms increments.
Deaduint8
}
// CollisionPacket represents the response from a Collision event
// DefaultDataStreamingConfig returns a DataStreamingConfig with a sampling rate of 40hz, 1 sample frame per package, unlimited streaming, and will stream all available sensor information
// DataStreamingConfig provides configuration for Sensor Data Streaming.
// For more information refer to the offical api specification https://github.com/orbotix/DeveloperResources/blob/master/docs/Sphero_API_1.50.pdf page 28