Apollo
10.0
自动驾驶开放平台
ros_apollo_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 <memory>
20
21
#include "
cyber/ros_bridge/converter_base/converter_interface.h
"
22
23
#include "cyber/proto/simple.pb.h"
24
#include "
cyber/cyber.h
"
25
#include "
cyber/plugin_manager/plugin_manager.h
"
26
27
#if __has_include("std_msgs/msg/string.hpp")
28
#include "std_msgs/msg/string.hpp"
29
#define ENABLE_ROS_MSG
30
#endif
31
32
#ifdef ENABLE_ROS_MSG
33
using
InputMsg
= std_msgs::msg::String;
34
#else
35
using
InputMsg
=
apollo::cyber::proto::SimpleRepeatedMessage
;
36
#endif
37
using
OutputMsg
=
apollo::cyber::proto::SimpleMessage
;
38
using
InputMsgPtr
= std::shared_ptr<InputMsg>;
39
using
OutputMsgPtr
= std::shared_ptr<OutputMsg>;
40
41
namespace
apollo
{
42
namespace
cyber {
43
44
class
RosApolloConverter
45
:
public
apollo::cyber::RosApolloMessageConverter
<
46
InputTypes<InputMsgPtr>, OutputTypes<OutputMsgPtr>> {
47
public
:
48
RosApolloConverter
() {}
49
~RosApolloConverter
() {}
50
58
virtual
bool
ConvertMsg
(
InputTypes<InputMsgPtr>
& in,
59
OutputTypes<OutputMsgPtr>
& out);
// NOLINT
60
};
61
62
CYBER_PLUGIN_MANAGER_REGISTER_PLUGIN
(
apollo::cyber::RosApolloConverter
,
63
apollo::cyber::MessageConverter
)
64
65
}
// namespace cyber
66
}
// namespace apollo
apollo::cyber::MessageConverter
Definition
message_converter.h:48
apollo::cyber::RosApolloConverter
Definition
ros_apollo_converter.h:46
apollo::cyber::RosApolloConverter::RosApolloConverter
RosApolloConverter()
Definition
ros_apollo_converter.h:48
apollo::cyber::RosApolloConverter::ConvertMsg
virtual bool ConvertMsg(InputTypes< InputMsgPtr > &in, OutputTypes< OutputMsgPtr > &out)
convert the message between ros and apollo
Definition
ros_apollo_converter.cc:22
apollo::cyber::RosApolloConverter::~RosApolloConverter
~RosApolloConverter()
Definition
ros_apollo_converter.h:49
apollo::cyber::RosApolloMessageConverter
Definition
convert_ros_base.h:37
converter_interface.h
plugin_manager.h
CYBER_PLUGIN_MANAGER_REGISTER_PLUGIN
#define CYBER_PLUGIN_MANAGER_REGISTER_PLUGIN(name, base)
Definition
plugin_manager.h:272
cyber.h
OutputMsgPtr
std::shared_ptr< OutputMsg > OutputMsgPtr
Definition
heading_msg_fusion.h:59
InputMsgPtr
std::shared_ptr< InputMsg > InputMsgPtr
Definition
localization_estimate.h:48
apollo
class register implement
Definition
arena_queue.h:37
apollo::cyber::InputTypes
Definition
converter_base.h:33
apollo::cyber::OutputTypes
Definition
converter_base.h:39
apollo::cyber::proto::SimpleMessage
Definition
simple.proto:5
apollo::cyber::proto::SimpleRepeatedMessage
Definition
simple.proto:10
apollo::drivers::gnss::Heading
Definition
heading.proto:7
cyber
ros_bridge
converters
examples
ros_apollo_converter
ros_apollo_converter.h