Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
Co-Authored-By: Austin Shalit <[email protected]>
  • Loading branch information
benjamin-antupit and AustinShalit authored Sep 3, 2019
1 parent 58b754d commit 48669e8
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 32 deletions.
58 changes: 29 additions & 29 deletions source/docs/hardware/control/vmx-pi.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ VMX-pi Vision/Motion Processor & Robotics Controller

.. image:: images/vmx-pi/kauai-labs-logo.png

When combined with a Raspberry Pi (purchased separately), the VMX-pi Vision/Motion Processor & Robotics Controller provides an accurate, easy-to-use way to **measure motion**, **process video**, **interface to external sensors** and **monitor your RoboRIO** – using libraries designed and tested to operate on a RoboRIO-based robot.
When combined with a Raspberry Pi (purchased separately), the VMX-pi Vision/Motion Processor & Robotics Controller provides an accurate, easy-to-use way to **measure motion**, **process video**, **interface to external sensors** and **monitor your roboRIO** – using libraries designed and tested to operate on a roboRIO-based robot.

.. note:: VMX-pi is also capable for use as a Robot controller including control of actuators (e.g., servos, motors, relays pneumatics) via Digital Output and Digital Communication protocols like CAN. However, VMX-pi’s control functionality is not historically legal for use with actuators used in FRC competitions (please consult the “Robot” section of the FRC Game Manual for details) – but it’s great for building an off-season robot! For more information on VMX-pi robot control features, please visit `VMX-pi online <http://pdocs.kauailabs.com/vmx-pi/>`_.
.. note:: VMX-pi is also capable for use as a robot controller including control of actuators (e.g., servos, motors, relays pneumatics) via digital output and digital communication protocols like CAN. However, VMX-pi’s control functionality is not historically legal for use with actuators used in FRC competitions (please consult the “Robot” section of the FRC Game Manual for details) – but it’s great for building an off-season robot! For more information on VMX-pi robot control features, please visit `VMX-pi online <https://pdocs.kauailabs.com/vmx-pi/>`_.

