Start of trail VAL Read Sensors navigation bar

Table of Contents

VAL Command

Used to execute vehicle commands.

Library

QUARC Targets/Vehicles/Basic

MATLAB Command Line

Click to copy the following command line to the clipboard. Then paste it in the MATLAB Command Window:

qc_open_library('quarc_library/Vehicles/Basic')

Description

VAL Command

The VAL Command block executes the selected command on the vehicle referenced by the Vehicle name parameter. The list of available commands is populated dynamically based on the vehicle type. Refer to your vehicle's User Manual for details on the available commands.

The VAL Command block will execute the specified command repeatedly at the given sample time unless the Enable command signal parameter is selected. If the Enable command signal parameter is selected, an additional exe input will appear, in which case the block executes the command when the exe input is non-zero. When the exe input goes to zero (false) from a non-zero value, the VAL Command block will continue to execute the command for the amount of time specified in the Duration parameter. If the Enable command signal parameter is not selected the Duration parameter has no effect.

Input Ports

exe

A signal that enables execution of the command. This input is only available when the Enable command signal parameter is checked. If the input value is non-zero, the command will be executed. If the input value goes from non-zero to zero then the command will continue to be executed for the amount of time specified in the Duration parameter. This input accepts any of the built-in Simulink data types.

The Direct Drive command is used to specify wheel throttles for 2-wheel differential drive ground vehicles. The inputs specify both wheel velocities.

throttle

A 2-element vector that specifies the velocities (in m/s) of the right and left wheel respectively.

The Drive command is used to specify throttle and steering values for a ground vehicle.

throttle

A scalar that specifies the desired velocity (in m/s) of the vehicle.

steering

A scalar that specified the desired steering value of the vehicle (note: the use of this value is dependent on the type of vehicle - refer to your vehicle documentation for details).

The Set Roll Pitch Yaw command is meant to emulate inputs from a 4-channel joystick. This command specifies desired throttle, roll, pitch, and yaw commands for the vehicle.

rpy

A 3-element vector that contains the desired roll, pitch, and yaw values in radians.

throttle

A scalar throttle value, typically ranging from 0 (off) to 1 (full throttle).

Output Ports

status

An integer value that can be used to indicate vehicle status. The use of this output is dependent on the vehicle driver. Typically, a value of 0 indicates a "no error" status.

done

A boolean output signal that is available only when the Enable command signal parameter is checked. If the block is executed and then the enable signal is false (0) for the time specified in the Duration parameter, the done output signal will be set to true for one sample, and is false otherwise.

Data Type Support

The input are of type double unless otherwise noted.

Parameters and Dialog Box

VAL Command

Vehicle Name

The name of the vehicle on which the command will be executed. Vehicles are configured using the VAL Initialize block. Place a VAL Initialize block in your diagram to add a vehicle name to the list.

Command

The command that will be executed on the specified vehicle. The list of commands is generated based on the type of vehicle specified in the corresponding VAL Initialize block. See your vehicle's documentation for a list of available commands.

Enable command signal

A parameter that adds an enable signal for the block to control command execution. If this parameter is unchecked (false) then the specified command will be executed at the given sample time. If the Enable command signal parameter is selected, an additional exe input will appear, in which case the block executes the command when the exe input is non-zero. In addition, the Duration parameter ensures that the command is executed for a specified amount of time after the enable signal goes low (0). The following figures illustrate some examples of command execution using the Enable command signal parameter and the Duration parameter.

Duration

A scalar value specifying the time (in seconds) that a command should continue to be executed after the enabling signal goes from true (non-zero) to false (zero). This parameter is only used when the Enable command signal parameter is checked.

Sample time

The sample time of the block. A sample time of 0 indicates that the block will be treated as a continuous time block. A positive sample time indicates that the block is a discrete time block with the given sample time.

A sample time of -1 indicates that the block inherits its sample time. Since this is a source block, only inherent the sample time when it is placed in a conditionally executed subsystem, like a Triggered or Enabled Subsystem, or in a referenced model.

The default sample time is set to qc_get_step_size, which is a QUARC function that returns the fundamental sampling time of the model. Hence, the default sample time is a discrete sample time with the same sampling time as the fixed step size of the model.

Targets

Target Name

Compatible*

Model Referencing

Comments

QUARC Win32 Target

Yes

Yes

QUARC Win64 Target

Yes

Yes

QUARC Linux Nvidia Target

Yes

Yes

QUARC Linux QBot Platform Target

Yes

Yes

QUARC Linux QCar 2 Target

Yes

Yes

QUARC Linux QDrone 2 Target

Yes

Yes

QUARC Linux Raspberry Pi 3 Target

Yes

Yes

QUARC Linux Raspberry Pi 4 Target

Yes

Yes

QUARC Linux RT ARMv7 Target

Yes

Yes

QUARC Linux x64 Target

Yes

Yes

QUARC Linux DuoVero Target

Yes

Yes

QUARC Linux DuoVero 2016 Target

Yes

Yes

QUARC Linux Verdex Target

Yes

Yes

QUARC QNX x86 Target

No

No

Not supported.

Rapid Simulation (RSIM) Target

No

No

S-Function Target

No

N/A

Old technology. Use model referencing instead.

Normal simulation

Yes

Yes

Fully supported.

* Compatible means that the block can be compiled for the target.

 

navigation bar