Table of Contents > QUARC > User's Guide > Using Devices
Vehicles
QUARC introduces a powerful new paradigm for simulating and controlling vehicles - the Vehicle Abstraction Layer. The Vehicle Abstraction Layer allows unmanned aerial and ground vehicles (and perhaps submersibles in future releases) to be simulated and controlled from the same set of blocks. This new paradigm makes it possible to change vehicles readily without having to modify trajectory planning and cooperative control algorithms in the Simulink model. Quanser is using this exciting new technology to simulate and control a variety of cooperating unmanned aerial vehicles - all through the same set of blocks!
The blocks belonging to the Vehicle Abstraction Layer are all prefixed with "VAL", such as the VAL Initialize block. The VAL Initialize block, like the HIL Initialize block for hardware-in-the-loop cards, is the primary interface to a vehicle and must be present in the diagram to use any of the other VAL blocks. The VAL blocks are all located under the QUARC Targets/Devices/Vehicles library. This page briefly describes how to use the VAL blocks.
VAL Initialize block
The primary interface to a vehicle is the VAL Initialize block. It is used to assign a name to the vehicle by which all the other VAL blocks will address the vehicle. The vehicle name given to this block will appear in the list of vehicles of all other VAL blocks.
The VAL Initialize block also initializes the vehicle. The vehicle type and autopilot configuration must be selected so
the block knows the type of vehicle with which it is interfacing, and the autopilot system employed by that vehicle. These
parameters will allow the VAL blocks to communicate with the vehicle's autopilot for the purpose of controlling it and to
simulate the vehicle. For example, the Procerus Unicorn, depicted below, may be selected as the vehicle by choosing
procerus_unicorn
as the vehicle type.
The Procerus Unicorn uses the Kestrel autopilot, so the procerus_kestrel
autopilot should be selected from the list of
autopilots in the VAL Initialize block.
The vehicle is always simulated in normal simulation, but in the real-time code, it may either be simulated or control the actual vehicle, according to the Simulate in external mode parameter of the block.
Using the Other VAL Blocks
Once the VAL Initialize block has been added to the diagram and configured, the other VAL blocks may now be used to control the vehicle or alter the state of the vehicle simulation.
For example, the VAL Read Vehicle State block may be used to get the position and orientation of the vehicle, as X, Y, Z, roll, pitch and yaw coordinates. To tell the VAL Read Vehicle State block the vehicle whose position and orientation it is to read, select the vehicle by name in the Vehicle name drop-down list in the block's parameters dialog. The names in the list corresponded to the names assigned to each VAL Initialize block in the diagram.
To command the vehicle to maneuver to a specific waypoint, use the VAL Set Waypoint block. This block allows the X, Y, Z coordinates of the waypoint to be specified, as well as a throttle value for controlling the speed at which the vehicle maneuvers to reach the waypoint. Once again, the vehicle to control is specified by name.
Other VAL blocks are in development, as well as support for more vehicles. Look for these enhancements in future QUARC updates!
Copyright ©2024 Quanser Inc. This page was generated 2024-10-17. Submit feedback to Quanser about this page.
Link to this page.