Features
--------
Expand All @@ -23,41 +23,41 @@ VMX-pi includes a navX-Technology self-calibrating Inertial Measurement Unit (IM
- Driving in a straight line
- Rotating automatically to a specific angle
- Field-oriented drive
- Automatic Balancing
- Motion Detection
- Collision Detection
- Automatic balancing
- Motion detection
- Collision detection

Vision Processing
^^^^^^^^^^^^^^^^^

The Raspberry Pi (especially when combined the `VMX-rtk Robotics Toolkit <http://pdocs.kauailabs.com/vmx-rtk/>`_) provides an inexpensive, powerful platform for processing, recording to disk and streaming video to the FRC Driver station. Vision-processing capabilities enable you to improve your autonomous programs by performing target detection and calculations of distance and angle target. VMX-pi provides an integrated power supply for your Raspberry Pi, making it simple to add a Raspberry Pi to your robot. And the Raspberry Pi SD Card makes a great place to store competition video recorded by the robot.
The Raspberry Pi (especially when combined the `VMX-rtk Robotics Toolkit <https://pdocs.kauailabs.com/vmx-rtk/>`_) provides an inexpensive, powerful platform for processing, recording to disk, and streaming video to the FRC Driver station. Vision-processing capabilities enable you to improve your autonomous programs by performing target detection and calculations of distance and angle target. VMX-pi provides an integrated power supply for your Raspberry Pi, making it simple to add a Raspberry Pi to your robot. And the Raspberry Pi SD Card makes a great place to store competition video recorded by the robot.

Real-time Clock
^^^^^^^^^^^^^^^

VMX-pi’s onboard battery-backed Real Time Clock keeps track of current date and time – even when not connected to an external power source. This allows logging on your robot with useful timestamps, and can also be used to synchronize streams of data from multiple robots.
VMX-pi’s onboard battery-backed real-time clock keeps track of current date and time – even when not connected to an external power source. This allows logging on your robot with useful timestamps, and can also be used to synchronize streams of data from multiple robots.

Interface to Sensors
^^^^^^^^^^^^^^^^^^^^

VMX-pi provides I/O capabilities very similar to the RoboRIO – making it useful for interfacing to external sensors (e.g., the Sparkfun `QWIIC Connect <https://www.sparkfun.com/qwiic>`_ family of I2C sensors), as well as the RoboRIO CAN bus. On a FRC robot, these features can be integrated into your robot application (by sending information from VMX-pi to the RoboRIO over the network via NetworkTables). VMX-pi can also be used to unobtrusively monitor the behavior of a FRC robot for debugging and analyzing robot performance.
VMX-pi provides I/O capabilities very similar to the roboRIO – making it useful for interfacing to external sensors (e.g., the Sparkfun `QWIIC Connect <https://www.sparkfun.com/qwiic>`_ family of I2C sensors), as well as the roboRIO CAN bus. On a FRC robot, these features can be integrated into your robot application (by sending information from VMX-pi to the roboRIO over the network via NetworkTables). VMX-pi can also be used to unobtrusively monitor the behavior of a FRC robot for debugging and analyzing robot performance.

Motion Processing Overview
^^^^^^^^^^^^^^^^^^^^^^^^^^

VMX-pi includes a navX-Technology Inertial Measurement Unit (IMU), and includes 6 sensors which measure inertial motion: 3 accelerometers measuring acceleration (in units of `Standard Gravity <https://en.wikipedia.org/wiki/Standard_gravity>`_ [g]) and 3 gyroscopes measuring `Rotational Speed <https://en.wikipedia.org/wiki/Rotational_speed>`_ (in units of degrees per second).

Additionally, through a process called “Motion Processing”, VMX-pi intelligently combines the 6-axis inertial sensing data to create a measurement of relative 3D orientation.
Additionally, through a process called “sensor fusion”, VMX-pi intelligently combines the 6-axis inertial sensing data to create a measurement of relative 3D orientation.

.. image:: images/vmx-pi/yaw-pitch-roll.jpg

IMUs are typically used to measure aircraft orientation, but are also very useful for controlling a robot. IMUs measure rotation of an object around the Z-axis (known as “Yaw”), the X-axis (known as “Pitch”) and the Y-axis (known as “Roll”).
IMUs are typically used to measure aircraft orientation, but are also very useful for controlling a robot. IMUs measure rotation of an object around the Z-axis (yaw), the X-axis (pitch) and the Y-axis (roll).

Pitch and Roll angles are absolute (tied to the earth’s surface); 0 degrees means “flat” with respect to the earth.
Pitch and roll angles are absolute (tied to the earth’s surface); 0 degrees means “flat” with respect to the earth.

However, IMU Yaw angles are **relative** - not tied to any direction (like North on a Compass). Therefore, your robot application must decide where 0 degrees is. Usually, FRC robots treat the “head” of the field (the direction driver’s face) as 0 degrees.
However, IMU Yaw angles are **relative** - not tied to any direction (like North on a compass). Therefore, your robot application must decide where 0 degrees is. Usually, FRC robots treat the “head” of the field (the direction driver’s face) as 0 degrees.

For more information, please visit the `VMX-pi Terminology page <http://pdocs.kauailabs.com/vmx-pi/support/terminology/>`_.
For more information, please visit the `VMX-pi Terminology page <https://pdocs.kauailabs.com/vmx-pi/support/terminology/>`_.

Digital Compass and Attitude/Heading Reference System (AHRS)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Expand All @@ -68,12 +68,12 @@ VMX-pi’s navX-Technology also includes 3 magnetometer sensors, which measure m

And by intelligently fusing the digital compass with the gyroscope/accelerometer data, VMX-pi can create a measurement of absolute 3D orientation.

.. note:: Earth’s magnetic field is actually very weak when compared to the magnetic field generated by a nearby motor; for this reason it can be difficult to get accurate digital compass readings on a FRC robot. For this reason, using the VMX-pi AHRS is an advanced feature best suited for teams who have the time to learn about `how to calibrate the VMX-pi digital compass <http://vmx-pi.kauailabs.com/guidance/magnetometer-calibration/>`_ and also how to deal with magnetic disturbances.
.. note:: Earth’s magnetic field is actually very weak when compared to the magnetic field generated by a nearby motor; for this reason it can be difficult to get accurate digital compass readings on a FRC robot. For this reason, using the VMX-pi AHRS is an advanced feature best suited for teams who have the time to learn about `how to calibrate the VMX-pi digital compass <https://vmx-pi.kauailabs.com/guidance/magnetometer-calibration/>`_ and also how to deal with magnetic disturbances.

Vision Software Overview
^^^^^^^^^^^^^^^^^^^^^^^^

Useful Vision software for FRC robots is comprised of multiple features:
Useful vision software for FRC robots is comprised of multiple features:

=========== ===================================================================================================================
Feature Description
Expand All @@ -82,10 +82,10 @@ Acquisition Retrieves camera images so they can be processed by software
Processing Detects objects of interest in camera images, and calculates metrics (e.g., distance and angle) about those objects
Streaming Allows drivers to see what the robot sees, in real-time and during a match
Recording Stores video of a match recorded by the robot for later viewing
Overlays Textual information display on video useful to Streaming viewers and debugging of Processing algorithms
Overlays Textual information display on video useful to streaming viewers and debugging of Processing algorithms
=========== ===================================================================================================================

VMX-pi’s VMX Robotics Toolkit contains OpenCV and the WPI cscore and ntcore libraries - and enables your Raspberry pi to integrate your vision processing algorithm (e.g., as generated from the WPI GRIP tool) into your robot application. The VMX Robotics toolkit includes source code demonstrating each of the features and how to incorporate them into your robot’s Vision software.
VMX-pi’s VMX Robotics Toolkit contains OpenCV and the WPILib cscore and ntcore libraries - and enables your Raspberry Pi to integrate your vision processing algorithm (e.g., as generated from the WPI GRIP tool) into your robot application. The VMX Robotics Toolkit includes source code demonstrating each of the features and how to incorporate them into your robot’s vision software.

.. image:: images/vmx-pi/vision-software-architecture.jpg

Expand All @@ -103,7 +103,7 @@ VMX-pi’s integrated CAN bus interface allows you to monitor the robot CAN Bus
Assembly with Raspberry Pi
--------------------------

The first step is to assemble your Raspberry Pi 3 and VMX-pi, as shown `at VMX-pi online <http://pdocs.kauailabs.com/vmx-pi/installation/assembly-with-raspberry-pi/>`_.
The first step is to assemble your Raspberry Pi 3 and VMX-pi, as shown `at VMX-pi online <https://pdocs.kauailabs.com/vmx-pi/installation/assembly-with-raspberry-pi/>`_.

Kauai Labs has created the VMX Robotics Toolkit, available for purchase at the `Kauai Labs Store <https://www.kauailabs.com/store>`_. This is a high-quality SD Card for your Raspberry Pi with many pre-installed software tools for FRC robotics, and also has approximately 16GB of extra space for storing videos taken on your robot during practice or competition. Instructions are also available at `VMX-pi online`_ to build your own SD card image, however Kauai Labs recommends the VMX Robotics Toolkit SD card – which was created to save you the time and trouble of creating your own SD card.

Expand All @@ -114,16 +114,16 @@ FRC Robot Installation Overview

.. image:: images/vmx-pi/vmxpi-wiring.jpg

VMX-pi can be easily connected to a robot, connecting power from the Power Distribution Panel (PDP), Ethernet and/or USB from the RoboRIO, and (if vision processing is used), connecting cameras to the Raspberry Pi USB Ports (or to the Raspberry Pi camera connector if using the Raspberry Pi Camera). This only takes a few minutes.
VMX-pi can be easily connected to a robot, connecting power from the Power Distribution Panel (PDP), Ethernet and/or USB from the roboRIO, and (if vision processing is used), connecting cameras to the Raspberry Pi USB Ports (or to the Raspberry Pi camera connector if using the Raspberry Pi Camera). This only takes a few minutes.

If using the Standoffs to mount VMX-pi, connect the Standoffs to the chassis or other large surface of the robot; if using the VMX-pi enclosure, mount the enclosure to the robot chassis via the mounting holes at the four corners. In either case, if using IMU data, it is important to mount VMX-pi firmly so that it moves as a unit with your robot chassis.
If using the standoffs to mount VMX-pi, connect the standoffs to the chassis or other large surface of the robot; if using the VMX-pi enclosure, mount the enclosure to the robot chassis via the mounting holes at the four corners. In either case, if using IMU data, it is important to mount VMX-pi firmly so that it moves as a unit with your robot chassis.

.. note:: When connecting VMX-pi to your FRC robot for use in competition, be sure to disable the Raspberry Pi Wifi, to avoid Wifi interference.
.. note:: When connecting VMX-pi to your FRC robot for use in competition, be sure to disable the Raspberry Pi WiFi, to avoid WiFi interference.

USB (if accessing IMU data directly from the RoboRIO)
USB (if accessing IMU data directly from the roboRIO)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

If connecting VMX-pi to the RoboRIO to acquire IMU data – or to a Windows computer to run the navXUI and other tools on Windows - use a USB micro cable. The USB Micro cable is connected to the usb connector near the power connector, as shown below.
If connecting VMX-pi to the roboRIO to acquire IMU data – or to a Windows computer to run the navXUI and other tools on Windows - use a USB micro cable. The USB Micro cable is connected to the usb connector near the power connector, as shown below.

.. image:: images/vmx-pi/vmxpi-usb.jpg

Expand All @@ -132,14 +132,14 @@ Ethernet (if accessing Vision processing or other data via NetworkTables)

.. image:: images/vmx-pi/vmxpi-ethernet.jpg

If connecting VMX-pi to the RoboRIO to communicate data over Ethernet, connect an Ethernet cable to the RJ45 (Ethernet) connector on your Raspberry Pi connected to the VMX-pi. Connect the other end to the Robot network, either on the Wifi radio (e.g.,OpenMesh) or a separate ethernet switch connected to the radio.
If connecting VMX-pi to the roboRIO to communicate data over Ethernet, connect an Ethernet cable to the RJ45 (Ethernet) connector on your Raspberry Pi connected to the VMX-pi. Connect the other end to the robot network, either on the WiFi radio (e.g.,OpenMesh) or a separate ethernet switch connected to the radio.

CAN (if accessing CAN bus data)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

.. image:: images/vmx-pi/vmxpi-can.jpg

If connecting VMX-pi to the RoboRIO to acquire CAN data, connect a CAN cable (as supplied in the Kit of Parts) to the Weidmuller connector on the VMX-pi. The use of ferrules (the red plastic portion of these connectors is visible in the photo above) is highly recommended to ensure a secure electrical connection.
If connecting VMX-pi to the roboRIO to acquire CAN data, connect a CAN cable (as supplied in the Kit of Parts) to the Weidmuller connector on the VMX-pi. The use of ferrules (the red plastic portion of these connectors is visible in the photo above) is highly recommended to ensure a secure electrical connection.

Enclosure
^^^^^^^^^
Expand All @@ -153,14 +153,14 @@ Visit the `VMX-pi Enclosure page <http://vmx-pi.kauailabs.com/installation/creat
RoboRIO Software Installation
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

To access VMX-pi IMU data from your RoboRIO robot application, install the `VMX-pi Libraries for RoboRIO <http://pdocs.kauailabs.com/vmx-pi/software/libraries/>`_.
To access VMX-pi IMU data from your roboRIO robot application, install the `VMX-pi Libraries for roboRIO <https://pdocs.kauailabs.com/vmx-pi/software/libraries/>`_.

If using NetworkTables to exchange data between VMX-pi and RoboRIO, Network Tables support on the RoboRIO is already installed with the FRC software releases; on the Raspberry Pi, NetworkTables is available (for C++, Java and Python) on the VMX-rtk SD Card Image.
If using NetworkTables to exchange data between VMX-pi and roboRIO, NetworkTables support on the roboRIO is already installed with the FRC software releases; on the Raspberry Pi, NetworkTables is available (for C++, Java and Python) on the VMX-rtk SD Card Image.

Using VMX-pi
------------

Example RoboRIO robot examples for accessing the VMX-pi’s navX-technology IMU data are available in C++, Java and Python.
Example roboRIO robot examples for accessing the VMX-pi’s navX-technology IMU data are available in C++, Java and Python.

Example programs for developing vision processing for Raspberry Pi will be available online at the KauaiLabs website soon after kickoff in the “Raspberry Pi” example section.

Expand All @@ -171,7 +171,7 @@ Learning More

.. image:: images/vmx-pi/navx-ui.jpg

To learn more about how the VMX-pi navX-technology IMU works, you can use `navXUI <https://pdocs.kauailabs.com/vmx-pi/software/tools/navx-ui/>`_, which runs on a Windows PC connected via USB to the VMX-pi and demonstrates all of the VMX-pi features. navXUI also provides a way to save VMX-pi data to a file so you can analyze it. navXUI can even run simultaneously with your RoboRIO robot application.
To learn more about how the VMX-pi navX-technology IMU works, you can use `navXUI <https://pdocs.kauailabs.com/vmx-pi/software/tools/navx-ui/>`_, which runs on a Windows PC connected via USB to the VMX-pi and demonstrates all of the VMX-pi features. navXUI also provides a way to save VMX-pi data to a file so you can analyze it. navXUI can even run simultaneously with your roboRIO robot application.

Best Practices
--------------
Expand Down
Loading

0 comments on commit 48669e8

Please sign in to comment.