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
f6fee304
Commit
f6fee304
authored
5 years ago
by
Joan Solà Ortega
Browse files
Options
Downloads
Patches
Plain Diff
Use for(auto& ...) instead of for(auto ...)
parent
6b3fe415
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Pipeline
#4532
passed
5 years ago
Stage: build
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
hello_wolf/hello_wolf.cpp
+14
-14
14 additions, 14 deletions
hello_wolf/hello_wolf.cpp
hello_wolf/hello_wolf_autoconf.cpp
+13
-13
13 additions, 13 deletions
hello_wolf/hello_wolf_autoconf.cpp
with
27 additions
and
27 deletions
hello_wolf/hello_wolf.cpp
+
14
−
14
View file @
f6fee304
...
@@ -148,7 +148,7 @@ int main()
...
@@ -148,7 +148,7 @@ int main()
// SELF-CALIBRATION OF SENSOR ORIENTATION
// SELF-CALIBRATION OF SENSOR ORIENTATION
// Uncomment this line below to achieve sensor self-calibration (of the orientation only, since the position is not observable)
// Uncomment this line below to achieve sensor self-calibration (of the orientation only, since the position is not observable)
//
sensor_rb->getO()->unfix();
sensor_rb
->
getO
()
->
unfix
();
// SELF-CALIBRATION OF SENSOR POSITION
// SELF-CALIBRATION OF SENSOR POSITION
// The position is however not observable, and thus self-calibration would not work. You can try uncommenting the line below.
// The position is however not observable, and thus self-calibration would not work. You can try uncommenting the line below.
...
@@ -221,17 +221,17 @@ int main()
...
@@ -221,17 +221,17 @@ int main()
// PERTURB initial guess
// PERTURB initial guess
WOLF_TRACE
(
"======== PERTURB PROBLEM PRIORS ======="
)
WOLF_TRACE
(
"======== PERTURB PROBLEM PRIORS ======="
)
for
(
auto
sen
:
problem
->
getHardware
()
->
getSensorList
())
for
(
auto
&
sen
:
problem
->
getHardware
()
->
getSensorList
())
for
(
auto
sb
:
sen
->
getStateBlockVec
())
for
(
auto
&
sb
:
sen
->
getStateBlockVec
())
if
(
sb
&&
!
sb
->
isFixed
())
if
(
sb
&&
!
sb
->
isFixed
())
sb
->
setState
(
sb
->
getState
()
+
VectorXs
::
Random
(
sb
->
getSize
())
*
0.5
);
// We perturb A LOT !
sb
->
setState
(
sb
->
getState
()
+
VectorXs
::
Random
(
sb
->
getSize
())
*
0.5
);
// We perturb A LOT !
for
(
auto
kf
:
problem
->
getTrajectory
()
->
getFrameList
())
for
(
auto
&
kf
:
problem
->
getTrajectory
()
->
getFrameList
())
if
(
kf
->
isKeyOrAux
())
if
(
kf
->
isKeyOrAux
())
for
(
auto
sb
:
kf
->
getStateBlockVec
())
for
(
auto
&
sb
:
kf
->
getStateBlockVec
())
if
(
sb
&&
!
sb
->
isFixed
())
if
(
sb
&&
!
sb
->
isFixed
())
sb
->
setState
(
sb
->
getState
()
+
VectorXs
::
Random
(
sb
->
getSize
())
*
0.5
);
// We perturb A LOT !
sb
->
setState
(
sb
->
getState
()
+
VectorXs
::
Random
(
sb
->
getSize
())
*
0.5
);
// We perturb A LOT !
for
(
auto
lmk
:
problem
->
getMap
()
->
getLandmarkList
())
for
(
auto
&
lmk
:
problem
->
getMap
()
->
getLandmarkList
())
for
(
auto
sb
:
lmk
->
getStateBlockVec
())
for
(
auto
&
sb
:
lmk
->
getStateBlockVec
())
if
(
sb
&&
!
sb
->
isFixed
())
if
(
sb
&&
!
sb
->
isFixed
())
sb
->
setState
(
sb
->
getState
()
+
VectorXs
::
Random
(
sb
->
getSize
())
*
0.5
);
// We perturb A LOT !
sb
->
setState
(
sb
->
getState
()
+
VectorXs
::
Random
(
sb
->
getSize
())
*
0.5
);
// We perturb A LOT !
problem
->
print
(
1
,
0
,
1
,
0
);
problem
->
print
(
1
,
0
,
1
,
0
);
...
@@ -245,19 +245,19 @@ int main()
...
@@ -245,19 +245,19 @@ int main()
// GET COVARIANCES of all states
// GET COVARIANCES of all states
WOLF_TRACE
(
"======== COVARIANCES OF SOLVED PROBLEM ======="
)
WOLF_TRACE
(
"======== COVARIANCES OF SOLVED PROBLEM ======="
)
ceres
->
computeCovariances
(
SolverManager
::
CovarianceBlocksToBeComputed
::
ALL_MARGINALS
);
ceres
->
computeCovariances
(
SolverManager
::
CovarianceBlocksToBeComputed
::
ALL_MARGINALS
);
for
(
auto
kf
:
problem
->
getTrajectory
()
->
getFrameList
())
for
(
auto
&
kf
:
problem
->
getTrajectory
()
->
getFrameList
())
if
(
kf
->
isKeyOrAux
())
if
(
kf
->
isKeyOrAux
())
{
{
Eigen
::
MatrixXs
cov
;
Eigen
::
MatrixXs
cov
;
kf
->
getCovariance
(
cov
);
kf
->
getCovariance
(
cov
);
WOLF_TRACE
(
"KF"
,
kf
->
id
(),
"_cov =
\n
"
,
cov
);
WOLF_TRACE
(
"KF"
,
kf
->
id
(),
"_cov =
\n
"
,
cov
);
}
}
for
(
auto
lmk
:
problem
->
getMap
()
->
getLandmarkList
())
for
(
auto
&
lmk
:
problem
->
getMap
()
->
getLandmarkList
())
{
{
Eigen
::
MatrixXs
cov
;
Eigen
::
MatrixXs
cov
;
lmk
->
getCovariance
(
cov
);
lmk
->
getCovariance
(
cov
);
WOLF_TRACE
(
"L"
,
lmk
->
id
(),
"_cov =
\n
"
,
cov
);
WOLF_TRACE
(
"L"
,
lmk
->
id
(),
"_cov =
\n
"
,
cov
);
}
}
std
::
cout
<<
std
::
endl
;
std
::
cout
<<
std
::
endl
;
WOLF_TRACE
(
"======== FINAL PRINT FOR INTERPRETATION ======="
)
WOLF_TRACE
(
"======== FINAL PRINT FOR INTERPRETATION ======="
)
...
...
This diff is collapsed.
Click to expand it.
hello_wolf/hello_wolf_autoconf.cpp
+
13
−
13
View file @
f6fee304
...
@@ -204,17 +204,17 @@ int main()
...
@@ -204,17 +204,17 @@ int main()
// PERTURB initial guess
// PERTURB initial guess
WOLF_TRACE
(
"======== PERTURB PROBLEM PRIORS ======="
)
WOLF_TRACE
(
"======== PERTURB PROBLEM PRIORS ======="
)
for
(
auto
sen
:
problem
->
getHardware
()
->
getSensorList
())
for
(
auto
&
sen
:
problem
->
getHardware
()
->
getSensorList
())
for
(
auto
sb
:
sen
->
getStateBlockVec
())
for
(
auto
&
sb
:
sen
->
getStateBlockVec
())
if
(
sb
&&
!
sb
->
isFixed
())
if
(
sb
&&
!
sb
->
isFixed
())
sb
->
setState
(
sb
->
getState
()
+
VectorXs
::
Random
(
sb
->
getSize
())
*
0.5
);
// We perturb A LOT !
sb
->
setState
(
sb
->
getState
()
+
VectorXs
::
Random
(
sb
->
getSize
())
*
0.5
);
// We perturb A LOT !
for
(
auto
kf
:
problem
->
getTrajectory
()
->
getFrameList
())
for
(
auto
&
kf
:
problem
->
getTrajectory
()
->
getFrameList
())
if
(
kf
->
isKeyOrAux
())
if
(
kf
->
isKeyOrAux
())
for
(
auto
sb
:
kf
->
getStateBlockVec
())
for
(
auto
&
sb
:
kf
->
getStateBlockVec
())
if
(
sb
&&
!
sb
->
isFixed
())
if
(
sb
&&
!
sb
->
isFixed
())
sb
->
setState
(
sb
->
getState
()
+
VectorXs
::
Random
(
sb
->
getSize
())
*
0.5
);
// We perturb A LOT !
sb
->
setState
(
sb
->
getState
()
+
VectorXs
::
Random
(
sb
->
getSize
())
*
0.5
);
// We perturb A LOT !
for
(
auto
lmk
:
problem
->
getMap
()
->
getLandmarkList
())
for
(
auto
&
lmk
:
problem
->
getMap
()
->
getLandmarkList
())
for
(
auto
sb
:
lmk
->
getStateBlockVec
())
for
(
auto
&
sb
:
lmk
->
getStateBlockVec
())
if
(
sb
&&
!
sb
->
isFixed
())
if
(
sb
&&
!
sb
->
isFixed
())
sb
->
setState
(
sb
->
getState
()
+
VectorXs
::
Random
(
sb
->
getSize
())
*
0.5
);
// We perturb A LOT !
sb
->
setState
(
sb
->
getState
()
+
VectorXs
::
Random
(
sb
->
getSize
())
*
0.5
);
// We perturb A LOT !
problem
->
print
(
1
,
0
,
1
,
0
);
problem
->
print
(
1
,
0
,
1
,
0
);
...
@@ -228,19 +228,19 @@ int main()
...
@@ -228,19 +228,19 @@ int main()
// GET COVARIANCES of all states
// GET COVARIANCES of all states
WOLF_TRACE
(
"======== COVARIANCES OF SOLVED PROBLEM ======="
)
WOLF_TRACE
(
"======== COVARIANCES OF SOLVED PROBLEM ======="
)
ceres
->
computeCovariances
(
SolverManager
::
CovarianceBlocksToBeComputed
::
ALL_MARGINALS
);
ceres
->
computeCovariances
(
SolverManager
::
CovarianceBlocksToBeComputed
::
ALL_MARGINALS
);
for
(
auto
kf
:
problem
->
getTrajectory
()
->
getFrameList
())
for
(
auto
&
kf
:
problem
->
getTrajectory
()
->
getFrameList
())
if
(
kf
->
isKeyOrAux
())
if
(
kf
->
isKeyOrAux
())
{
{
Eigen
::
MatrixXs
cov
;
Eigen
::
MatrixXs
cov
;
kf
->
getCovariance
(
cov
);
kf
->
getCovariance
(
cov
);
WOLF_TRACE
(
"KF"
,
kf
->
id
(),
"_cov =
\n
"
,
cov
);
WOLF_TRACE
(
"KF"
,
kf
->
id
(),
"_cov =
\n
"
,
cov
);
}
}
for
(
auto
lmk
:
problem
->
getMap
()
->
getLandmarkList
())
for
(
auto
&
lmk
:
problem
->
getMap
()
->
getLandmarkList
())
{
{
Eigen
::
MatrixXs
cov
;
Eigen
::
MatrixXs
cov
;
lmk
->
getCovariance
(
cov
);
lmk
->
getCovariance
(
cov
);
WOLF_TRACE
(
"L"
,
lmk
->
id
(),
"_cov =
\n
"
,
cov
);
WOLF_TRACE
(
"L"
,
lmk
->
id
(),
"_cov =
\n
"
,
cov
);
}
}
std
::
cout
<<
std
::
endl
;
std
::
cout
<<
std
::
endl
;
WOLF_TRACE
(
"======== FINAL PRINT FOR INTERPRETATION ======="
)
WOLF_TRACE
(
"======== FINAL PRINT FOR INTERPRETATION ======="
)
...
...
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