![Kauai Labs navX2-MXP Скачать руководство пользователя страница 44](http://html1.mh-extra.com/html/kauai-labs/navx2-mxp/navx2-mxp_user-manual_3634856044.webp)
Examples
Field-Oriented Drive (FRC)
Full LabVIEW Source code on Github
Rotate to Angle (FRC)
Automatically rotating a robot to an angle using a navX-sensor can be used to rotate a robot quickly and
accurately to a known angle, as long as the robot drive system provides independent Z-axis rotation (the
capability to “spin on a dime”). This same technique can be used to help a robot drive in a straight line.
This example code below will automatically rotate the robot to one of four angles (0, 90, 180 and 270
degrees) whenever the corresponding “rotate to preset angle” button is pressed. This rotation can occur
not only when the robot is still, but also when the robot is driving. When using field-oriented control,
this will cause the robot to drive in a straight line, in whatever direction is selected.
This example also includes a feature allowing the driver to “reset” the “yaw” angle. When the reset
occurs, the new gyro angle will be 0 degrees. This can be useful in cases when the gyro drifts, which
doesn’t typically happen during a FRC match, but can occur during long practice sessions.
The PID Controller coefficients defined in the example code will need to be tuned for your drive system.
NOTE: The examples below are for Mecanum drive systems. If you are using a tank (differential) drive
41
Содержание navX2-MXP
Страница 1: ...navX2 MXP Robotics Navigation Sensor User Guide Kauai Labs Creative Commons BY 2020...
Страница 13: ...Installation RoboRIO Installation 10...
Страница 20: ...Installation Orientation 17...
Страница 24: ...Installation I O Expansion 21...