Apollo 10.0
自动驾驶开放平台
heading_msg_fusion.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/heading.pb.h"
28#include "cyber/cyber.h"
30
31#if __has_include("sensor_msgs/msg/nav_sat_fix.hpp")
32#include "sensor_msgs/msg/nav_sat_fix.hpp"
33#define ROS_NAVFOUND_FOUND
34#endif
35
36#if __has_include("nav_msgs/msg/odometry.hpp")
37#include "nav_msgs/msg/odometry.hpp"
38#define ROS_ODOMETRY_FOUND
39#endif
40
41#if defined(ROS_NAVFOUND_FOUND) && defined(ROS_ODOMETRY_FOUND)
42#define ENABLE_ROS_MSG
43#endif
44
45#ifdef ENABLE_ROS_MSG
46using RosNavMsg = sensor_msgs::msg::NavSatFix;
47using RosOdometryMsg = nav_msgs::msg::Odometry;
48#else
49// fake wrap
52#endif
53
55
56using RosNavMsgPtr = std::shared_ptr<RosNavMsg>;
57using RosOdometryMsgPtr = std::shared_ptr<RosOdometryMsg>;
58
59using OutputMsgPtr = std::shared_ptr<OutputMsg>;
60
61namespace apollo {
62namespace cyber {
63
65 InputTypes<RosNavMsgPtr, RosOdometryMsgPtr>,
66 OutputTypes<OutputMsgPtr>> {
67 public:
70
80};
81
84
85} // namespace cyber
86} // namespace apollo
virtual bool ConvertMsg(InputTypes< RosNavMsgPtr, RosOdometryMsgPtr > &, OutputTypes< OutputMsgPtr > &)
convert the message between ros and apollo
#define CYBER_PLUGIN_MANAGER_REGISTER_PLUGIN(name, base)
std::shared_ptr< RosOdometryMsg > RosOdometryMsgPtr
std::shared_ptr< RosNavMsg > RosNavMsgPtr
std::shared_ptr< OutputMsg > OutputMsgPtr
class register implement
Definition arena_queue.h:37