Table of Contents
VRPN Client
VRPN clients to interface with VRPN servers to get VRPN enabled devices information.
Library
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/Devices/Third-Party/VRPN')Description
The VRPN Client block acts as a client in a Virtual Reality Peripheral Network (VRPN). Currently it only supports the tracker device type. Popular tracker systems, e.g. Optitrack, Vicon, Phase Space, all have support for VRPN.
The VRPN Client block outputs the positions, velocity, and acceleration of the trackers (if the trackers provide all of them). It also produces an output that indicates when a new measurement has been received for that tracker, since the block does not wait for the measurement to be received from VRPN server.
By default, the block outputs Quaternion in Hamilton convention (qw, qx, qy, qz), which is consistent with the QUARC Quaternion blocks and MATLAB. This is different than the VRPN standard of using JPL convention (qx, qy, qz, qw). The parameter Quaternion in JPL convention can be used to change the Quaternion outputs to JPL convention.
Input Ports
This block has no input ports.
Output Ports
Trackers Pos
A matrix containing 3 x n
elements, where n
is the number of tracker sensors
specified in the block parameters. Each column of the matrix represents the xyz coordinates
of a tracker sensor; e.g., the output matrix [x_1, x_2; y_1, y_2; z_1, z_2]
contains the
xyz
coordinates (x_1, y_1, z_1)
and (x_2, y_2, z_2)
for tracker sensors 1
and 2, respectively.
If no new tracker sensor data is received in the current frame, its position holds its
previous value, and the Trackers New output would be false (0).
This would only have valid data if the tracker reports this information.
Trackers Quat
A matrix containing 4 x n
elements, where n
is the number of tracker sensors
specified in the block parameters. Each column of the matrix represents the orientation
(qw, qx, qy, qz)
of a tracker sensor in quaternion format; e.g., the output matrix
[qw_1, qw_2; qx_1, qx_2; qy_1, qy_2; qz_1, qz_2]
contains the orientations defined by
(qw_1, qx_1, qy_1, qz_1)
and (qw_2, qx_2, qy_2, qz_2)
for tracker sensors 1 and 2, respectively.
If no new tracker sensor data is received in the current frame, its orientation holds its
previous value, and the Trackers New output would be false (0).
This would only have valid data if the trackers report this information.
Trackers Vel
A matrix containing 3 x n
elements, where n
is the number of tracker sensors
specified in the block parameters. Each column of the matrix represents the xyz velocities
of a tracker sensor; e.g., the output matrix [vx_1, vx_2; vy_1, vy_2; vz_1, vz_2]
contains the
xyz
velocities (vx_1, vy_1, vz_1)
and (vx_2, vy_2, vz_2)
for tracker sensors 1
and 2, respectively.
If no new tracker sensor data is received in the current frame, its velocity holds its
previous value, and the Trackers New output would be false (0).
This would only have valid data if the trackers report this information.
Trackers Quat Vel
A matrix containing 4 x n
elements, where n
is the number of tracker sensors
specified in the block parameters. Each column of the matrix represents angular velocities
(qvw, qvx, qvy, qvz)
of a tracker sensor in quaternion format;
e.g., the output matrix [qvw_1, qvw_2; qvx_1, qvx_2; qvy_1, qvy_2; qvz_1, qvz_2]
contains the angular velocities defined by (qvw_1, qvx_1, qvy_1, qvz_1)
and
(qvw_2, qvx_2, qvy_2, qvz_2)
for tracker sensors 1 and 2, respectively.
If no new tracker sensor data is received in the current frame, its angular velocity
holds its previous value, and the Trackers New output would be false (0).
This would only have valid data if the trackers report this information.
Trackers Quat Vel DT
A vector containing n
elements, where n
is the number of tracker sensors
specified in the block parameters. Each element represents the angular velocity
delta time of the tracker sensor; e.g., the output vector [qvdt_1, qvdt_2]
contains
the angular velocities delta time defined by qvdt_1
and qvdt_2
for
tracker sensors 1 and 2, respectively.
If no new tracker sensor data is received in the current frame, its angular velocity delta time
holds its previous value, and the Trackers New output would be false (0).
This would only have valid data if the trackers report this information.
Trackers Acc
A matrix containing 3 x n
elements, where n
is the number of tracker sensors
specified in the block parameters. Each column of the matrix represents the xyz accelerations
of a tracker sensor; e.g., the output matrix [ax_1, ax_2; ay_1, ay_2; az_1, az_2]
contains the
xyz
accelerations (ax_1, ay_1, az_1)
and (ax_2, ay_2, az_2)
for tracker sensors 1
and 2, respectively.
If no new tracker sensor data is received in the current frame, its acceleration holds its
previous value, and the Trackers New output would be false (0).
This would only have valid data if the trackers report this information.
Trackers Quat Acc
A matrix containing 4 x n
elements, where n
is the number of tracker sensors
specified in the block parameters. Each column of the matrix represents angular acclerations
(qaw, qax, qay, qaz)
of a tracker sensor in quaternion format;
e.g., the output matrix [qaw_1, qaw_2; qax_1, qax_2; qay_1, qay_2; qaz_1, qaz_2]
contains the angular accelerations defined by (qaw_1, qax_1, qay_1, qaz_1)
and
(qaw_2, qax_2, qay_2, qaz_2)
for tracker sensors 1 and 2, respectively.
If no new tracker sensor data is received in the current frame, its angular acceleration
holds its previous value, and the Trackers New output would be false (0).
This would only have valid data if the trackers report this information.
Trackers Quat Acc DT
A vector containing n
elements, where n
is the number of tracker sensors
specified in the block parameters. Each element represents the angular acceleration
delta time of the tracker sensor; e.g., the output vector [qadt_1, qadt_2]
contains
the angular accelerations delta time defined by qadt_1
and qadt_2
for
tracker sensors 1 and 2, respectively.
If no new tracker sensor data is received in the current frame, its angular acceleration delta time
holds its previous value, and the Trackers New output would be false (0).
This would only have valid data if the trackers report this information.
Trackers New
A vector containing n
elements, where n
is the number of tracker sensors
specified in the block parameters. Each element indicates whether the data for that
tracker sensor is new. Since the block does not wait for the trackers data to be reported
(since those data are often slow compared to typical controller sample rates), this output
may be used to determine when new tracker data has been received. If the tracker data is not
new, the other outputs will hold their prior values.
Data Type Support
This block supports outputs of type double, except for Trackers New which is boolean.
Parameters and Dialog Box
VRPN server
The VRPN server parameter is used to specify the hostname and port number of the VRPN server that this block is communicated with. You can specify either a hostname or the IP address of the VRPN server. Default port number for VRPN server is 3883, but you can change it to other values if the VRPN server uses a different one.
List of trackers
This list specifies the trackers that the VRPN Client block will try to read from the VRPN server. Each row represents one tracker. Each column is explained below:
Column title |
Description |
---|---|
Tracker device |
A string that represents the name of the tracker as defined by the VRPN server. Depending on the VRPN server, the tracker names are defined in different ways. Consult the VRPN server documentation for how the trackers are defined.
For example, the VRPN example server on VRPN GitHub
repository uses a For Optitrack Motive software, it has VRPN server built-in. The tracker names are defined by the rigid body names.
For PhaseSpace system, the trackers need to be defined in their |
Number of sensors |
A scalar that represents the number of sensors that this tracker has. For some trackers, there can be multiple sensors on the tracker.
For example, the VRPN example server on VRPN GitHub
repository uses a On the other hand, for Optitrack Motive software each rigid body only has one sensor. |
Sensors to read |
A vector of sensor index (0-based) to read from the tracker. If there is one sensor for the tracker, then
the index must be 0. For trackers that have multiple sensors, set this to
Note that the dimension of the block's outputs depends on number of sensors (not the number of trackers).
e.g. if Number of sensors is |
The order of the output ports columns (i.e the sensor order) depends on the order of this list.
The +
and -
button can be used to add or remove trackers from the list, respectively.
The ^
and v
button can be used to move a selected tracker up and down the list, respectively.
Quaternion in JPL convention (tunable offline)
Indicates whether the Trackers quaternion outputs are in JPL convention. If not set, the quaternion outputs are in Hamilton convention.
Sample time (second)
The sampling period (in seconds) at which the sensor data are output from the VRPN Client 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.
Active during normal simulation (tunable offline)
Indicates whether this block should communicate during normal simulation.
Targets
Target Name |
Compatible* |
Model Referencing |
Comments |
---|---|---|---|
Yes |
Yes |
||
Yes |
Yes |
||
Yes |
Yes |
||
Yes |
Yes |
||
Yes |
Yes |
||
Yes |
Yes |
||
No |
No |
||
No |
No |
||
No |
No |
||
No |
No |
||
No |
No |
||
No |
No |
||
No |
No |
||
No |
No |
Last fully supported in QUARC 2018. |
|
Rapid Simulation (RSIM) Target |
No |
No |
|
S-Function Target |
No |
N/A |
Old technology. Use model referencing instead. |
Normal simulation |
Yes |
Yes |
Copyright ©2024 Quanser Inc. This page was generated 2024-10-17. Submit feedback to Quanser about this page.
Link to this page.