Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
M
multiTraj
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wangdawei
multiTraj
Commits
27de9ea2
Commit
27de9ea2
authored
Dec 29, 2021
by
limingbo
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
test
parent
390d06a0
Pipeline
#861
canceled with stages
Changes
4
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
29 additions
and
7 deletions
+29
-7
multi_traj_functions.cpp
apps/function/multi_traj_functions.cpp
+14
-6
multi_traj_functions.h
apps/function/multi_traj_functions.h
+3
-1
trajectory.cpp
libs/trajectory/trajectory.cpp
+10
-0
trajectory.h
libs/trajectory/trajectory.h
+2
-0
No files found.
apps/function/multi_traj_functions.cpp
View file @
27de9ea2
...
@@ -81,7 +81,7 @@ vector<string> getCrossTasks(
...
@@ -81,7 +81,7 @@ vector<string> getCrossTasks(
trajectories
.
push_back
(
currTraj
);
trajectories
.
push_back
(
currTraj
);
vector
<
PointCloudExport
::
Ptr
>
pointClouds
vector
<
PointCloudExport
::
Ptr
>
pointClouds
=
multiThreadGetPointCloud
(
trajectories
);
=
multiThreadGetPointCloud
(
trajectories
,
currTraj
->
getProj
()
);
float
resolution
=
5.
f
;
float
resolution
=
5.
f
;
pcl
::
octree
::
OctreePointCloudSearch
<
PointExport
>
octree
(
resolution
);
pcl
::
octree
::
OctreePointCloudSearch
<
PointExport
>
octree
(
resolution
);
...
@@ -133,7 +133,8 @@ void initTrajectory(
...
@@ -133,7 +133,8 @@ void initTrajectory(
}
}
vector
<
PointCloudExport
::
Ptr
>
multiThreadGetPointCloud
(
vector
<
PointCloudExport
::
Ptr
>
multiThreadGetPointCloud
(
vector
<
boost
::
shared_ptr
<
Trajectory
>>
&
trajectories
)
vector
<
boost
::
shared_ptr
<
Trajectory
>>
&
trajectories
,
boost
::
shared_ptr
<
LocalCartesian
>
proj
)
{
{
vector
<
ThreadPtr
>
thread_vec
;
vector
<
ThreadPtr
>
thread_vec
;
vector
<
PointCloudExport
::
Ptr
>
pointClouds
;
vector
<
PointCloudExport
::
Ptr
>
pointClouds
;
...
@@ -141,6 +142,7 @@ vector<PointCloudExport::Ptr> multiThreadGetPointCloud(
...
@@ -141,6 +142,7 @@ vector<PointCloudExport::Ptr> multiThreadGetPointCloud(
for
(
uint8_t
thread_index
=
0
;
thread_index
<
trajectories
.
size
();
thread_index
++
){
for
(
uint8_t
thread_index
=
0
;
thread_index
<
trajectories
.
size
();
thread_index
++
){
thread_vec
.
emplace_back
(
ThreadPtr
(
new
boost
::
thread
(
boost
::
bind
(
&
getPointCloud
,
thread_vec
.
emplace_back
(
ThreadPtr
(
new
boost
::
thread
(
boost
::
bind
(
&
getPointCloud
,
proj
,
trajectories
[
thread_index
],
trajectories
[
thread_index
],
pointClouds
[
thread_index
]))));
pointClouds
[
thread_index
]))));
}
}
...
@@ -151,7 +153,7 @@ vector<PointCloudExport::Ptr> multiThreadGetPointCloud(
...
@@ -151,7 +153,7 @@ vector<PointCloudExport::Ptr> multiThreadGetPointCloud(
return
pointClouds
;
return
pointClouds
;
}
}
void
getPointCloud
(
void
getPointCloud
(
boost
::
shared_ptr
<
LocalCartesian
>
proj
,
boost
::
shared_ptr
<
Trajectory
>
&
trajectory
,
boost
::
shared_ptr
<
Trajectory
>
&
trajectory
,
PointCloudExport
::
Ptr
&
pointCloud
)
PointCloudExport
::
Ptr
&
pointCloud
)
{
{
...
@@ -161,9 +163,15 @@ void getPointCloud(
...
@@ -161,9 +163,15 @@ void getPointCloud(
vector
<
TrajPoint
>
traj
=
trajectory
->
getTrajectory
();
vector
<
TrajPoint
>
traj
=
trajectory
->
getTrajectory
();
for
(
const
TrajPoint
&
trajPoint
:
traj
){
for
(
const
TrajPoint
&
trajPoint
:
traj
){
PointExport
point
;
PointExport
point
;
point
.
x
=
trajPoint
.
translation
.
x
();
Vector3d
llh
=
trajectory
->
reverse
(
trajPoint
);
point
.
y
=
trajPoint
.
translation
.
y
();
Vector3d
translation
;
point
.
z
=
trajPoint
.
translation
.
z
();
proj
->
Forward
(
llh
.
x
(),
llh
.
y
(),
llh
.
x
(),
translation
.
x
(),
translation
.
y
(),
translation
.
z
());
point
.
x
=
translation
.
x
();
point
.
y
=
translation
.
y
();
point
.
z
=
translation
.
z
();
pointCloud
->
push_back
(
point
);
pointCloud
->
push_back
(
point
);
}
}
}
}
apps/function/multi_traj_functions.h
View file @
27de9ea2
...
@@ -24,9 +24,11 @@ void initTrajectory(const string &iePath,
...
@@ -24,9 +24,11 @@ void initTrajectory(const string &iePath,
boost
::
shared_ptr
<
Trajectory
>
&
trajectory
);
boost
::
shared_ptr
<
Trajectory
>
&
trajectory
);
vector
<
PointCloudExport
::
Ptr
>
multiThreadGetPointCloud
(
vector
<
PointCloudExport
::
Ptr
>
multiThreadGetPointCloud
(
vector
<
boost
::
shared_ptr
<
Trajectory
>
>
&
trajectories
);
vector
<
boost
::
shared_ptr
<
Trajectory
>
>
&
trajectories
,
boost
::
shared_ptr
<
LocalCartesian
>
proj
);
void
getPointCloud
(
void
getPointCloud
(
boost
::
shared_ptr
<
LocalCartesian
>
proj
,
boost
::
shared_ptr
<
Trajectory
>
&
trajectory
,
boost
::
shared_ptr
<
Trajectory
>
&
trajectory
,
PointCloudExport
::
Ptr
&
pointCloud
);
PointCloudExport
::
Ptr
&
pointCloud
);
#endif // MULTI_TRAJ_FUNCTIONS_H
#endif // MULTI_TRAJ_FUNCTIONS_H
libs/trajectory/trajectory.cpp
View file @
27de9ea2
...
@@ -261,6 +261,16 @@ boost::shared_ptr<LocalCartesian> Trajectory::getProj() const
...
@@ -261,6 +261,16 @@ boost::shared_ptr<LocalCartesian> Trajectory::getProj() const
return
proj_
;
return
proj_
;
}
}
Vector3d
Trajectory
::
reverse
(
const
TrajPoint
&
trajPoint
)
{
Vector3d
llh
;
proj_
->
Reverse
(
trajPoint
.
translation
.
x
(),
trajPoint
.
translation
.
y
(),
trajPoint
.
translation
.
z
(),
llh
.
x
(),
llh
.
y
(),
llh
.
x
());
return
llh
;
}
double
Trajectory
::
getFrequency
()
double
Trajectory
::
getFrequency
()
{
{
return
frequency_
;
return
frequency_
;
...
...
libs/trajectory/trajectory.h
View file @
27de9ea2
...
@@ -41,6 +41,8 @@ public:
...
@@ -41,6 +41,8 @@ public:
boost
::
shared_ptr
<
LocalCartesian
>
getProj
()
const
;
boost
::
shared_ptr
<
LocalCartesian
>
getProj
()
const
;
Vector3d
reverse
(
const
TrajPoint
&
trajPoint
);
double
getFrequency
();
double
getFrequency
();
private
:
private
:
bool
checkSatisfied
(
const
int32_t
&
supposed_floor_index
,
const
double
&
timestamp
)
const
;
bool
checkSatisfied
(
const
int32_t
&
supposed_floor_index
,
const
double
&
timestamp
)
const
;
...
...
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