Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
O
objectslam
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
mobile_robotics
wolf_projects
wolf_lib
plugins
objectslam
Commits
6a60bcb8
Commit
6a60bcb8
authored
2 years ago
by
Mederic Fourmy
Browse files
Options
Downloads
Patches
Plain Diff
Indentation pbe and simplify isInliers
parent
0a95818f
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/processor/processor_tracker_landmark_object.cpp
+29
-39
29 additions, 39 deletions
src/processor/processor_tracker_landmark_object.cpp
with
29 additions
and
39 deletions
src/processor/processor_tracker_landmark_object.cpp
+
29
−
39
View file @
6a60bcb8
...
...
@@ -501,41 +501,41 @@ void ProcessorTrackerLandmarkObject::processFeatures(const std::vector<std::pair
const
FeatureBasePtrList
&
_features_out_incoming
)
{
for
(
auto
match
:
_matches_filtered
)
{
auto
feat_last_itr
=
_features_out_last
.
begin
();
auto
feat_incoming_itr
=
_features_out_incoming
.
begin
();
{
auto
feat_last_itr
=
_features_out_last
.
begin
();
auto
feat_incoming_itr
=
_features_out_incoming
.
begin
();
std
::
advance
(
feat_last_itr
,
match
.
first
);
std
::
advance
(
feat_incoming_itr
,
match
.
second
);
std
::
advance
(
feat_last_itr
,
match
.
first
);
std
::
advance
(
feat_incoming_itr
,
match
.
second
);
auto
feat_last
=
*
feat_last_itr
;
auto
feat_incoming
=
*
feat_incoming_itr
;
auto
feat_last
=
*
feat_last_itr
;
auto
feat_incoming
=
*
feat_incoming_itr
;
auto
trackID_feat_last
=
feat_last
->
trackId
();
auto
trackID_feat_last
=
feat_last
->
trackId
();
//Test if the track is defined
if
(
trackID_feat_last
!=
0
)
{
//Add incoming feature to the track
_trackMatrix
.
add
(
feat_last
,
feat_incoming
);
//Test if the track is defined
if
(
trackID_feat_last
!=
0
)
{
//Add incoming feature to the track
_trackMatrix
.
add
(
feat_last
,
feat_incoming
);
auto
size_track_feat_last
=
_trackMatrix
.
trackSize
(
trackID_feat_last
);
auto
size_track_feat_last
=
_trackMatrix
.
trackSize
(
trackID_feat_last
);
if
(
size_track_feat_last
>=
3
)
{
//Create Lmk and join it to feature_last(= match.first)
}
}
//New feature or track lost
else
if
(
size_track_feat_last
>=
3
)
{
//Check if the feature can be linked to a previous defined lmk
//else we create a new track : _trackMatrix.newTrack(match.first) && _trackMatrix.add(match.first, match.second);
//Create Lmk and join it to feature_last(= match.first)
}
}
//New feature or track lost
else
{
//Check if the feature can be linked to a previous defined lmk
//else we create a new track : _trackMatrix.newTrack(match.first) && _trackMatrix.add(match.first, match.second);
}
}
}
void
ProcessorTrackerLandmarkObject
::
filterMatchesOutliers
(
std
::
vector
<
std
::
pair
<
int
,
int
>
>&
_matches
,
const
std
::
vector
<
int
>&
_outliers_idx
)
...
...
@@ -696,22 +696,12 @@ bool ProcessorTrackerLandmarkObject::isInliers(Eigen::Isometry3d _cl_M_ol, Eigen
double
e_rot_th
=
1
;
Eigen
::
Isometry3d
ol_M_cl
=
_cl_M_ol
.
inverse
();
// The object is static between last "l" and incoming "i" so this transformation should be close to identity for inliers
Eigen
::
Isometry3d
ol_M_oi
=
ol_M_cl
*
_cl_M_ci
*
_ci_M_oi
;
Quaterniond
quat_feat
;
Eigen
::
Matrix3d
wRf
=
ol_M_oi
.
linear
();
quat_feat
.
coeffs
()
=
R2q
(
wRf
).
coeffs
().
transpose
();
Vector3d
pos_feat
=
ol_M_oi
.
translation
();
Eigen
::
Isometry3d
identity
=
Eigen
::
Isometry3d
::
Identity
();
Quaterniond
quat_feat_identity
;
Eigen
::
Matrix3d
wRf_i
=
identity
.
linear
();
quat_feat_identity
.
coeffs
()
=
R2q
(
wRf_i
).
coeffs
().
transpose
();
Vector3d
pos_feat_identity
=
identity
.
translation
();
// Error between identity and ol_M_oi
double
e_pos
=
(
pos_feat_identity
-
pos_feat
).
norm
();
double
e_rot
=
log_
q
(
quat_feat_identity
.
conjugate
()
*
quat_feat
).
norm
();
double
e_pos
=
ol_M_oi
.
translation
(
).
norm
();
double
e_rot
=
log_
R
(
ol_M_oi
.
linear
()
).
norm
();
return
(
e_pos
<
e_pos_th
&&
e_rot
<
e_rot_th
);
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment