Apollo 10.0
自动驾驶开放平台
turn_rpt_64.cc
浏览该文件的文档.
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
18
19#include "glog/logging.h"
20
23
24namespace apollo {
25namespace canbus {
26namespace gem {
27
28using ::apollo::drivers::canbus::Byte;
29
31const int32_t Turnrpt64::ID = 0x64;
32
33void Turnrpt64::Parse(const std::uint8_t* bytes, int32_t length,
34 Gem* chassis) const {
35 chassis->mutable_turn_rpt_64()->set_manual_input(
36 manual_input(bytes, length));
37 chassis->mutable_turn_rpt_64()->set_commanded_value(
38 commanded_value(bytes, length));
39 chassis->mutable_turn_rpt_64()->set_output_value(
40 output_value(bytes, length));
41}
42
43// config detail: {'name': 'manual_input', 'enum': {0: 'MANUAL_INPUT_RIGHT', 1:
44// 'MANUAL_INPUT_NONE', 2: 'MANUAL_INPUT_LEFT', 3: 'MANUAL_INPUT_HAZARD'},
45// 'precision': 1.0, 'len': 8, 'is_signed_var': False, 'offset': 0.0,
46// 'physical_range': '[0|3]', 'bit': 7, 'type': 'enum', 'order': 'motorola',
47// 'physical_unit': ''}
48Turn_rpt_64::Manual_inputType Turnrpt64::manual_input(const std::uint8_t* bytes,
49 int32_t length) const {
50 Byte t0(bytes + 0);
51 int32_t x = t0.get_byte(0, 8);
52
54 static_cast<Turn_rpt_64::Manual_inputType>(x);
55 return ret;
56}
57
58// config detail: {'name': 'commanded_value', 'enum': {0:
59// 'COMMANDED_VALUE_RIGHT', 1: 'COMMANDED_VALUE_NONE', 2:
60// 'COMMANDED_VALUE_LEFT', 3: 'COMMANDED_VALUE_HAZARD'}, 'precision': 1.0,
61// 'len': 8, 'is_signed_var': False, 'offset': 0.0, 'physical_range': '[0|3]',
62// 'bit': 15, 'type': 'enum', 'order': 'motorola', 'physical_unit': ''}
63Turn_rpt_64::Commanded_valueType Turnrpt64::commanded_value(
64 const std::uint8_t* bytes, int32_t length) const {
65 Byte t0(bytes + 1);
66 int32_t x = t0.get_byte(0, 8);
67
70 return ret;
71}
72
73// config detail: {'name': 'output_value', 'enum': {0: 'OUTPUT_VALUE_RIGHT', 1:
74// 'OUTPUT_VALUE_NONE', 2: 'OUTPUT_VALUE_LEFT', 3: 'OUTPUT_VALUE_HAZARD'},
75// 'precision': 1.0, 'len': 8, 'is_signed_var': False, 'offset': 0.0,
76// 'physical_range': '[0|3]', 'bit': 23, 'type': 'enum', 'order': 'motorola',
77// 'physical_unit': ''}
78Turn_rpt_64::Output_valueType Turnrpt64::output_value(const std::uint8_t* bytes,
79 int32_t length) const {
80 Byte t0(bytes + 2);
81 int32_t x = t0.get_byte(0, 8);
82
84 static_cast<Turn_rpt_64::Output_valueType>(x);
85 return ret;
86}
87} // namespace gem
88} // namespace canbus
89} // namespace apollo
Defines the Byte class.
static const int32_t ID
Definition turn_rpt_64.h:29
void Parse(const std::uint8_t *bytes, int32_t length, Gem *chassis) const override
class register implement
Definition arena_queue.h:37