Apollo  6.0
Open source self driving car software
ultrasonic_radar_message_manager.h
Go to the documentation of this file.
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 
21 #pragma once
22 
23 #include <memory>
24 
25 #include "cyber/cyber.h"
26 
30 #include "modules/drivers/proto/ultrasonic_radar.pb.h"
31 
33 
34 namespace apollo {
35 namespace drivers {
36 namespace ultrasonic_radar {
37 
38 using ::apollo::drivers::canbus::MessageManager;
39 using ::apollo::drivers::canbus::ProtocolData;
41 using micros = std::chrono::microseconds;
42 using ::apollo::common::ErrorCode;
45 
46 class UltrasonicRadarMessageManager : public MessageManager<Ultrasonic> {
47  public:
49  const int entrance_num,
50  const std::shared_ptr<::apollo::cyber::Writer<Ultrasonic>> &writer);
51  virtual ~UltrasonicRadarMessageManager() = default;
52  void Parse(const uint32_t message_id, const uint8_t *data, int32_t length);
53  void set_can_client(std::shared_ptr<CanClient> can_client);
54 
55  private:
56  int entrance_num_ = 0;
57  std::shared_ptr<cyber::Writer<Ultrasonic>> ultrasonic_radar_writer_;
58  std::shared_ptr<CanClient> can_client_;
59 };
60 
61 } // namespace ultrasonic_radar
62 } // namespace drivers
63 } // namespace apollo
::apollo::cyber::Time Time
Definition: ultrasonic_radar_message_manager.h:40
PlanningContext is the runtime context in planning. It is persistent across multiple frames...
Definition: atomic_hash_map.h:25
The class which defines the CAN client to send and receive message.
Definition: can_client.h:92
The class of MessageManager.
void set_can_client(std::shared_ptr< CanClient > can_client)
Definition: writer.h:42
Defines SenderMessage class and CanSender class.
Definition: ultrasonic_radar_message_manager.h:46
std::chrono::microseconds micros
Definition: ultrasonic_radar_message_manager.h:41
void Parse(const uint32_t message_id, const uint8_t *data, int32_t length)
parse data and store parsed info in protocol data
This class defines the message to send.
Definition: can_sender.h:55
Defines the CanClientFactory class.
UltrasonicRadarMessageManager(const int entrance_num, const std::shared_ptr<::apollo::cyber::Writer< Ultrasonic >> &writer)
Cyber has builtin time type Time.
Definition: time.h:31