Apollo 10.0
自动驾驶开放平台
pose.h
浏览该文件的文档.
1/******************************************************************************
2 * Copyright 2018 The Apollo Authors. All Rights Reserved.
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#pragma once
17
18#include <map>
19#include <string>
20#include "Eigen/Core"
21
24
25namespace apollo {
26namespace perception {
27namespace camera {
28
29// @brief Car's Pose
30class CarPose {
31 public:
32 EIGEN_MAKE_ALIGNED_OPERATOR_NEW
33
34 template <typename T, class EigenType>
36
37 public:
38 CarPose() = default;
39 ~CarPose() = default;
40
41 bool Init(double ts, const Eigen::Matrix4d& pose);
42
43 const Eigen::Matrix4d getCarPose() const;
44 const Eigen::Vector3d getCarPosition() const;
45
46 void ClearCameraPose(const std::string& camera_name);
47 void SetCameraPose(const std::string& camera_name,
48 const Eigen::Matrix4d& c2w_pose);
49 bool GetCameraPose(const std::string& camera_name,
50 Eigen::Matrix4d* c2w_pose) const;
51
52 void setTimestamp(double ts) { timestamp_ = ts; }
53 double getTimestamp() const { return timestamp_; }
54 // car(novatel) to world pose
55 Eigen::Matrix4d pose_;
56 // camera to world poses
58 double timestamp_;
59
60 private:
61 friend std::ostream& operator<<(std::ostream& os, const CarPose&);
62};
63
64std::ostream& operator<<(std::ostream& os, const CarPose& pose);
65
66} // namespace camera
67} // namespace perception
68} // namespace apollo
const Eigen::Vector3d getCarPosition() const
Definition pose.cc:32
bool GetCameraPose(const std::string &camera_name, Eigen::Matrix4d *c2w_pose) const
Definition pose.cc:46
EigenMap< std::string, Eigen::Matrix4d > c2w_poses_
Definition pose.h:57
const Eigen::Matrix4d getCarPose() const
Definition pose.cc:30
void setTimestamp(double ts)
Definition pose.h:52
void SetCameraPose(const std::string &camera_name, const Eigen::Matrix4d &c2w_pose)
Definition pose.cc:41
void ClearCameraPose(const std::string &camera_name)
Definition pose.cc:64
apollo::common::EigenMap< T, EigenType > EigenMap
Definition pose.h:35
bool Init(double ts, const Eigen::Matrix4d &pose)
Definition pose.cc:24
friend std::ostream & operator<<(std::ostream &os, const CarPose &)
Definition pose.cc:60
std::map< T, EigenType, std::less< T >, Eigen::aligned_allocator< std::pair< const T, EigenType > > > EigenMap
Definition eigen_defs.h:40
std::ostream & operator<<(std::ostream &os, const CarPose &pose)
Definition pose.cc:60
class register implement
Definition arena_queue.h:37