![]() |
Code Examples
A repository of 155 code examples for BeepBeep
|
Detects situations where a moving robot loses traction and starts skidding. More...
Static Public Member Functions | |
static void | main (String[] args) |
static Vector< Float > | vecc (Number x, Number y) |
Utility method to create a 2D vector from Cartesian coordinates. More... | |
static Vector< Float > | vecp (Number r, Number theta) |
Utility method to create a 2D vector from polar coordinates. More... | |
static float | rad (float deg) |
Converts degrees to radians. More... | |
Detects situations where a moving robot loses traction and starts skidding.
For the purpose of this example, skidding is is identified as a prolonged interval during which the orientation of the robot differs significantly from the orientation of its movement (i.e. the robot is pointing in one direction but moving in another one).
The example does not merely detect a skidding interval (which would be a relatively classical case of runtime verification). Rather, it summarizes a skidding situation by outputting a complex event called a "skidding incident", which is only emitted once the skidding ends. This event is a triplet containing:
This example makes use of the RangeCep processor, which can create "complex" events summarizing a stream of lower-level events.
To make the example more realistic, the detection of skidding allows a few "normal" events to occur interspersed with skidding events. The condition is that m out of n successive events should reveal a skidding state for the overall sequence be considered as an occurrence of skidding.
Definition at line 74 of file DetectSkidding.java.
|
static |
Converts degrees to radians.
deg | The angle in degrees |
Definition at line 221 of file DetectSkidding.java.
|
static |
Utility method to create a 2D vector from Cartesian coordinates.
x | The first coordinate |
y | The second coordinate |
Definition at line 194 of file DetectSkidding.java.
|
static |
Utility method to create a 2D vector from polar coordinates.
r | The modulus |
theta | The angle (in radians) |
Definition at line 208 of file DetectSkidding.java.