Apollo 10.0
自动驾驶开放平台
object_list_status_60a.cc
浏览该文件的文档.
1/******************************************************************************
2 * Copyright 2017 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
18
19#include "glog/logging.h"
20
23
24namespace apollo {
25namespace drivers {
26namespace conti_radar {
27
30
32const uint32_t ObjectListStatus60A::ID = 0x60A;
33
34void ObjectListStatus60A::Parse(const std::uint8_t* bytes, int32_t length,
35 ContiRadar* conti_radar) const {
36 auto status = conti_radar->mutable_object_list_status();
37 auto num_of_obj = num_of_objects(bytes, length);
38 status->set_nof_objects(num_of_obj);
39 status->set_meas_counter(meas_counter(bytes, length));
40 status->set_interface_version(interface_version(bytes, length));
41 conti_radar->mutable_contiobs()->Reserve(num_of_obj);
42}
43
44int ObjectListStatus60A::num_of_objects(const std::uint8_t* bytes,
45 int32_t length) const {
46 Byte t0(bytes);
47 int32_t x = t0.get_byte(0, 8);
48
49 int ret = x;
50 return ret;
51}
52
53int ObjectListStatus60A::meas_counter(const std::uint8_t* bytes,
54 int32_t length) const {
55 Byte t0(bytes + 2);
56 uint32_t x = t0.get_byte(0, 8);
57
58 Byte t1(bytes + 3);
59 uint32_t t = t1.get_byte(0, 8);
60 x <<= 8;
61 x |= t;
62
63 int ret = x;
64 return ret;
65}
66
67int ObjectListStatus60A::interface_version(const std::uint8_t* bytes,
68 int32_t length) const {
69 Byte t0(bytes + 4);
70 int32_t x = t0.get_byte(4, 4);
71
72 int ret = x;
73 return ret;
74}
75
76} // namespace conti_radar
77} // namespace drivers
78} // namespace apollo
Defines the Byte class.
The class of one byte, which is 8 bits.
Definition byte.h:39
void Parse(const std::uint8_t *bytes, int32_t length, ContiRadar *conti_radar) const override
class register implement
Definition arena_queue.h:37