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
685c63df
Commit
685c63df
authored
3 years ago
by
Joan Solà Ortega
Browse files
Options
Downloads
Patches
Plain Diff
Refactor a bit for clarity and organization
parent
9f1eae73
No related branches found
No related tags found
2 merge requests
!3
After cmake and const refactor
,
!1
Resolve "Publisher for visual odometry"
Pipeline
#9681
failed
3 years ago
Stage: license
Stage: build_and_test
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/publisher_vision.cpp
+12
-7
12 additions, 7 deletions
src/publisher_vision.cpp
with
12 additions
and
7 deletions
src/publisher_vision.cpp
+
12
−
7
View file @
685c63df
...
...
@@ -322,14 +322,17 @@ void PublisherVisionDebug::showTracks(cv::Mat _image,
Eigen
::
Isometry3d
PublisherVisionDebug
::
getTcw
(
const
CaptureBasePtr
_capture
)
const
{
auto
state
=
_capture
->
getProblem
()
->
getState
(
_capture
->
getTimeStamp
());
auto
pos
=
state
[
'P'
];
auto
orientation
=
state
[
'O'
].
data
();
Eigen
::
Isometry3d
T_w_r
=
Translation
<
double
,
3
>
(
pos
)
*
Quaterniond
(
orientation
);
Eigen
::
Isometry3d
T_r_c
=
Translation
<
double
,
3
>
(
_capture
->
getSensorP
()
->
getState
())
// get robot position and orientation at capture's timestamp
const
auto
&
state
=
_capture
->
getProblem
()
->
getState
(
_capture
->
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
(
_capture
->
getSensorP
()
->
getState
())
*
Quaterniond
(
_capture
->
getSensorO
()
->
getState
().
data
());
// invert transform to camera-to-world and return
return
(
T_w_r
*
T_r_c
).
inverse
();
}
...
...
@@ -343,7 +346,9 @@ Eigen::Matrix<double, 3, 4> PublisherVisionDebug::getProjectionMatrix(const Capt
auto
k
(
_capture
->
getSensor
()
->
getIntrinsic
()
->
getState
());
Eigen
::
Matrix
<
double
,
3
,
4
>
P
;
P
<<
k
(
2
),
0
,
k
(
0
),
0
,
0
,
k
(
3
),
k
(
1
),
0
,
0
,
0
,
1
,
0
;
P
<<
k
(
2
),
0
,
k
(
0
),
0
,
//
0
,
k
(
3
),
k
(
1
),
0
,
//
0
,
0
,
1
,
0
;
//
return
P
;
}
...
...
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