Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
W
wolf_ros_vision
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
Package Registry
Model registry
Operate
Environments
Terraform modules
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_ros
wolf_ros_vision
Commits
31d522a7
Commit
31d522a7
authored
3 years ago
by
ydepledt
Browse files
Options
Downloads
Patches
Plain Diff
Change feature dependencies in functions into capture dependencies
parent
7aa36c92
No related branches found
No related tags found
2 merge requests
!3
After cmake and const refactor
,
!1
Resolve "Publisher for visual odometry"
Pipeline
#9693
failed
3 years ago
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
include/publisher_vision.h
+6
-6
6 additions, 6 deletions
include/publisher_vision.h
src/publisher_vision.cpp
+12
-12
12 additions, 12 deletions
src/publisher_vision.cpp
with
18 additions
and
18 deletions
include/publisher_vision.h
+
6
−
6
View file @
31d522a7
...
...
@@ -93,13 +93,13 @@ class PublisherVisionDebug : public Publisher
*/
void
showTracks
(
cv
::
Mat
_image
,
const
TrackMatrix
&
_track_matrix
,
CaptureBasePtr
_cap_img
,
COLORFEATURES
_color_of_features
,
bool
_show_track_ID
);
Eigen
::
Vector2d
projectLandmarkHp
(
const
LandmarkBasePtr
_lmk
,
const
CaptureBasePtr
_capture
)
const
;
Eigen
::
Vector2d
projectLandmarkHp
(
const
TrackMatrix
&
_track_matrix
,
const
Fea
tureBasePtr
&
_
ftr
,
const
LandmarkBasePtr
_lmk
);
Eigen
::
Vector2d
projectLandmarkHp
(
const
LandmarkBasePtr
_lmk
,
const
CaptureBasePtr
_capture
)
const
;
Eigen
::
Vector2d
projectLandmarkHp
(
const
Cap
tureBasePtr
&
_
capture
,
const
LandmarkBasePtr
_lmk
);
LandmarkBasePtr
getAssociatedLandmark
(
const
TrackMatrix
&
_track_matrix
,
const
FeatureBasePtr
&
_ftr
);
Eigen
::
Matrix
<
double
,
3
,
4
>
getProjectionMatrix
(
const
Fea
tureBasePtr
_
ftr
)
const
;
Eigen
::
Isometry3d
getTcw
(
const
Fea
tureBasePtr
_
ftr
)
const
;
Eigen
::
Matrix4d
getTcwMatrix
(
const
Fea
tureBasePtr
_
ftr
)
const
;
void
showLandmarks
(
cv
::
Mat
_image
,
const
TrackMatrix
&
_track_matrix
,
const
FeatureBasePtr
&
_ftr
,
bool
_show_landmark_ID
);
Eigen
::
Matrix
<
double
,
3
,
4
>
getProjectionMatrix
(
const
Cap
tureBasePtr
_
capture
)
const
;
Eigen
::
Isometry3d
getTcw
(
const
Cap
tureBasePtr
_
capture
)
const
;
Eigen
::
Matrix4d
getTcwMatrix
(
const
Cap
tureBasePtr
_
capture
)
const
;
void
showLandmarks
(
cv
::
Mat
_image
,
const
TrackMatrix
&
_track_matrix
,
const
FeatureBasePtr
&
_ftr
,
bool
_show_landmark_ID
);
};
...
...
This diff is collapsed.
Click to expand it.
src/publisher_vision.cpp
+
12
−
12
View file @
31d522a7
...
...
@@ -320,30 +320,30 @@ void PublisherVisionDebug::showTracks(cv::Mat _image,
}
}
Eigen
::
Isometry3d
PublisherVisionDebug
::
getTcw
(
const
Fea
tureBasePtr
_
ftr
)
const
Eigen
::
Isometry3d
PublisherVisionDebug
::
getTcw
(
const
Cap
tureBasePtr
_
capture
)
const
{
// get robot position and orientation at capture's timestamp
const
auto
&
state
=
_
ftr
->
getC
apture
()
->
getProblem
()
->
getState
(
_
ftr
->
getC
apture
()
->
getTimeStamp
());
const
auto
&
state
=
_
c
apture
->
getProblem
()
->
getState
(
_
c
apture
->
getTimeStamp
());
const
auto
&
pos
=
state
.
at
(
'P'
);
const
auto
&
ori
=
state
.
at
(
'O'
);
// compute world-to-camera transform
Eigen
::
Isometry3d
T_w_r
=
Translation3d
(
pos
)
*
Quaterniond
(
ori
.
data
());
Eigen
::
Isometry3d
T_r_c
=
Translation3d
(
_
ftr
->
getC
apture
()
->
getSensorP
()
->
getState
())
*
Quaterniond
(
_
ftr
->
getC
apture
()
->
getSensorO
()
->
getState
().
data
());
Eigen
::
Isometry3d
T_r_c
=
Translation3d
(
_
c
apture
->
getSensorP
()
->
getState
())
*
Quaterniond
(
_
c
apture
->
getSensorO
()
->
getState
().
data
());
// invert transform to camera-to-world and return
return
(
T_w_r
*
T_r_c
).
inverse
();
}
Eigen
::
Matrix4d
PublisherVisionDebug
::
getTcwMatrix
(
const
Fea
tureBasePtr
_
ftr
)
const
Eigen
::
Matrix4d
PublisherVisionDebug
::
getTcwMatrix
(
const
Cap
tureBasePtr
_
capture
)
const
{
return
getTcw
(
_
ftr
).
matrix
();
return
getTcw
(
_
capture
).
matrix
();
}
Eigen
::
Matrix
<
double
,
3
,
4
>
PublisherVisionDebug
::
getProjectionMatrix
(
const
Fea
tureBasePtr
_
ftr
)
const
Eigen
::
Matrix
<
double
,
3
,
4
>
PublisherVisionDebug
::
getProjectionMatrix
(
const
Cap
tureBasePtr
_
capture
)
const
{
auto
k
(
_
ftr
->
getC
apture
()
->
getSensor
()
->
getIntrinsic
()
->
getState
());
auto
k
(
_
c
apture
->
getSensor
()
->
getIntrinsic
()
->
getState
());
Eigen
::
Matrix
<
double
,
3
,
4
>
P
;
P
<<
k
(
2
),
0
,
k
(
0
),
0
,
//
...
...
@@ -382,12 +382,12 @@ LandmarkBasePtr PublisherVisionDebug::getAssociatedLandmark(const TrackMatrix& _
return
lmk
;
}
Eigen
::
Vector2d
PublisherVisionDebug
::
projectLandmarkHp
(
const
TrackMatrix
&
_track_matrix
,
const
Fea
tureBasePtr
&
_
ftr
,
const
LandmarkBasePtr
_lmk
)
Eigen
::
Vector2d
PublisherVisionDebug
::
projectLandmarkHp
(
const
Cap
tureBasePtr
&
_
capture
,
const
LandmarkBasePtr
_lmk
)
{
Eigen
::
Vector2d
lmk_position
;
const
auto
&
pos
=
_lmk
->
getP
()
->
getState
();
Eigen
::
Vector3d
pixel_position3
=
getProjectionMatrix
(
_
ftr
)
*
getTcwMatrix
(
_
ftr
)
Eigen
::
Vector3d
pixel_position3
=
getProjectionMatrix
(
_
capture
)
*
getTcwMatrix
(
_
capture
)
*
pos
;
lmk_position
<<
pixel_position3
(
0
)
/
pixel_position3
(
2
),
...
...
@@ -399,7 +399,7 @@ Eigen::Vector2d PublisherVisionDebug::projectLandmarkHp(const TrackMatrix& _trac
void
PublisherVisionDebug
::
showLandmarks
(
cv
::
Mat
_image
,
const
TrackMatrix
&
_track_matrix
,
const
FeatureBasePtr
&
_ftr
,
bool
_show_landmark_ID
)
{
const
auto
&
lmk
=
getAssociatedLandmark
(
_track_matrix
,
_ftr
);
const
auto
&
lmk_position
=
projectLandmarkHp
(
_tr
ack_matrix
,
_ftr
,
lmk
);
const
auto
&
lmk_position
=
projectLandmarkHp
(
_
f
tr
->
getCapture
()
,
lmk
);
if
(
lmk
!=
nullptr
)
{
...
...
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