Class CollisionSensor
- java.lang.Object
-
- com.thegongoliers.input.accelerometer.CollisionSensor
-
-
Constructor Summary
Constructors Constructor Description CollisionSensor(edu.wpi.first.wpilibj.interfaces.Accelerometer accel, double collisionMagnitudeThreshold)
Determines if a collision occurred
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
isTriggered()
Triggers if the magnitude of the acceleration is greater or equal to the collision threshold
-
-
-
Constructor Detail
-
CollisionSensor
public CollisionSensor(edu.wpi.first.wpilibj.interfaces.Accelerometer accel, double collisionMagnitudeThreshold)
Determines if a collision occurred- Parameters:
accel
- An accelerometercollisionMagnitudeThreshold
- The magnitude of the acceleration in g-forces that determines a collision
-
-
Method Detail
-
isTriggered
public boolean isTriggered()
Triggers if the magnitude of the acceleration is greater or equal to the collision threshold- Specified by:
isTriggered
in interfaceSwitch
- Returns:
- true if the switch is triggered, false otherwise
-
-