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
da46d8d5
Commit
da46d8d5
authored
3 years ago
by
Joan Vallvé Navarro
Browse files
Options
Downloads
Patches
Plain Diff
asserts for sizes
parent
e798de7a
No related branches found
No related tags found
1 merge request
!419
Resolve "Processor motion model"
Pipeline
#6736
passed
3 years ago
Stage: build
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
include/core/factor/factor_relative_pose_3d.h
+2
-0
2 additions, 0 deletions
include/core/factor/factor_relative_pose_3d.h
include/core/factor/factor_velocity_direction_3d.h
+10
-4
10 additions, 4 deletions
include/core/factor/factor_velocity_direction_3d.h
with
12 additions
and
4 deletions
include/core/factor/factor_relative_pose_3d.h
+
2
−
0
View file @
da46d8d5
...
...
@@ -93,6 +93,8 @@ inline FactorRelativePose3d::FactorRelativePose3d(const FeatureBasePtr& _ftr_cur
_frame_past_ptr
->
getP
(),
// past frame P
_frame_past_ptr
->
getO
())
// past frame Q
{
MatrixSizeCheck
<
7
,
1
>::
check
(
_ftr_current_ptr
->
getMeasurement
());
MatrixSizeCheck
<
6
,
6
>::
check
(
_ftr_current_ptr
->
getMeasurementSquareRootInformationUpper
());
}
template
<
typename
T
>
...
...
This diff is collapsed.
Click to expand it.
include/core/factor/factor_velocity_direction_3d.h
+
10
−
4
View file @
da46d8d5
...
...
@@ -36,8 +36,9 @@ class FactorVelocityDirection3d: public FactorAutodiff<FactorVelocityDirection3d
_ftr_ptr
->
getFrame
()
->
getO
()),
min_vel_sq_norm_
(
_min_vel_norm
*
_min_vel_norm
)
{
MatrixSizeCheck
<
3
,
1
>::
check
(
_ftr_ptr
->
getMeasurement
());
MatrixSizeCheck
<
1
,
1
>::
check
(
_ftr_ptr
->
getMeasurementSquareRootInformationUpper
());
assert
(
abs
(
_ftr_ptr
->
getMeasurement
().
norm
()
-
1.0
)
<
wolf
::
Constants
::
EPS
&&
"velocity direction measurement must be normalized"
);
// std::cout << "created FactorVelocityDirection3d " << std::endl;
}
~
FactorVelocityDirection3d
()
override
=
default
;
...
...
@@ -73,11 +74,16 @@ inline bool FactorVelocityDirection3d::operator ()(const T* const _v, const T* c
// << v_local(1) << " "
// << v_local(2) << "\n";
// error (angle between measurement and velocity in local coordinates)
T
error
=
acos
(
v_local
.
dot
(
getMeasurement
())
/
(
v_local
.
norm
()));
// error: angle between specified local velocity direction (measurement) and velocity in local coordinates
T
cos_error
=
v_local
.
dot
(
getMeasurement
())
/
(
v_local
.
norm
());
// direction already normalized
while
(
cos_error
>
T
(
1
))
cos_error
/=
T
(
0.99
);
//std::cout << "FactorVelocityDirection3d cos_error = " << cos_error << std::endl;
//std::cout << "FactorVelocityDirection3d error = " << acos(error) << std::endl;
// residual
_residuals
[
0
]
=
getMeasurementSquareRootInformationUpper
()(
0
,
0
)
*
error
;
_residuals
[
0
]
=
getMeasurementSquareRootInformationUpper
()(
0
,
0
)
*
acos
(
cos_
error
)
;
return
true
;
}
...
...
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