Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
ITAPropagationPathSim
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Requirements
Requirements
List
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Analytics
Analytics
Insights
Issue
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
Institute of Technical Acoustics (ITA)
ITAPropagationPathSim
Commits
f58890bc
Commit
f58890bc
authored
Jul 23, 2019
by
henryjandrew
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixed bugs in UrbanTrajectory, and added motion to the source
parent
4bbb06a3
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
29 additions
and
12 deletions
+29
-12
tests/CombinedModel/UrbanTrajectory.cpp
tests/CombinedModel/UrbanTrajectory.cpp
+29
-10
tests/ImageModel/SimpleUrbanImageModelTest.cpp
tests/ImageModel/SimpleUrbanImageModelTest.cpp
+0
-1
tests/MeshModelList/Reflection/SimpleMeshModelImageSourceTest.cpp
...shModelList/Reflection/SimpleMeshModelImageSourceTest.cpp
+0
-1
No files found.
tests/CombinedModel/UrbanTrajectory.cpp
View file @
f58890bc
...
...
@@ -71,11 +71,15 @@ int main( int iNumInArgs, char* pcInArgs[] )
return
255
;
}
// Generate trajectory
float
start_pos_x
=
0.0
f
;
float
start_pos_y
=
-
46.5
f
;
float
start_pos_z
=
1.0
f
;
// Scene
//auto pReceiver = make_shared< CSensor >( VistaVector3D( 10.0f, 5.0f, 1.7f ) );
auto
pReceiver
=
make_shared
<
CSensor
>
(
VistaVector3D
(
15.0
f
,
0.0
f
,
1.7
f
));
auto
pReceiver
=
make_shared
<
CSensor
>
(
VistaVector3D
(
10.0
f
,
5.0
f
,
1.7
f
)
);
auto
pVehicle
=
make_shared
<
CEmitter
>
(
VistaVector3D
(
-
1.0
f
,
20.
f
,
1.0
f
)
);
auto
pVehicle
=
make_shared
<
CEmitter
>
(
VistaVector3D
(
start_pos_x
,
start_pos_y
,
start_pos_z
));
// Configuration
...
...
@@ -99,18 +103,30 @@ int main( int iNumInArgs, char* pcInArgs[] )
const
int
iMaxCombinedOrder
=
4
;
// Generate trajectory
//calculate how many time frames to calculate, and how far to move the source between each timeframe
int
blockLength
=
128
;
int
sampleRate
=
44100
;
float
speed
=
30.0
f
*
1000.0
f
/
(
60.0
f
*
60.0
f
);
//speed in m/s
float
total_y_distance
=
100.0
f
;
float
simulation_time
=
total_y_distance
/
speed
;
//time the car takes to move the simulated distance
int
total_simulated_samples
=
(
int
)
ceil
(
sampleRate
*
simulation_time
);
//total number of samples throughout the simulation
int
total_simulated_blocks
=
(
int
)
ceil
(
total_simulated_samples
/
(
float
)
blockLength
);
//total number of blocks/ updated in the simulation
float
increment_y
=
total_y_distance
/
(
float
)
total_simulated_blocks
;
//how much to increment y each time (+1 to account for starting pos)
ITAStopWatch
sw
;
int
iNumSteps
=
10
;
// @todo henry: determine number of spatial samples
for
(
int
i
=
0
;
i
<
iNumSteps
;
i
++
)
int
iNumSteps
=
total_simulated_blocks
;
for
(
int
i
=
0
;
i
<
=
iNumSteps
;
i
++
)
{
sw
.
start
();
cout
<<
"
\t
---
\t
Simulating frame "
<<
std
::
setw
(
5
)
<<
i
+
1
<<
" of "
<<
iNumSteps
<<
" #### "
<<
endl
;
pVehicle
->
vPos
=
pVehicle
->
vPos
+
VistaVector3D
(
0.01
f
,
0.0
f
,
0.0
f
);
// Move source ... adjust for requested speed @henry.
cout
<<
"
\t
---
\t
Simulating frame "
<<
std
::
setw
(
5
)
<<
i
<<
" of "
<<
iNumSteps
<<
" #### "
<<
endl
;
//pVehicle->vPos = pVehicle->vPos + VistaVector3D( 0.01f, 0.0f, 0.0f );
if
(
i
>
0
)
pVehicle
->
vPos
=
pVehicle
->
vPos
+
VistaVector3D
(
0.0
f
,
increment_y
,
0.0
f
);
auto
pPathEngine
=
make_shared
<
CombinedModel
::
CPathEngine
>
();
pPathEngine
->
Configure
(
bOnlyNeighbouredEdgeDiffraction
,
bDiffractionOnlyIntoShadowedEdges
,
bFilterNotVisiblePathsBetweenEdges
,
bFilterNotVisiblePointToEdge
,
bFilterNotVisiblePointToEdge
,
bFilterNotVisiblePaths
,
iNumIterations
,
fIntersectionTestResolution
);
...
...
@@ -125,7 +141,10 @@ int main( int iNumInArgs, char* pcInArgs[] )
cout
<<
"Visible paths: "
<<
to_string
(
oPathList
.
size
()
)
<<
endl
;
std
::
stringstream
ss
;
ss
<<
sOutputDirectory
<<
"/"
<<
"UrbanTrajectory_pps_"
<<
std
::
setw
(
5
)
<<
std
::
setfill
(
'0'
)
<<
i
+
1
<<
".json"
;
//ss << sOutputDirectory << "/" << "UrbanTrajectory_pps_" << std::setw( 5 ) << std::setfill( '0' ) << i+1 << ".json";
int
n0_characters
=
(
int
)
floor
(
log10
(
iNumSteps
))
+
1
;
ss
<<
sOutputDirectory
<<
"/"
<<
"UrbanTrajectory_pps_"
<<
std
::
setfill
(
'0'
)
<<
std
::
setw
(
n0_characters
)
<<
i
<<
".json"
;
oPathList
.
Store
(
ss
.
str
().
c_str
()
);
cout
<<
"Done in "
<<
timeToString
(
sw
.
stop
()
)
<<
" seconds."
<<
endl
;
...
...
tests/ImageModel/SimpleUrbanImageModelTest.cpp
View file @
f58890bc
...
...
@@ -21,7 +21,6 @@
#include <ITAStopWatch.h>
#include <ITAStringUtils.h>
#include <ITAPropagationModels/include/ITAPropagationModels/FilterEngine.h>
#include <ITABaseDefinitions.h>
#include <ITAPropagationPathSim/UrbanEngine/UrbanImageSource.h>
...
...
tests/MeshModelList/Reflection/SimpleMeshModelImageSourceTest.cpp
View file @
f58890bc
...
...
@@ -21,7 +21,6 @@
#include <ITAStopWatch.h>
#include <ITAStringUtils.h>
#include <ITAPropagationModels/include/ITAPropagationModels/FilterEngine.h>
#include <ITABaseDefinitions.h>
#include <ITAPropagationPathSim/BaseEngine/BaseImageSource.h>
...
...
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