Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
V
vision
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
vision
Commits
5fdae35b
Commit
5fdae35b
authored
1 year ago
by
Joan Vallvé Navarro
Browse files
Options
Downloads
Plain Diff
Merge branch 'devel' into 'main'
Devel See merge request
!44
parents
a0423514
7931bd51
No related branches found
No related tags found
1 merge request
!44
Devel
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
CMakeLists.txt
+1
-1
1 addition, 1 deletion
CMakeLists.txt
src/processor/processor_visual_odometry.cpp
+11
-9
11 additions, 9 deletions
src/processor/processor_visual_odometry.cpp
test/gtest/CMakeLists.txt
+8
-66
8 additions, 66 deletions
test/gtest/CMakeLists.txt
with
20 additions
and
76 deletions
CMakeLists.txt
+
1
−
1
View file @
5fdae35b
# Pre-requisites about cmake itself
# Pre-requisites about cmake itself
CMAKE_MINIMUM_REQUIRED
(
VERSION 3.1
0
)
CMAKE_MINIMUM_REQUIRED
(
VERSION 3.1
6
)
# MAC OSX RPATH
# MAC OSX RPATH
SET
(
CMAKE_MACOSX_RPATH true
)
SET
(
CMAKE_MACOSX_RPATH true
)
...
...
This diff is collapsed.
Click to expand it.
src/processor/processor_visual_odometry.cpp
+
11
−
9
View file @
5fdae35b
...
@@ -434,7 +434,7 @@ void ProcessorVisualOdometry::establishFactors()
...
@@ -434,7 +434,7 @@ void ProcessorVisualOdometry::establishFactors()
LandmarkBasePtr
associated_lmk
=
nullptr
;
LandmarkBasePtr
associated_lmk
=
nullptr
;
for
(
auto
lmk
:
getProblem
()
->
getMap
()
->
getLandmarkList
())
for
(
auto
lmk
:
getProblem
()
->
getMap
()
->
getLandmarkList
())
{
{
if
(
lmk
->
i
d
()
==
feat_pi
->
trackId
()){
if
(
lmk
->
trackI
d
()
==
feat_pi
->
trackId
()){
associated_lmk
=
lmk
;
associated_lmk
=
lmk
;
}
}
}
}
...
@@ -444,11 +444,14 @@ void ProcessorVisualOdometry::establishFactors()
...
@@ -444,11 +444,14 @@ void ProcessorVisualOdometry::establishFactors()
if
(
associated_lmk
)
if
(
associated_lmk
)
{
{
LandmarkHpPtr
associated_lmk_hp
=
std
::
dynamic_pointer_cast
<
LandmarkHp
>
(
associated_lmk
);
LandmarkHpPtr
associated_lmk_hp
=
std
::
dynamic_pointer_cast
<
LandmarkHp
>
(
associated_lmk
);
FactorBase
::
emplace
<
FactorPixelHp
>
(
feat_pi
,
feat_pi
,
if
(
associated_lmk_hp
)
{
associated_lmk_hp
,
FactorBase
::
emplace
<
FactorPixelHp
>
(
feat_pi
,
shared_from_this
(),
feat_pi
,
params_visual_odometry_
->
apply_loss_function
);
associated_lmk_hp
,
shared_from_this
(),
params_visual_odometry_
->
apply_loss_function
);
}
}
}
// 2) create landmark if track is not associated with one and has enough length
// 2) create landmark if track is not associated with one and has enough length
...
@@ -456,7 +459,6 @@ void ProcessorVisualOdometry::establishFactors()
...
@@ -456,7 +459,6 @@ void ProcessorVisualOdometry::establishFactors()
{
{
// std::cout << "NEW valid track \\o/" << std::endl;
// std::cout << "NEW valid track \\o/" << std::endl;
LandmarkBasePtr
lmk
=
emplaceLandmark
(
feat_pi
);
LandmarkBasePtr
lmk
=
emplaceLandmark
(
feat_pi
);
lmk
->
setId
(
feat_pi
->
trackId
());
// Add factors from all KFs of this track to the new lmk
// Add factors from all KFs of this track to the new lmk
Track
track_kf
=
track_matrix_
.
trackAtKeyframes
(
feat
->
trackId
());
Track
track_kf
=
track_matrix_
.
trackAtKeyframes
(
feat
->
trackId
());
...
@@ -513,8 +515,8 @@ LandmarkBasePtr ProcessorVisualOdometry::emplaceLandmark(FeatureBasePtr _feat)
...
@@ -513,8 +515,8 @@ LandmarkBasePtr ProcessorVisualOdometry::emplaceLandmark(FeatureBasePtr _feat)
// Set all IDs equal to track ID
// Set all IDs equal to track ID
size_t
track_id
=
_feat
->
trackId
();
size_t
track_id
=
_feat
->
trackId
();
lmk_hp_ptr
->
setId
(
track_id
);
lmk_hp_ptr
->
set
Track
Id
(
track_id
);
_feat
->
setLandmarkId
(
track_id
);
_feat
->
setLandmarkId
(
lmk_hp_ptr
->
id
()
);
return
lmk_hp_ptr
;
return
lmk_hp_ptr
;
}
}
...
...
This diff is collapsed.
Click to expand it.
test/gtest/CMakeLists.txt
+
8
−
66
View file @
5fdae35b
if
(
${
CMAKE_VERSION
}
VERSION_LESS
"3.11.0"
)
include
(
FetchContent
)
message
(
"CMake version less than 3.11.0"
)
# Enable ExternalProject CMake module
FetchContent_Declare
(
include
(
ExternalProject
)
googletest
GIT_REPOSITORY https://github.com/google/googletest.git
GIT_TAG main
)
set
(
GTEST_FORCE_SHARED_CRT ON
)
SET
(
INSTALL_GTEST OFF
)
# Disable installation of googletest
set
(
GTEST_DISABLE_PTHREADS ON
)
# without this in ubuntu 18.04 we get linking errors
FetchContent_MakeAvailable
(
googletest
)
# Download GoogleTest
ExternalProject_Add
(
googletest
GIT_REPOSITORY https://github.com/google/googletest.git
GIT_TAG v1.8.x
# TIMEOUT 1 # We'll try this
CMAKE_ARGS -DCMAKE_ARCHIVE_OUTPUT_DIRECTORY_DEBUG:PATH=DebugLibs
-DCMAKE_ARCHIVE_OUTPUT_DIRECTORY_RELEASE:PATH=ReleaseLibs
-DCMAKE_CXX_FLAGS=
${
MSVC_COMPILER_DEFS
}
-Dgtest_force_shared_crt=
${
GTEST_FORCE_SHARED_CRT
}
-Dgtest_disable_pthreads=
${
GTEST_DISABLE_PTHREADS
}
-DBUILD_GTEST=ON
PREFIX
"
${
CMAKE_CURRENT_BINARY_DIR
}
"
# Disable install step
INSTALL_COMMAND
""
UPDATE_DISCONNECTED 1
# 1: do not update googletest; 0: update googletest via github
)
# Get GTest source and binary directories from CMake project
# Specify include dir
ExternalProject_Get_Property
(
googletest source_dir
)
set
(
GTEST_INCLUDE_DIRS
${
source_dir
}
/googletest/include PARENT_SCOPE
)
# Specify MainTest's link libraries
ExternalProject_Get_Property
(
googletest binary_dir
)
set
(
GTEST_LIBS_DIR
${
binary_dir
}
/googlemock/gtest PARENT_SCOPE
)
# Create a libgtest target to be used as a dependency by test programs
add_library
(
libgtest IMPORTED STATIC GLOBAL
)
add_dependencies
(
libgtest googletest
)
# Set libgtest properties
set_target_properties
(
libgtest PROPERTIES
"IMPORTED_LOCATION"
"
${
binary_dir
}
/googlemock/gtest/libgtest.a"
"IMPORTED_LINK_INTERFACE_LIBRARIES"
"
${
CMAKE_THREAD_LIBS_INIT
}
"
)
else
()
message
(
"CMake version equal or greater than 3.11.0"
)
include
(
FetchContent
)
FetchContent_Declare
(
googletest
GIT_REPOSITORY https://github.com/google/googletest.git
GIT_TAG main
)
SET
(
INSTALL_GTEST OFF
)
# Disable installation of googletest
FetchContent_MakeAvailable
(
googletest
)
endif
()
function
(
wolf_add_gtest target
)
function
(
wolf_add_gtest target
)
add_executable
(
${
target
}
${
ARGN
}
)
add_executable
(
${
target
}
${
ARGN
}
)
if
(
${
CMAKE_VERSION
}
VERSION_LESS
"3.11.0"
)
target_link_libraries
(
${
target
}
gtest_main
${
PLUGIN_NAME
}
)
add_dependencies
(
${
target
}
libgtest
)
target_link_libraries
(
${
target
}
libgtest
${
PLUGIN_NAME
}
)
target_include_directories
(
${
target
}
PUBLIC
${
GTEST_INCLUDE_DIRS
}
)
else
()
target_link_libraries
(
${
target
}
PUBLIC gtest_main
${
PLUGIN_NAME
}
)
endif
()
add_test
(
NAME
${
target
}
COMMAND
${
target
}
)
add_test
(
NAME
${
target
}
COMMAND
${
target
}
)
endfunction
()
endfunction
()
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