Apollo 10.0
自动驾驶开放平台
nav_msg_converter.h
浏览该文件的文档.
1/******************************************************************************
2 * Copyright 2023 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
17#pragma once
18
19#include <algorithm>
20#include <cstring>
21#include <memory>
22#include <string>
23
25
26#include "cyber/proto/simple.pb.h"
27#include "modules/common_msgs/sensor_msgs/gnss_best_pose.pb.h"
28#include "modules/common_msgs/sensor_msgs/ins.pb.h"
29#include "cyber/cyber.h"
31
32#if __has_include("sensor_msgs/msg/nav_sat_fix.hpp")
33#include "sensor_msgs/msg/nav_sat_fix.hpp"
34#define ENABLE_ROS_MSG
35#endif
36
37#ifdef ENABLE_ROS_MSG
38using RosNavMsg = sensor_msgs::msg::NavSatFix;
39#else
40// fake wrap
42#endif
43
46
47using RosNavMsgPtr = std::shared_ptr<RosNavMsg>;
48
49using BestPoseMsgPtr = std::shared_ptr<BestPoseMsg>;
50using InsStatMsgPtr = std::shared_ptr<InsStatMsg>;
51
52namespace apollo {
53namespace cyber {
54
56 InputTypes<RosNavMsgPtr>,
57 OutputTypes<BestPoseMsgPtr, InsStatMsgPtr>> {
58 public:
61
71};
72
75
76} // namespace cyber
77} // namespace apollo
virtual bool ConvertMsg(InputTypes< RosNavMsgPtr > &, OutputTypes< BestPoseMsgPtr, InsStatMsgPtr > &)
convert the message between ros and apollo
#define CYBER_PLUGIN_MANAGER_REGISTER_PLUGIN(name, base)
std::shared_ptr< RosNavMsg > RosNavMsgPtr
class register implement
Definition arena_queue.h:37
std::shared_ptr< BestPoseMsg > BestPoseMsgPtr
std::shared_ptr< InsStatMsg > InsStatMsgPtr