Apollo  6.0
Open source self driving car software
ads1_111.h
Go to the documentation of this file.
1 /******************************************************************************
2  * Copyright 2019 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 "modules/canbus/proto/chassis_detail.pb.h"
21 
22 namespace apollo {
23 namespace canbus {
24 namespace wey {
25 
27  ::apollo::canbus::ChassisDetail> {
28  public:
29  static const int32_t ID;
30 
31  Ads1111();
32 
33  uint32_t GetPeriod() const override;
34 
35  void UpdateData(uint8_t* data) override;
36 
37  void Reset() override;
38 
39  // config detail: {'description': 'ADS request ESP/VLC to decelerate until
40  // standstill.', 'enum': {0: 'ADS_DECTOSTOP_NO_DEMAND', 1:
41  // 'ADS_DECTOSTOP_DEMAND'}, 'precision': 1.0, 'len': 1, 'name':
42  // 'ADS_DecToStop', 'is_signed_var': False, 'offset': 0.0,
43  // 'physical_range': '[0|1]', 'bit': 17, 'type': 'enum', 'order': 'motorola',
44  // 'physical_unit': ''}
45  Ads1111* set_ads_dectostop(Ads1_111::Ads_dectostopType ads_dectostop);
46 
47  // config detail: {'description': 'The status of the ADS control unit.The ADS
48  // mode should be contained in every message sent by ADS', 'enum': {0:
49  // 'ADS_MODE_OFF_MODE', 3: 'ADS_MODE_ACTIVE_MODE'}, 'precision': 1.0, 'len':
50  // 5, 'name': 'ADS_Mode', 'is_signed_var': False, 'offset': 0.0,
51  // 'physical_range': '[0|31]', 'bit': 7, 'type': 'enum', 'order': 'motorola',
52  // 'physical_unit': ''}
53  Ads1111* set_ads_mode(Ads1_111::Ads_modeType ads_mode);
54 
55  // config detail: {'description': 'ADS target acceleration for transmission',
56  // 'offset': -7.0, 'precision': 0.05, 'len': 8, 'name': 'ADS_TarAcce',
57  // 'is_signed_var': False, 'physical_range': '[-7|5.75]', 'bit': 15, 'type':
58  // 'double', 'order': 'motorola', 'physical_unit': 'm/s2'}
59  Ads1111* set_ads_taracce(double ads_taracce);
60 
61  // config detail: {'description': 'ACC request ESP drive off', 'enum': {0:
62  // 'ADS_DRIVEOFF_REQ_NO_DEMAND', 1: 'ADS_DRIVEOFF_REQ_DEMAND'}, 'precision':
63  // 1.0, 'len': 1, 'name': 'ADS_Driveoff_Req', 'is_signed_var': False,
64  // 'offset': 0.0, 'physical_range': '[0|1]', 'bit': 1, 'type': 'enum',
65  // 'order': 'motorola', 'physical_unit': ''}
67  Ads1_111::Ads_driveoff_reqType ads_driveoff_req);
68 
69  // config detail: {'description': 'target deceleration value from AEB',
70  // 'offset': -16.0, 'precision': 0.000488, 'len': 16, 'name':
71  // 'ADS_AEB_TarAcce', 'is_signed_var': False, 'physical_range': '[-16|16]',
72  // 'bit': 39, 'type': 'double', 'order': 'motorola', 'physical_unit': 'm/s2'}
73  Ads1111* set_ads_aeb_taracce(double ads_aeb_taracce);
74 
75  // config detail: {'description': 'Request of the AEB deceleration control.',
76  // 'enum': {0: 'ADS_AEB_TGTDECEL_REQ_NO_DEMAND', 1:
77  // 'ADS_AEB_TGTDECEL_REQ_DEMAND'}, 'precision': 1.0, 'len': 1, 'name':
78  // 'ADS_AEB_TgtDecel_Req', 'is_signed_var': False, 'offset': 0.0,
79  // 'physical_range': '[0|1]', 'bit': 31, 'type': 'enum', 'order': 'motorola',
80  // 'physical_unit': ''}
82  Ads1_111::Ads_aeb_tgtdecel_reqType ads_aeb_tgtdecel_req);
83 
84  private:
85  // config detail: {'description': 'ADS request ESP/VLC to decelerate until
86  // standstill.', 'enum': {0: 'ADS_DECTOSTOP_NO_DEMAND', 1:
87  // 'ADS_DECTOSTOP_DEMAND'}, 'precision': 1.0, 'len': 1, 'name':
88  // 'ADS_DecToStop', 'is_signed_var': False, 'offset': 0.0, 'physical_range':
89  // '[0|1]', 'bit': 17, 'type': 'enum', 'order': 'motorola',
90  // 'physical_unit': ''}
91  void set_p_ads_dectostop(uint8_t* data,
92  Ads1_111::Ads_dectostopType ads_dectostop);
93 
94  // config detail: {'description': 'The status of the ADS control unit.The
95  // ADS mode should be contained in every message sent by ADS', 'enum': {0:
96  // 'ADS_MODE_OFF_MODE', 3: 'ADS_MODE_ACTIVE_MODE'}, 'precision': 1.0,
97  // 'len': 5, 'name': 'ADS_Mode', 'is_signed_var': False, 'offset': 0.0,
98  // 'physical_range': '[0|31]', 'bit': 7, 'type': 'enum', 'order': 'motorola',
99  // 'physical_unit': ''}
100  void set_p_ads_mode(uint8_t* data, Ads1_111::Ads_modeType ads_mode);
101 
102  // config detail: {'description': 'ADS target acceleration for transmission',
103  // 'offset': -7.0, 'precision': 0.05, 'len': 8, 'name': 'ADS_TarAcce',
104  // 'is_signed_var': False, 'physical_range': '[-7|5.75]', 'bit': 15,
105  // 'type': 'double', 'order': 'motorola', 'physical_unit': 'm/s2'}
106  void set_p_ads_taracce(uint8_t* data, double ads_taracce);
107 
108  // config detail: {'description': 'ACC request ESP drive off', 'enum': {0:
109  // 'ADS_DRIVEOFF_REQ_NO_DEMAND', 1: 'ADS_DRIVEOFF_REQ_DEMAND'}, 'precision':
110  // 1.0, 'len': 1, 'name': 'ADS_Driveoff_Req', 'is_signed_var': False,
111  // 'offset': 0.0, 'physical_range': '[0|1]', 'bit': 1, 'type': 'enum',
112  // 'order': 'motorola', 'physical_unit': ''}
113  void set_p_ads_driveoff_req(uint8_t* data,
114  Ads1_111::Ads_driveoff_reqType ads_driveoff_req);
115 
116  // config detail: {'description': 'target deceleration value from AEB',
117  // 'offset': -16.0, 'precision': 0.000488, 'len': 16, 'name':
118  // 'ADS_AEB_TarAcce', 'is_signed_var': False, 'physical_range': '[-16|16]',
119  // 'bit': 39, 'type': 'double', 'order': 'motorola', 'physical_unit': 'm/s2'}
120  void set_p_ads_aeb_taracce(uint8_t* data, double ads_aeb_taracce);
121 
122  // config detail: {'description': 'Request of the AEB deceleration control.',
123  // 'enum': {0: 'ADS_AEB_TGTDECEL_REQ_NO_DEMAND', 1:
124  // 'ADS_AEB_TGTDECEL_REQ_DEMAND'}, 'precision': 1.0, 'len': 1, 'name':
125  // 'ADS_AEB_TgtDecel_Req', 'is_signed_var': False, 'offset': 0.0,
126  // 'physical_range': '[0|1]', 'bit': 31, 'type': 'enum', 'order': 'motorola',
127  // 'physical_unit': ''}
128  void set_p_ads_aeb_tgtdecel_req(
129  uint8_t* data, Ads1_111::Ads_aeb_tgtdecel_reqType ads_aeb_tgtdecel_req);
130 
131  private:
132  Ads1_111::Ads_dectostopType ads_dectostop_;
133  Ads1_111::Ads_modeType ads_mode_;
134  double ads_taracce_ = 0.0;
135  Ads1_111::Ads_driveoff_reqType ads_driveoff_req_;
136  double ads_aeb_taracce_ = 0.0;
137  Ads1_111::Ads_aeb_tgtdecel_reqType ads_aeb_tgtdecel_req_;
138 };
139 
140 } // namespace wey
141 } // namespace canbus
142 } // namespace apollo
Ads1111 * set_ads_dectostop(Ads1_111::Ads_dectostopType ads_dectostop)
Ads1111 * set_ads_aeb_taracce(double ads_aeb_taracce)
Ads1111 * set_ads_taracce(double ads_taracce)
void UpdateData(uint8_t *data) override
Ads1111 * set_ads_driveoff_req(Ads1_111::Ads_driveoff_reqType ads_driveoff_req)
PlanningContext is the runtime context in planning. It is persistent across multiple frames...
Definition: atomic_hash_map.h:25
This is the base class of protocol data.
Definition: protocol_data.h:44
uint32_t GetPeriod() const override
static const int32_t ID
Definition: ads1_111.h:29
Definition: ads1_111.h:26
The class of ProtocolData.
Ads1111 * set_ads_aeb_tgtdecel_req(Ads1_111::Ads_aeb_tgtdecel_reqType ads_aeb_tgtdecel_req)
Ads1111 * set_ads_mode(Ads1_111::Ads_modeType ads_mode)