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
cccf3f04
Commit
cccf3f04
authored
8 years ago
by
Dinesh Atchuthan
Browse files
Options
Downloads
Patches
Plain Diff
change CMakeLists + create ConstraintOdom3D
parent
4f5c0df4
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/examples/CMakeLists.txt
+2
-2
2 additions, 2 deletions
src/examples/CMakeLists.txt
src/examples/test_imu_constrained0.cpp
+14
-6
14 additions, 6 deletions
src/examples/test_imu_constrained0.cpp
with
16 additions
and
8 deletions
src/examples/CMakeLists.txt
+
2
−
2
View file @
cccf3f04
...
...
@@ -173,8 +173,8 @@ ADD_EXECUTABLE(test_processor_imu_jacobians test_processor_imu_jacobians.cpp)
TARGET_LINK_LIBRARIES
(
test_processor_imu_jacobians
${
PROJECT_NAME
}
)
# IMU - constraintAHP
ADD_EXECUTABLE
(
test_imu_constrain
tAHP
test_imu_constrain
tAHP
.cpp
)
TARGET_LINK_LIBRARIES
(
test_imu_constrain
tAHP
${
PROJECT_NAME
}
)
ADD_EXECUTABLE
(
test_imu_constrain
ed0
test_imu_constrain
ed0
.cpp
)
TARGET_LINK_LIBRARIES
(
test_imu_constrain
ed0
${
PROJECT_NAME
}
)
# IF (laser_scan_utils_FOUND)
# ADD_EXECUTABLE(test_capture_laser_2D test_capture_laser_2D.cpp)
...
...
This diff is collapsed.
Click to expand it.
src/examples/test_imu_constrained0.cpp
+
14
−
6
View file @
cccf3f04
...
...
@@ -3,6 +3,7 @@
#include
"problem.h"
#include
"sensor_imu.h"
#include
"capture_imu.h"
#include
"constraint_odom_3D.h"
#include
"state_block.h"
#include
"state_quaternion.h"
#include
"processor_imu.h"
...
...
@@ -54,7 +55,7 @@ int main(int argc, char** argv)
}
// Wolf problem
ProblemPtr
wolf_problem_ptr_
=
Problem
::
create
(
FRM_P
V
QBB_3D
);
ProblemPtr
wolf_problem_ptr_
=
Problem
::
create
(
FRM_PQ
V
BB_3D
);
Eigen
::
VectorXs
IMU_extrinsics
(
7
);
IMU_extrinsics
<<
0
,
0
,
0
,
0
,
0
,
0
,
1
;
// IMU pose in the robot
SensorBasePtr
sensor_ptr
=
wolf_problem_ptr_
->
installSensor
(
"IMU"
,
"Main IMU"
,
IMU_extrinsics
,
shared_ptr
<
IntrinsicsBase
>
());
...
...
@@ -74,19 +75,21 @@ int main(int argc, char** argv)
//create a keyframe at origin
TimeStamp
ts
=
wolf_problem_ptr_
->
getProcessorMotionPtr
()
->
getBuffer
().
get
().
back
().
ts_
;
Eigen
::
VectorXs
state
_vec
=
x0
;
FrameBasePtr
last
_frame
=
std
::
make_shared
<
FrameIMU
>
(
KEY_FRAME
,
ts
,
state
_vec
);
wolf_problem_ptr_
->
getTrajectoryPtr
()
->
addFrame
(
last
_frame
);
Eigen
::
VectorXs
origin_
state
=
x0
;
FrameBasePtr
origin
_frame
=
std
::
make_shared
<
FrameIMU
>
(
KEY_FRAME
,
ts
,
origin_
state
);
wolf_problem_ptr_
->
getTrajectoryPtr
()
->
addFrame
(
origin
_frame
);
// Create one capture to store the IMU data arriving from (sensor / callback / file / etc.)
CaptureIMU
::
Ptr
imu_ptr
(
std
::
make_shared
<
CaptureIMU
>
(
t
,
sensor_ptr
,
data_
)
);
CaptureIMUPtr
imu_ptr
(
std
::
make_shared
<
CaptureIMU
>
(
t
,
sensor_ptr
,
data_
)
);
// main loop
using
namespace
std
;
clock_t
begin
=
clock
();
const
int
keyframe_spacing
=
10
;
int
last_keyframe_dt
=
0
;
Eigen
::
VectorXs
state_vec
;
FrameBasePtr
last_frame
;
while
(
!
data_file
.
eof
()){
if
(
last_keyframe_dt
>=
keyframe_spacing
){
ts
=
wolf_problem_ptr_
->
getProcessorMotionPtr
()
->
getBuffer
().
get
().
back
().
ts_
;
...
...
@@ -119,6 +122,11 @@ int main(int argc, char** argv)
last_frame
=
std
::
make_shared
<
FrameIMU
>
(
KEY_FRAME
,
ts
,
state_vec
);
wolf_problem_ptr_
->
getTrajectoryPtr
()
->
addFrame
(
last_frame
);
//create a feature
FeatureBasePtr
last_feature
=
std
::
make_shared
<
FeatureBase
>
(
"ODOM_3D"
,
origin_state
.
head
(
7
),
Eigen
::
Matrix7s
::
Identity
());
//create an ODOM constraint between first and last keyframes
ConstraintOdom3DPtr
constraint_ptr
=
std
::
make_shared
<
ConstraintOdom3D
>
(
last_feature
,
last_frame
);
clock_t
end
=
clock
();
double
elapsed_secs
=
double
(
end
-
begin
)
/
CLOCKS_PER_SEC
;
...
...
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