-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Moves SensorData struct into Cartographer. (#55)
- Loading branch information
1 parent
edff6a1
commit 5188509
Showing
2 changed files
with
76 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
/* | ||
* Copyright 2016 The Cartographer Authors | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
#ifndef CARTOGRAPHER_MAPPING_DATA_H_ | ||
#define CARTOGRAPHER_MAPPING_DATA_H_ | ||
|
||
#include <string> | ||
|
||
#include "cartographer/kalman_filter/pose_tracker.h" | ||
#include "cartographer/sensor/laser.h" | ||
#include "cartographer/transform/rigid_transform.h" | ||
|
||
namespace cartographer { | ||
namespace sensor { | ||
|
||
// This type is a logical union, i.e. only one type of sensor data is actually | ||
// filled in. It is only used for time ordering sensor data before passing it | ||
// on. | ||
struct Data { | ||
enum class Type { kImu, kLaserFan3D, kOdometry }; | ||
|
||
struct Odometry { | ||
transform::Rigid3d pose; | ||
kalman_filter::PoseCovariance covariance; | ||
}; | ||
|
||
struct Imu { | ||
Eigen::Vector3d linear_acceleration; | ||
Eigen::Vector3d angular_velocity; | ||
}; | ||
|
||
Data(const string& frame_id, const Imu& imu) | ||
: type(Type::kImu), frame_id(frame_id), imu(imu) {} | ||
|
||
Data(const string& frame_id, | ||
const ::cartographer::sensor::LaserFan3D& laser_fan_3d) | ||
: type(Type::kLaserFan3D), | ||
frame_id(frame_id), | ||
laser_fan_3d(laser_fan_3d) {} | ||
|
||
Data(const string& frame_id, const Odometry& odometry) | ||
: type(Type::kOdometry), frame_id(frame_id), odometry(odometry) {} | ||
|
||
Type type; | ||
string frame_id; | ||
Imu imu; | ||
sensor::LaserFan3D laser_fan_3d; | ||
Odometry odometry; | ||
}; | ||
|
||
} // namespace sensor | ||
} // namespace cartographer | ||
|
||
#endif // CARTOGRAPHER_MAPPING_DATA_H_ |