Apollo 10.0
自动驾驶开放平台
convert_ros_base.h
浏览该文件的文档.
1/******************************************************************************
2 * Copyright 2024 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#ifndef CYBER_ROS_APOLLO_BASE_H_
18#define CYBER_ROS_APOLLO_BASE_H_
19
20#include <memory>
21#include <string>
22#include <thread>
23#include <utility>
24
26
27#include "cyber/cyber.h"
29
30namespace apollo {
31namespace cyber {
32
33template <typename R0 = NullType, typename R1 = NullType,
34 typename R2 = NullType, typename R3 = NullType,
35 typename M0 = NullType, typename M1 = NullType,
36 typename M2 = NullType, typename M3 = NullType>
38 public:
41
42 bool Init() override;
43
44 protected:
45 virtual bool ConvertMsg(
46 const std::shared_ptr<R0>& ros_msg0, const std::shared_ptr<R1>& ros_msg1,
47 const std::shared_ptr<R2>& ros_msg2, const std::shared_ptr<R3>& ros_msg3,
48 std::shared_ptr<M0>& apollo_msg0, std::shared_ptr<M1>& apollo_msg1,
49 std::shared_ptr<M2>& apollo_msg2, std::shared_ptr<M3>& apollo_msg3) = 0;
50
51#ifdef RCLCPP__RCLCPP_HPP_
52 private:
53 void TopicCallback(const std::shared_ptr<R0>& ros_msg0,
54 const std::shared_ptr<R1>& ros_msg1,
55 const std::shared_ptr<R2>& ros_msg2,
56 const std::shared_ptr<R3>& ros_msg3);
57#endif
58};
59
60} // namespace cyber
61} // namespace apollo
62
63#endif // CYBER_APOLLO_ROS_MESSAGE_CONVERTER_H_
virtual bool ConvertMsg(const std::shared_ptr< R0 > &ros_msg0, const std::shared_ptr< R1 > &ros_msg1, const std::shared_ptr< R2 > &ros_msg2, const std::shared_ptr< R3 > &ros_msg3, std::shared_ptr< M0 > &apollo_msg0, std::shared_ptr< M1 > &apollo_msg1, std::shared_ptr< M2 > &apollo_msg2, std::shared_ptr< M3 > &apollo_msg3)=0
class register implement
Definition arena_queue.h:37