Updating itaVA class and fixing problems in itaVA setup. Also, adding build...

Updating itaVA class and fixing problems in itaVA setup. Also, adding build script from VAMatlab repository
parent cf6ea76e
......@@ -298,7 +298,7 @@ classdef itaVA < handle
function set_tracked_real_world_sound_receiver_head_rigid_body_index( this, index )
% Sets the index of the rigid body to be tracked for real-world sound receiver (default is 1)
VAMatlab( 'set_tracked_real_world_sound_receiver_rigid_body_index', this.handle, index )
VAMatlab( 'set_tracked_real_world_sound_receiver_head_rigid_body_index', this.handle, index )
end
function set_tracked_real_world_sound_receiver_torso_rigid_body_index( this, index )
......@@ -306,7 +306,7 @@ classdef itaVA < handle
VAMatlab( 'set_tracked_real_world_sound_receiver_torso_rigid_body_index', this.handle, index )
end
function set_tracked_real_world_sound_receiver_head_rigid_body_translation( this, translation )
function set_tracked_real_world_sound_receiver_head_rb_trans( this, translation )
% Sets the pivot point translation for the tracked real-world sound receiver rigid body
%
% Parameters:
......@@ -316,7 +316,7 @@ classdef itaVA < handle
VAMatlab( 'set_tracked_real_world_sound_receiver_head_rigid_body_translation', this.handle, translation )
end
function set_tracked_real_world_sound_receiver_head_rigid_body_rotation( this, rotation )
function set_tracked_real_world_sound_receiver_head_rb_rotation( this, rotation )
% Sets the rotation of orientation for the tracked real-world sound receiver rigid body
%
% Given rotation has to be a Matlab quaternion type (order: w(real), i, j, k)
......@@ -340,22 +340,22 @@ classdef itaVA < handle
VAMatlab( 'set_tracked_sound_source', this.handle, source_id );
end
function set_tracked_source_rigid_body_index( this, index )
function set_tracked_sound_source_rigid_body_index( this, index )
% Sets the index of the rigid body to be tracked for source (default is 1)
VAMatlab( 'set_tracked_source_rigid_body_index', this.handle, index )
VAMatlab( 'set_tracked_sound_source_rigid_body_index', this.handle, index )
end
function set_tracked_source_rigid_body_translation( this, translation )
function set_tracked_sound_source_rigid_body_translation( this, translation )
% Sets the pivot point translation for the tracked source rigid body
%
% Parameters:
%
% translation [double-3x1] Translation in local coordinate system of rigid body [m]
%
VAMatlab( 'set_tracked_source_rigid_body_translation', this.handle, translation )
VAMatlab( 'set_tracked_sound_source_rigid_body_translation', this.handle, translation )
end
function set_tracked_source_rigid_body_rotation( this, rotation )
function set_tracked_sound_source_rigid_body_rotation( this, rotation )
% Sets the rotation of orientation for the tracked source rigid body
%
% Given rotation has to be a Matlab quaternion type (order: w(real), i, j, k)
......@@ -364,7 +364,13 @@ classdef itaVA < handle
%
% rotation [quaternion] Rotation of rigid body
%
VAMatlab( 'set_tracked_source_rigid_body_rotation', this.handle, rotation )
VAMatlab( 'set_tracked_sound_source_rigid_body_rotation', this.handle, rotation )
end
function get_tracker_info( this )
% Returns the tracker configuration state
%
VAMatlab( 'get_tracker_info', this.handle )
end
......
% THIS FILE WILL BE OVERWRITTEN BY CMAKE WITHOUT WARNING
%
% Code generator for the VA Matlab interface facade class
%
% Desc: This script generates the code for the Matlab
% facade class to the VAInterface MEXExtension.
% It takes the class template code and inserts
% all stubs for the functions in the VAConnector
% interface. These are derived using the reflexion
% mechanism ('enumerateFunctions')
%
va_base_dir = '..'; % VA folder with bin, lib, matlab, data etc.
va_script_dir = fullfile( va_base_dir, 'matlab' ); % Matlab scripts target directory
va_bin_dir = fullfile( va_base_dir, 'bin' );
va_lib_dir = fullfile( va_base_dir, 'lib' );
if exist( va_bin_dir, 'dir' ) ~= 7
error( 'Deploy dir ''%s'' does not exist. Please build and install VAMatlab first.', va_bin_dir )
end
if exist( va_script_dir, 'dir' ) ~= 7
mkdir( va_script_dir );
end
if exist( [ 'VAMatlab' '.' mexext ], 'file' )
warning( 'VAMatlab already found at location "%s", are you sure to build itaVA against this executable? Will proceed now.', which( 'VAMatlab' ) )
else
% Add to PATH temporarily and attempt to move lib to bin dir
addpath( va_script_dir, va_bin_dir )
[ s ] = movefile( fullfile( va_lib_dir, 'VAMatlab*' ), va_bin_dir );
if ~s && ~exist( [ 'VAMatlab' '.' mexext ], 'file' )
error( 'Could not locate VAMatlab executable. Please make sure that it can be found.' )
end
end
% Parameters
templateFile = 'itaVA.m.proto';
outputFile = fullfile( va_script_dir, 'itaVA.m' );
fprintf( 'Generating code for itaVA Matlab class ''%s'' ...\n', outputFile );
code = fileread( templateFile );
stubCode = itaVA_generateStubs();
code = strrep( code, '###STUBCODE###', stubCode );
% Write the results
fid = fopen( outputFile, 'w' );
fprintf( fid, '%s', code );
fclose( fid );
fprintf( 'Matlab class ''%s'' successfully built\n', outputFile );
% Remove from MATLABPATH (otherwise naming conflicts may occur with
% ITA-Toolbox/applications/VirtualAcoustics/VA/* scripts)
rmpath( va_script_dir, va_bin_dir )
......@@ -238,8 +238,9 @@ if vaserver_found
for i = 1:numel( vs )
vss = vs{ 1, i };
if numel( vss ) > 6
if strcmpi( vss( 1:6 ), 'VACore' )
set( handles.edit_vaserver_version, 'String', strcat( vs( i ) ) )
if strcmpi( vss( 3:10 ), 'VAServer' )
server_version = vss( 15:end );
set( handles.edit_vaserver_version, 'String', strcat( server_version ) )
end
end
end
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment