Kauai Labs navX2-MXP User Manual page 51

Robotics navigation sensor
Table of Contents

Advertisement

Examples
Collision Detection (FRC)
In the sample code shown below, both the X axis and the Y axis jerk are calculated, and if either exceeds
a threshold, then a collision has occurred.
The "collision threshold" used in these samples will likely need to be tuned for your robot, since the
amount of jerk which constitutes a collision will be dependent upon the robot mass and expected
maximum velocity of either the robot, or any object which may strike the robot.
FRC C++ Example
Full C++ Source Code
FRC Java Example
Full Java Source Code
FRC LabView Example
The navX-sensor AutoBalance LabView example shows how to make small modifications to the
LabView "FRC RoboRIO Robot Project" using the "Mecanum Robot" configuration to implement
collision detection.
RobotMain.vi
Place the NavX main vi on the block diagram and set it up to your needs. The default sample rate is
48

Advertisement

Table of Contents
loading

Related Products for Kauai Labs navX2-MXP

Table of Contents