Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
wolf
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
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
wolf
Commits
60fd7d8b
Commit
60fd7d8b
authored
3 years ago
by
Joan Vallvé Navarro
Browse files
Options
Downloads
Patches
Plain Diff
efficiency issues
parent
d114f33b
No related branches found
No related tags found
1 merge request
!419
Resolve "Processor motion model"
Pipeline
#6733
failed
3 years ago
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
include/core/factor/factor_velocity_direction_3d.h
+5
-4
5 additions, 4 deletions
include/core/factor/factor_velocity_direction_3d.h
with
5 additions
and
4 deletions
include/core/factor/factor_velocity_direction_3d.h
+
5
−
4
View file @
60fd7d8b
...
@@ -17,7 +17,7 @@ WOLF_PTR_TYPEDEFS(FactorVelocityDirection3d);
...
@@ -17,7 +17,7 @@ WOLF_PTR_TYPEDEFS(FactorVelocityDirection3d);
class
FactorVelocityDirection3d
:
public
FactorAutodiff
<
FactorVelocityDirection3d
,
1
,
3
,
4
>
class
FactorVelocityDirection3d
:
public
FactorAutodiff
<
FactorVelocityDirection3d
,
1
,
3
,
4
>
{
{
protected:
protected:
double
min_vel_norm_
;
double
min_vel_
sq_
norm_
;
// stored in squared norm for efficiency
public:
public:
FactorVelocityDirection3d
(
FeatureBasePtr
_ftr_ptr
,
FactorVelocityDirection3d
(
FeatureBasePtr
_ftr_ptr
,
...
@@ -34,8 +34,9 @@ class FactorVelocityDirection3d: public FactorAutodiff<FactorVelocityDirection3d
...
@@ -34,8 +34,9 @@ class FactorVelocityDirection3d: public FactorAutodiff<FactorVelocityDirection3d
_status
,
_status
,
_ftr_ptr
->
getFrame
()
->
getV
(),
_ftr_ptr
->
getFrame
()
->
getV
(),
_ftr_ptr
->
getFrame
()
->
getO
()),
_ftr_ptr
->
getFrame
()
->
getO
()),
min_vel_norm_
(
_min_vel_norm
)
min_vel_
sq_
norm_
(
_min_vel_norm
*
_min_vel_norm
)
{
{
assert
(
abs
(
_ftr_ptr
->
getMeasurement
().
norm
()
-
1.0
)
<
wolf
::
EPS
&&
"velocity direction measurement must be normalized"
);
// std::cout << "created FactorVelocityDirection3d " << std::endl;
// std::cout << "created FactorVelocityDirection3d " << std::endl;
}
}
...
@@ -51,7 +52,7 @@ inline bool FactorVelocityDirection3d::operator ()(const T* const _v, const T* c
...
@@ -51,7 +52,7 @@ inline bool FactorVelocityDirection3d::operator ()(const T* const _v, const T* c
Eigen
::
Map
<
const
Eigen
::
Matrix
<
T
,
3
,
1
>
>
v
(
_v
);
Eigen
::
Map
<
const
Eigen
::
Matrix
<
T
,
3
,
1
>
>
v
(
_v
);
Eigen
::
Map
<
const
Eigen
::
Quaternion
<
T
>
>
q
(
_q
);
Eigen
::
Map
<
const
Eigen
::
Quaternion
<
T
>
>
q
(
_q
);
if
(
v
.
n
orm
()
<
min_vel_norm_
)
if
(
v
.
squaredN
orm
()
<
min_vel_
sq_
norm_
)
{
{
_residuals
[
0
]
=
T
(
0
);
_residuals
[
0
]
=
T
(
0
);
return
true
;
return
true
;
...
@@ -73,7 +74,7 @@ inline bool FactorVelocityDirection3d::operator ()(const T* const _v, const T* c
...
@@ -73,7 +74,7 @@ inline bool FactorVelocityDirection3d::operator ()(const T* const _v, const T* c
// << v_local(2) << "\n";
// << v_local(2) << "\n";
// error (angle between measurement and velocity in local coordinates)
// error (angle between measurement and velocity in local coordinates)
T
error
=
acos
(
v_local
.
dot
(
getMeasurement
().
cast
<
T
>
())
/
(
v_local
.
norm
()
*
getMeasurement
().
cast
<
T
>
().
norm
()
));
T
error
=
acos
(
v_local
.
dot
(
getMeasurement
().
cast
<
T
>
())
/
(
v_local
.
norm
()));
// residual
// residual
_residuals
[
0
]
=
getMeasurementSquareRootInformationUpper
()(
0
,
0
)
*
error
;
_residuals
[
0
]
=
getMeasurementSquareRootInformationUpper
()(
0
,
0
)
*
error
;
...
...
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