NI Tutorial 11564 en
NI Tutorial 11564 en
Overview
For years, LabVIEW has enabled engineers and scientists to develop sophisticated autonomous systems. At its core, LabVIEW is widely used for sensor and actuator connectivity and currently offers
more than 8000 drivers for measurement devices. By providing a single environment that is a framework for combining graphical and textual code, LabVIEW gives you the freedom to integrate
multiple approaches for programming, analysis, and algorithm development. Furthermore, with new libraries for autonomy and an entirely new suite of robotics-specific sensor and actuator drivers,
LabVIEW provides all of the necessary tools for robotics development. This whitepaper highlights some of the new features included in the LabVIEW Robotics Module, which supports
Windows-based PCs and NI RIO embedded hardware.
Table of Contents
1. Introduction to LabVIEW Robotics
2. SENSE: Retrieve Data from Sensors
3. SENSE: Image Processing
4. THINK: Apply Navigation Algorithms
5. THINK: Implement Advanced Control Loops
6. THINK: Control a Robotic Arm
7. ACT: Control Motors
8. ACT: Calculate Wheel States
9. ACT: Simulate Your Robot with 3rd Party Tools
10. ACT: Deploy Deterministic Algorithms to Embedded Hardware
11. Summary
Figure 2: New libraries in LabVIEW Robotics enable developers to quickly develop an autonomous robot
*The LabVIEW Robotics Bundle is a separate product that includes the LabVIEW Robotics module, in addition to LabVIEW Professional, LabVIEW Real-Time, LabVIEW FPGA, LabVIEW Control
Design and Simulation, LabVIEW MathScript RT, NI Vision, NI SoftMotion, and the LabVIEW PID and Fuzzy Logic Toolkits.
2. SENSE: Retrieve Data from Sensors
The LabVIEW and NI RIO platform makes it easy for developers to connect to any sensor signal. In addition to basic digital and analog I/O, LabVIEW Robotics includes functions and examples for
interfacing with signals using low-level protocols such as PWM, I 2C and SPI, and high-level protocols such as NMEA and Joint Architecture for Unmanned Systems (JAUS).
Furthermore, LabVIEW Robotics includes a new set of VIs to configure, control, and retrieve data from the most commonly used sensors. The current list of sensor drivers is listed below; however,
National Instruments is continuously creating new drivers and expanding this list. The FPGA based sensor drivers and examples can be found in the NI Example Finder under Robotics >> Sensor
Drivers.
1/9 www.ni.com
Figure 3: LabVIEW Robotics Sensing Palette
LIDAR – Hokuyo URG Series, SICK LMS 2XX Series, Velodyne HDL-64E S2
Infrared – Sharp IR GP2D12, Sharp IR GP2Y0D02YK
Sonar – Devantech SRF02 & SRF05, MaxSonar EZ1
GPS – Garmin GPS Series, NavCom SF-2050, u-blox 5 Series, Applanix POS LV
Compass – Devantech CMPS03 (PWM or I2C), PNI Field Force TCM
Inertial Measurement Unit (IMU) – Microstrain 3DM-GXx and 3DM-GXx, Crossbow NAV440, Ocean Server OS4000
Camera – Axis M1011 IP camera, analog cameras (MoviMED Analog Frame Grabber for CompactRIO), USB cameras (Windows only), NI Smart Cameras
Thermal - Devantech TPA81
Light - Vishay TEMT600
Encoder - Maxon encoder
RFID - APSX RW Series
Text to Speech (TTS) - V-Stamp
LabVIEW offers an intuitive environment for implementing and visualizing parallel processes. The figure below shows two sensors acquiring data in parallel on a real-time processor using the
LabVIEW Robotics sensor drivers.
2/9 www.ni.com
Figure 5: HexaQuad robot powered by LabVIEW and NI Single-Board RIO uses an Axis M1011 for vision
4. THINK: Apply Navigation Algorithms
Once you are able to acquire data from sensors and control your mobile robot’s movement, the next step might be to apply an obstacle avoidance or path planning algorithm. LabVIEW Robotics
includes new VIs and examples for avoiding obstacles based on sensor feedback, and for calculating the shortest path between a start location and a goal location.
For simple obstacle avoidance, LabVIEW Robotics provides two variations of the Vector Field Histogram algorithm. This algorithm can be used when the robot does not have a target location, and is
navigating an environment autonomously. All of the algorithms and functions included in LabVIEW Robotics are open-source and can be easily modified. To see the Vector Field Histogram in action,
check out the video included our Robot Recipe for NIcholas.
Figure 6: LabVIEW Robotics example of using the Vector Field Histogram (VFH) obstacle avoidance algorithm
When a mobile robot must avoid obstacles while navigating to a known destination, a path planning algorithm should be applied. LabVIEW Robotics includes Path Planning VIs for calculating the
optimal path for the conditions you specify. The Path Planning VIs are based on the following search algorithms:
A* - Computes the shortest path between a start node and goal node.
AD* - Computes the shortest path between a start node and goal node while taking into account that the world (or the robot's understanding of the world) is changing. It maintains more
information than the A*search algorithm, so that it can backtrack and find a new path more easily if it discovers that its original path will not work.
3/9 www.ni.com
Figure 8: Example of localization included in LabVIEW Robotics which uses an Continous Kalman Filter to track the position of a one-degree-of-freedom robot
*The LabVIEW Control Design and Simulation Module is included in the LabVIEW Robotics Bundle, but is separate from the LabVIEW Robotics Module.
6. THINK: Control a Robotic Arm
Many mobile robots use a robotic arm or manipulator for completing a task. LabVIEW Robotics offers many functions that are useful for robotic arms such as kinematics, dynamics, and trajectory
generation. The robotic arm libraries* are useful for simulation as well as analyzing results from experiments with with real robots.
4/9 www.ni.com
Figure 10: Example of using LabVIEW Robotics kinematics libraries to deterministically compute the forward kinematics of a Puma 560 robotic arm
To learn more about using the LabVIEW Robotics kinematics libraries, check out Basic Robot Kinematics.
*These libraries were originally written by Professor Peter Corke at the Queensland University of Technology.
7. ACT: Control Motors
LabVIEW Robotics includes drivers for connecting to a variety of motors and motor controllers. There are software examples and APIs available for controlling the following motors and motor drives:
Dynamixel motors
Hitec motors
Lynxmotion SSC32 servo controllers
TI MDL BDC24 brushed DC motor drives
Maxon EPOS2 motor drives (requires the NI 9853 I/O module for CAN communication)
Figure 11: Example of interfacing with Lynxmotion servo controllers using LabVIEW Robotics
National Instruments also offers several I/O modules that plug into CompactRIO or Single-Board RIO. For brushed DC motors, the NI 9505 module includes a built-in H-bridge and encoder interface.
For powerful stepper or servo motion control applications, the NI 951x C Series drive interface modules connect to hundreds of drives and motors. These I/O modules require the NI SoftMotion
Module, which provides high-level functions for everything from single-axis to complex-coordinated motion.
8. ACT: Calculate Wheel States
To drive a wheeled robot at a certain velocity and direction, you must calculate the wheel velocities depending on the type of robot. LabVIEW Robotics includes a set of steering functions to simplify
this process. These steering functions have built-in support for Ackerman, differential and mecanum steering, to be used with fixed, steering, caster, mecanum or omni-directional wheels. Developers
can also use these same functions to create a custom or user-defined steering frame.
Figure 12: Example of creating a differential steering frame with LabVIEW Robotics
Sometimes it is important to test your steering algorithms in simulation prior to running them on-board the robot. The LabVIEW Robotics steering functions can be used in conjunction with the
3D Picture Control and the LabVIEW Control Design and Simulation module to simulate your robot in real-time. LabVIEW Robotics includes several example programs for simulating different steering
frames.
5/9 www.ni.com
Figure 13: Simulation of a robot with an omni-directional steering frame
9. ACT: Simulate Your Robot with 3rd Party Tools
One of the most common needs for robot development is simulation. Simulation allows developers to test code much faster than if using actual hardware. Ideally, the exact same code can run either
on the actual robot or in a simulated state; the only change being the specified target. The new physics-based environment simulator, released in LabVIEW Robotics 2011, based on the Open
Dynamics Engine (http://www.ode.org/), addresses this issue.
6/9 www.ni.com
Figure 14: Cogmation’s robotSim Pro 3D simulation environment included in LabVIEW Robotics
Robotics developers can use the new simulator to simulate any sensor input and any motor output, allowing them to test algorithms like mapping, steering, and path planning in simulation, and then
use the exact same code on the hardware.
The simulator has built-in support for the NI LabVIEW Robotics Starter Kit 1.1 and 2.0, the base FRC robot platform, and the iRobot Create platform. The simulator also has built-in support for the
most popular sensor classes as shown below.
7/9 www.ni.com
Figure 15: LabVIEW Robotics includes libraries for simulating sensor and motor data, which can easily be swapped out with libraries for the actual hardware
10. ACT: Deploy Deterministic Algorithms to Embedded Hardware
LabVIEW Robotics can be easily integrated with real-time and FPGA based hardware solutions from National Instruments, allowing developers to achieve highly responsive control. These products
include the rugged NI CompactRIO embedded platform, and the lower cost board-only version, NI Single-Board RIO. The RIO hardware architecture enables robot designers to implement hardware
interfaces, signal processing, and any time-critical control algorithms in FPGA logic, which frees up the processor to handle high-level tasks such as navigation or mission planning.
Figure 16: Real-time and FPGA based platforms from National Instruments allow developers to easily deploy deterministic algorithms to hardware
If you are new to the LabVIEW and NI RIO platform, the LabVIEW Robotics Starter Kit, “DaNI”, is available as an evaluation or prototyping platform. This pre-built platform includes an NI
Single-Board RIO, a PING))) Ultrasonic distance sensor, motors, encoders, and a mechanical frame from Pitsco Education. Out-of-the-box, DaNI uses the LabVIEW Robotics Module to perform
obstacle avoidance and can navigate autonomously. This expandable platform features built-in digital and analog I/O, connectors to NI C Series modules, in addition to an on-board Ethernet and
serial port allowing for the connectivity of additional third-party sensors and actuators. DaNI includes a 180-day evaluation of the LabVIEW platform in addition to the LabVIEW Real-Time module,
LabVIEW FPGA module, and LabVIEW Robotics module.
Figure 17: The LabVIEW Robotics Starter Kit, “DaNI”, is available as an evaluation or prototyping platform
11. Summary
LabVIEW Robotics 2010 provides all of the necessary software tools needed for interfacing with sensors and actuators, controlling your robot’s motion, implementing navigation algorithms and
8/9 www.ni.com
LabVIEW Robotics 2010 provides all of the necessary software tools needed for interfacing with sensors and actuators, controlling your robot’s motion, implementing navigation algorithms and
advanced control, and simulating your robot in a dynamic environment. Complete your robotic system by integrating LabVIEW with embedded real-time and FPGA based hardware platforms such as
the CompactRIO and Single-Board RIO. For more information about LabVIEW Robotics, see ni.com/robotics.
Additional Resources
Download a 180-day evaluation of the LabVIEW Robotics module
(If you do not already have LabVIEW 2010 installed, download a 7-day trial prior to installing the LabVIEW Robotics module.)
Learn more about the LabVIEW Robotics Starter Kit
View all LabVIEW Robotics offerings at ni.com/robotics
Browse academic resources for robotics at ni.com/robotics/education
9/9 www.ni.com