Main Page
Namespaces
Classes
Files
File List
File Members
cartographer
mapping
odometry_state_tracker.cc
Go to the documentation of this file.
1
/*
2
* Copyright 2016 The Cartographer Authors
3
*
4
* Licensed under the Apache License, Version 2.0 (the "License");
5
* you may not use this file except in compliance with the License.
6
* You may obtain a copy of the License at
7
*
8
* http://www.apache.org/licenses/LICENSE-2.0
9
*
10
* Unless required by applicable law or agreed to in writing, software
11
* distributed under the License is distributed on an "AS IS" BASIS,
12
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
* See the License for the specific language governing permissions and
14
* limitations under the License.
15
*/
16
17
#include "
cartographer/mapping/odometry_state_tracker.h
"
18
19
#include "
cartographer/transform/rigid_transform.h
"
20
21
namespace
cartographer
{
22
namespace
mapping {
23
24
OdometryState::OdometryState
(
const
common::Time
time
,
25
const
transform::Rigid3d
& odometer_pose,
26
const
transform::Rigid3d
& state_pose)
27
: time(time), odometer_pose(odometer_pose), state_pose(state_pose) {}
28
29
OdometryStateTracker::OdometryStateTracker
(
const
int
window_size)
30
: window_size_(window_size) {
31
CHECK_GT(window_size, 0);
32
}
33
34
const
OdometryStateTracker::OdometryStates
&
35
OdometryStateTracker::odometry_states
()
const
{
36
return
odometry_states_
;
37
}
38
39
void
OdometryStateTracker::AddOdometryState
(
40
const
OdometryState
& odometry_state) {
41
odometry_states_
.push_back(odometry_state);
42
while
(
odometry_states_
.size() >
window_size_
) {
43
odometry_states_
.pop_front();
44
}
45
}
46
47
bool
OdometryStateTracker::empty
()
const
{
return
odometry_states_
.empty(); }
48
49
const
OdometryState
&
OdometryStateTracker::newest
()
const
{
50
return
odometry_states_
.back();
51
}
52
53
}
// namespace mapping
54
}
// namespace cartographer
cartographer::mapping::OdometryStateTracker::AddOdometryState
void AddOdometryState(const OdometryState &odometry_state)
Definition:
odometry_state_tracker.cc:39
odometry_state_tracker.h
cartographer::mapping::OdometryStateTracker::OdometryStateTracker
OdometryStateTracker(int window_size)
Definition:
odometry_state_tracker.cc:29
cartographer::mapping::OdometryStateTracker::odometry_states
const OdometryStates & odometry_states() const
Definition:
odometry_state_tracker.cc:35
cartographer::common::Time
UniversalTimeScaleClock::time_point Time
Definition:
time.h:44
cartographer::mapping::OdometryStateTracker::newest
const OdometryState & newest() const
Definition:
odometry_state_tracker.cc:49
cartographer::transform::Rigid3< double >
time
common::Time time
Definition:
kalman_local_trajectory_builder_test.cc:41
cartographer::mapping::OdometryState
Definition:
odometry_state_tracker.h:28
cartographer
Definition:
blocking_queue.h:29
cartographer::mapping::OdometryState::OdometryState
OdometryState()
Definition:
odometry_state_tracker.h:31
cartographer::mapping::OdometryStateTracker::window_size_
size_t window_size_
Definition:
odometry_state_tracker.h:60
cartographer::mapping::OdometryStateTracker::empty
bool empty() const
Definition:
odometry_state_tracker.cc:47
cartographer::mapping::OdometryStateTracker::odometry_states_
OdometryStates odometry_states_
Definition:
odometry_state_tracker.h:59
rigid_transform.h
cartographer::mapping::OdometryStateTracker::OdometryStates
std::deque< OdometryState > OdometryStates
Definition:
odometry_state_tracker.h:42
cartographer
Author(s):
autogenerated on Wed Jun 5 2019 21:57:58