Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
VAMatlab
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Iterations
Merge Requests
0
Merge Requests
0
Requirements
Requirements
List
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Operations
Operations
Incidents
Analytics
Analytics
Code Review
Insights
Issue
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Institute of Technical Acoustics (ITA)
VAMatlab
Commits
f9492723
Commit
f9492723
authored
Oct 04, 2018
by
Dipl.-Ing. Jonas Stienen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Some little function renaming and API change adaptions in matlab scripts
parent
ffbd25d0
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
43 additions
and
22 deletions
+43
-22
matlab/VAMatlabExecutable_debug.m
matlab/VAMatlabExecutable_debug.m
+18
-18
matlab/itaVA.m.proto
matlab/itaVA.m.proto
+21
-0
matlab/itaVA_build.m.proto
matlab/itaVA_build.m.proto
+1
-1
matlab/itaVA_generateStubs.m
matlab/itaVA_generateStubs.m
+1
-1
src/VAMatlabExecutable.cpp
src/VAMatlabExecutable.cpp
+2
-2
No files found.
matlab/VAMatlabExecutable_debug.m
View file @
f9492723
...
...
@@ -33,39 +33,39 @@ end
%% Connection
conn
=
VAMatlabD
(
'connect'
,
'localhost:12340'
);
renderers
=
VAMatlabD
(
'get
RenderingM
odules'
,
conn
,
false
);
renderers
=
VAMatlabD
(
'get
_rendering_m
odules'
,
conn
,
false
);
disp
(
renderers
)
reproductions
=
VAMatlabD
(
'get
ReproductionM
odules'
,
conn
,
false
);
reproductions
=
VAMatlabD
(
'get
_reproduction_m
odules'
,
conn
,
false
);
disp
(
reproductions
)
%% Tests
L
=
VAMatlabD
(
'create
Listen
er'
,
conn
,
'itaVA_Tracked_Listener'
,
'default'
,
-
1
);
L
=
VAMatlabD
(
'create
_sound_receiv
er'
,
conn
,
'itaVA_Tracked_Listener'
,
'default'
,
-
1
);
VAMatlabD
(
'
SetTrackedListen
er'
,
conn
,
L
)
%VAMatlabD( '
SetTrackedS
ource', conn,L )
VAMatlabD
(
'
SetRigidBodyI
ndex'
,
conn
,
1
)
VAMatlabD
(
'
SetRigidBodyT
ranslation'
,
conn
,
[
0
0
3
]
)
VAMatlabD
(
'
set_tracked_sound_receiv
er'
,
conn
,
L
)
%VAMatlabD( '
set_tracked_sound_s
ource', conn,L )
VAMatlabD
(
'
set_tracked_sound_receiver_head_rigid_body_i
ndex'
,
conn
,
1
)
VAMatlabD
(
'
set_tracked_sound_receiver_head_rigid_body_t
ranslation'
,
conn
,
[
0
0
3
]
)
q
=
ita_quaternion
(
[
pi
/
sqrt
(
2
)
0
1
/
sqrt
(
2
)
0
]
)
q
=
q
.
normalize
VAMatlabD
(
'SetRigidBodyRotation'
,
conn
,
q
.
e
(:)
'
)
VAMatlabD
(
'connect
T
racker'
,
conn
)
b
=
VAMatlabD
(
'
IsTrackerC
onnected'
,
conn
)
VAMatlabD
(
'disconnect
T
racker'
,
conn
)
VAMatlabD
(
'connect
_tr
racker'
,
conn
)
b
=
VAMatlabD
(
'
get_tracker_c
onnected'
,
conn
)
VAMatlabD
(
'disconnect
_t
racker'
,
conn
)
%VAMatlabD( 'connect
T
racker', conn, '137.226.61.85', '137.226.61.85' )
%VAMatlabD( 'connect
_t
racker', conn, '137.226.61.85', '137.226.61.85' )
modinfos
=
VAMatlabD
(
'
enumerateM
odules'
,
conn
);
modinfos
=
VAMatlabD
(
'
get_m
odules'
,
conn
);
istruct
=
struct
;
istruct
.
info
=
''
;
ostruct
=
VAMatlabD
(
'call
Module'
,
conn
,
'
GenericPath:MyGenericRenderer'
,
istruct
)
ostruct
=
VAMatlabD
(
'call
_mdule'
,
conn
,
'Prototype
GenericPath:MyGenericRenderer'
,
istruct
)
istruct
=
struct
();
istruct
.
command
=
'UPDATE'
;
...
...
@@ -89,12 +89,12 @@ if false
istruct
.
itaAudio
=
ita_merge
(
sweep
,
sweep
);
end
ostruct
=
VAMatlabD
(
'call
Module'
,
conn
,
'
GenericPath:MyGenericRenderer'
,
istruct
);
ostruct
=
VAMatlabD
(
'call
_module'
,
conn
,
'Prototype
GenericPath:MyGenericRenderer'
,
istruct
);
%VAMatlabD( 'call
M
odule', conn, 'hprep', { 'print', 'help' } ) % will print on std::cout @ real VACore, i.e. VAGUI or Console
%lhs_arg = VAMatlabD( 'call
M
odule', conn, 'hprep', { 'get', 'gain' } )
%VAMatlabD( 'call
M
odule', conn, 'hprep', { 'set', 'gain', 'value', lhs_arg / 3 } )
%lhs_arg_new = VAMatlabD( 'call
M
odule', conn, 'hprep', { 'get', 'gain' } )
%VAMatlabD( 'call
_m
odule', conn, 'hprep', { 'print', 'help' } ) % will print on std::cout @ real VACore, i.e. VAGUI or Console
%lhs_arg = VAMatlabD( 'call
_m
odule', conn, 'hprep', { 'get', 'gain' } )
%VAMatlabD( 'call
_m
odule', conn, 'hprep', { 'set', 'gain', 'value', lhs_arg / 3 } )
%lhs_arg_new = VAMatlabD( 'call
_m
odule', conn, 'hprep', { 'get', 'gain' } )
VAMatlabD
(
'disconnect'
,
conn
)
clear
VAMatlabD
% release to allow write access for msvc
matlab/itaVA.m.proto
View file @
f9492723
...
...
@@ -99,6 +99,7 @@ classdef itaVA < handle
VAMatlab
(
'set_verbose_mode'
,
mode
);
end
end
methods
...
...
@@ -203,6 +204,26 @@ classdef itaVA < handle
if
this.handle
==
0
,
error
(
'Not connected.'
);
end
;
state
=
VAMatlab
(
'get_server_state'
,
this.handle
);
end
function
shutdown_server
(
this
)
%
Attempts
to
shut
down
the
remote
server
%
%
Server
shutdown
may
be
prohibited
by
the
server
configuration.
%
Shutting
donw
the
server
from
client
side
is
meant
for
cases
%
when
the
server
is
called
by
a
script
to
run
e.g.
a
simulation
%
while
the
rendering
output
is
recorded.
The
export
is
triggered
%
when
the
core
is
finalized
(
or
shut
down
)
.
%
%
Parameters
:
%
%
None
%
%
Return
values
:
%
%
None
%
VAMatlab
(
'call_module'
,
this.handle
,
'VACore'
,
struct
(
'shutdown'
,
true
)
);
end
function
connect_tracker
(
this
,
remote_ip
,
local_ip
)
%
Connects
to
a
local
NatNet
tracking
server
...
...
matlab/itaVA_build.m.proto
View file @
f9492723
...
...
@@ -7,7 +7,7 @@
%
It
takes
the
class
template
code
and
inserts
%
all
stubs
for
the
functions
in
the
VAConnector
%
interface.
These
are
derived
using
the
reflexion
%
mechanism
(
'enumerate
F
unctions'
)
%
mechanism
(
'enumerate
_f
unctions'
)
%
va_base_dir
=
'@VAMATLAB_BASE_DIR@'
;
%
VA
folder
with
bin
,
lib
,
matlab
,
data
etc.
...
...
matlab/itaVA_generateStubs.m
View file @
f9492723
...
...
@@ -3,7 +3,7 @@
function
[
output
]
=
generateStubs
()
% Get interface describtion
d
=
VAMatlab
(
'enumerate
F
unctions'
);
d
=
VAMatlab
(
'enumerate
_f
unctions'
);
code
=
''
;
for
i
=
1
:
length
(
d
)
...
...
src/VAMatlabExecutable.cpp
View file @
f9492723
...
...
@@ -231,9 +231,9 @@ void mexFunction( int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[] )
// Reflexion function. Returns cell-array of structs with information on the command functions.
// Used for code generation of the Matlab MEX facade class [private]
REGISTER_PRIVATE_FUNCTION
(
enumerate
F
unctions
);
REGISTER_PRIVATE_FUNCTION
(
enumerate
_f
unctions
);
void
enumerate
F
unctions
(
int
nlhs
,
mxArray
*
plhs
[],
int
nrhs
,
const
mxArray
**
)
void
enumerate
_f
unctions
(
int
nlhs
,
mxArray
*
plhs
[],
int
nrhs
,
const
mxArray
**
)
{
// Count public functions
mwSize
nPublicFuncs
=
0
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment