Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
G
gnss
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Model registry
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor 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
gnss
Commits
f3d536a1
Commit
f3d536a1
authored
10 years ago
by
jvallve
Browse files
Options
Downloads
Patches
Plain Diff
No commit message
No commit message
parent
f67818f7
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/capture_laser_2D.cpp
+7
-7
7 additions, 7 deletions
src/capture_laser_2D.cpp
src/examples/test_ceres_2_lasers.cpp
+17
-14
17 additions, 14 deletions
src/examples/test_ceres_2_lasers.cpp
with
24 additions
and
21 deletions
src/capture_laser_2D.cpp
+
7
−
7
View file @
f3d536a1
...
@@ -97,7 +97,7 @@ void CaptureLaser2D::establishConstraints()
...
@@ -97,7 +97,7 @@ void CaptureLaser2D::establishConstraints()
for
(
auto
feature_it
=
getFeatureListPtr
()
->
begin
();
feature_it
!=
getFeatureListPtr
()
->
end
();
feature_it
++
)
for
(
auto
feature_it
=
getFeatureListPtr
()
->
begin
();
feature_it
!=
getFeatureListPtr
()
->
end
();
feature_it
++
)
{
{
double
max_distance_matching2
=
0.5
;
//TODO: max_distance_matching depending on localization and landmarks uncertainty
double
max_distance_matching2
=
0.5
;
//TODO: max_distance_matching depending on localization and landmarks uncertainty
double
max_theta_matching
=
0.2
;
//TODO: max_theta_matching depending on localization and landmarks uncertainty
double
max_theta_matching
=
M_PI
/
8
;
//TODO: max_theta_matching depending on localization and landmarks uncertainty
//Find the closest landmark to the feature
//Find the closest landmark to the feature
LandmarkCorner2D
*
correspondent_landmark
=
nullptr
;
LandmarkCorner2D
*
correspondent_landmark
=
nullptr
;
...
@@ -127,18 +127,18 @@ void CaptureLaser2D::establishConstraints()
...
@@ -127,18 +127,18 @@ void CaptureLaser2D::establishConstraints()
{
{
if
(
theta_distance
<
max_theta_matching
)
if
(
theta_distance
<
max_theta_matching
)
{
{
//
std::cout << "Position & orientation near landmark found: " << (*landmark_it)->nodeId() << std::endl;
//
std::cout << "Position & orientation near landmark found: " << (*landmark_it)->nodeId() << std::endl;
//
std::cout << "global position:" << landmark_position.transpose() << " orientation:" << landmark_orientation << std::endl;
//
std::cout << "global position:" << landmark_position.transpose() << " orientation:" << landmark_orientation << std::endl;
correspondent_landmark
=
(
LandmarkCorner2D
*
)(
*
landmark_it
);
correspondent_landmark
=
(
LandmarkCorner2D
*
)(
*
landmark_it
);
min_distance2
=
distance2
;
min_distance2
=
distance2
;
}
}
else
else
{
{
//
std::cout << "Feature: " << (*feature_it)->nodeId() << std::endl;
std
::
cout
<<
"Feature: "
<<
(
*
feature_it
)
->
nodeId
()
<<
std
::
endl
;
//
std::cout << "global position:" << feature_global_position.transpose() << " orientation:" << feature_global_orientation << std::endl;
std
::
cout
<<
"global position:"
<<
feature_global_position
.
transpose
()
<<
" orientation:"
<<
feature_global_orientation
<<
std
::
endl
;
//
std::cout << "Landmark with near position but wrong orientation: " << (*landmark_it)->nodeId() << std::endl;
std
::
cout
<<
"Landmark with near position but wrong orientation: "
<<
(
*
landmark_it
)
->
nodeId
()
<<
std
::
endl
;
//
std::cout << "global position:" << landmark_position.transpose() << " orientation:" << landmark_orientation << std::endl;
std
::
cout
<<
"global position:"
<<
landmark_position
.
transpose
()
<<
" orientation:"
<<
landmark_orientation
<<
std
::
endl
;
}
}
}
}
}
}
...
...
This diff is collapsed.
Click to expand it.
src/examples/test_ceres_2_lasers.cpp
+
17
−
14
View file @
f3d536a1
...
@@ -112,6 +112,7 @@ class WolfManager
...
@@ -112,6 +112,7 @@ class WolfManager
SensorBase
*
sensor_prior_
;
SensorBase
*
sensor_prior_
;
unsigned
int
window_size_
;
unsigned
int
window_size_
;
FrameBaseIter
first_window_frame_
;
FrameBaseIter
first_window_frame_
;
CaptureRelative
*
last_capture_relative_
;
public:
public:
WolfManager
(
SensorBase
*
_sensor_prior
,
const
bool
_complex_angle
,
const
unsigned
int
&
_state_length
,
const
Eigen
::
VectorXs
&
_init_frame
,
const
unsigned
int
&
_w_size
=
10
)
:
WolfManager
(
SensorBase
*
_sensor_prior
,
const
bool
_complex_angle
,
const
unsigned
int
&
_state_length
,
const
Eigen
::
VectorXs
&
_init_frame
,
const
unsigned
int
&
_w_size
=
10
)
:
...
@@ -151,6 +152,7 @@ class WolfManager
...
@@ -151,6 +152,7 @@ class WolfManager
sensor_prior_
,
sensor_prior_
,
Eigen
::
Vector2s
::
Zero
(),
Eigen
::
Vector2s
::
Zero
(),
Eigen
::
Matrix2s
::
Zero
()));
Eigen
::
Matrix2s
::
Zero
()));
last_capture_relative_
=
(
CaptureRelative
*
)(
problem_
->
getTrajectoryPtr
()
->
getFrameListPtr
()
->
back
()
->
getCaptureListPtr
()
->
front
());
}
}
void
addCapture
(
CaptureBase
*
_capture
)
void
addCapture
(
CaptureBase
*
_capture
)
...
@@ -171,21 +173,22 @@ class WolfManager
...
@@ -171,21 +173,22 @@ class WolfManager
if
(
new_capture
->
getSensorPtr
()
==
sensor_prior_
)
if
(
new_capture
->
getSensorPtr
()
==
sensor_prior_
)
{
{
// FIND PREVIOUS RELATIVE CAPTURE
// FIND PREVIOUS RELATIVE CAPTURE
CaptureRelative
*
previous_relative_capture
=
nullptr
;
//
CaptureRelative* previous_relative_capture = nullptr;
for
(
auto
capture_it
=
problem_
->
getTrajectoryPtr
()
->
getFrameListPtr
()
->
back
()
->
getCaptureListPtr
()
->
begin
();
capture_it
!=
problem_
->
getTrajectoryPtr
()
->
getFrameListPtr
()
->
back
()
->
getCaptureListPtr
()
->
end
();
capture_it
++
)
//
for (auto capture_it = problem_->getTrajectoryPtr()->getFrameListPtr()->back()->getCaptureListPtr()->begin(); capture_it != problem_->getTrajectoryPtr()->getFrameListPtr()->back()->getCaptureListPtr()->end(); capture_it++)
{
//
{
//std::cout << "capture: " << (*capture_it)->nodeId() << std::endl;
//
//std::cout << "capture: " << (*capture_it)->nodeId() << std::endl;
if
((
*
capture_it
)
->
getSensorPtr
()
==
sensor_prior_
)
//
if ((*capture_it)->getSensorPtr() == sensor_prior_)
{
//
{
previous_relative_capture
=
(
CaptureRelative
*
)(
*
capture_it
);
//
previous_relative_capture = (CaptureRelative*)(*capture_it);
break
;
//
break;
}
//
}
}
//
}
// INTEGRATING ODOMETRY CAPTURE & COMPUTING PRIOR
// INTEGRATING ODOMETRY CAPTURE & COMPUTING PRIOR
//std::cout << "integrating captures " << previous_relative_capture->nodeId() << " " << new_capture->nodeId() << std::endl;
//std::cout << "integrating captures " << previous_relative_capture->nodeId() << " " << new_capture->nodeId() << std::endl;
previous_relative_capture
->
integrateCapture
((
CaptureRelative
*
)(
new_capture
));
// previous_relative_capture->integrateCapture((CaptureRelative*)(new_capture));
Eigen
::
VectorXs
prior
=
previous_relative_capture
->
computePrior
();
// Eigen::VectorXs prior = previous_relative_capture->computePrior();
last_capture_relative_
->
integrateCapture
((
CaptureRelative
*
)(
new_capture
));
// NEW KEY FRAME (if enough time from last frame)
// NEW KEY FRAME (if enough time from last frame)
//std::cout << "new TimeStamp - last Frame TimeStamp = " << new_capture->getTimeStamp().get() - problem_->getTrajectoryPtr()->getFrameListPtr()->back()->getTimeStamp().get() << std::endl;
//std::cout << "new TimeStamp - last Frame TimeStamp = " << new_capture->getTimeStamp().get() - problem_->getTrajectoryPtr()->getFrameListPtr()->back()->getTimeStamp().get() << std::endl;
...
@@ -196,7 +199,7 @@ class WolfManager
...
@@ -196,7 +199,7 @@ class WolfManager
// NEW FRAME
// NEW FRAME
//std::cout << "new frame" << std::endl;
//std::cout << "new frame" << std::endl;
createFrame
(
p
rior
,
new_capture
->
getTimeStamp
());
createFrame
(
last_capture_relative_
->
computeP
rior
()
,
new_capture
->
getTimeStamp
());
// COMPUTE PREVIOUS FRAME CAPTURES
// COMPUTE PREVIOUS FRAME CAPTURES
//std::cout << "compute prev frame" << std::endl;
//std::cout << "compute prev frame" << std::endl;
...
@@ -237,7 +240,7 @@ class WolfManager
...
@@ -237,7 +240,7 @@ class WolfManager
Eigen
::
VectorXs
getVehiclePose
()
Eigen
::
VectorXs
getVehiclePose
()
{
{
return
Eigen
::
Map
<
Eigen
::
VectorXs
>
(
problem_
->
getTrajectoryPtr
()
->
getFrameListPtr
()
->
back
()
->
getPPtr
()
->
getPtr
(),
use_complex_angles_
?
4
:
3
);
return
last_capture_relative_
->
computePrior
(
);
}
}
WolfProblem
*
getProblemPtr
()
WolfProblem
*
getProblemPtr
()
...
...
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