提交 b8a3d6bb 编写于 作者: R Rongqi Qiu 提交者: siyangy

remove mobileye and delphi_esr drivers (#1052)

上级 40d2c923
load("//tools:cpplint.bzl", "cpplint")
package(default_visibility = ["//visibility:public"])
cc_library(
name = "delphi_esr_message_manager",
srcs = [
],
hdrs = [
"delphi_esr_message_manager.h",
],
deps = [
"//modules/common/adapters:adapter_manager",
"//modules/drivers/canbus:sensor_gflags",
"//modules/drivers/canbus/can_comm:message_manager_base",
"//modules/drivers/delphi_esr/protocol:drivers_delphi_esr_protocol",
],
)
cc_test(
name = "delphi_esr_message_manager_test",
size = "small",
srcs = [
"delphi_esr_message_manager_test.cc",
],
deps = [
"delphi_esr_message_manager",
"@gtest//:main",
],
)
cc_library(
name = "delphi_esr_canbus_lib",
srcs = [
],
hdrs = [
"delphi_esr_canbus.h",
],
deps = [
":delphi_esr_message_manager",
"//modules/drivers/canbus:sensor_canbus_lib",
"//modules/drivers/delphi_esr/protocol:drivers_delphi_esr_protocol",
],
)
cc_test(
name = "delphi_esr_canbus_test",
size = "small",
srcs = ["delphi_esr_canbus_test.cc"],
deps = [
":delphi_esr_canbus_lib",
":delphi_esr_message_manager",
"//modules/drivers/proto:sensor_proto",
"@gtest//:main",
],
)
cc_binary(
name = "delphi_esr",
srcs = ["main.cc"],
deps = [
":delphi_esr_canbus_lib",
"//external:gflags",
"//modules/common:log",
"//modules/common/monitor",
"//modules/drivers/canbus/common:canbus_common",
"@ros//:ros_common",
],
)
cpplint()
config {
type: DELPHIESR
mode: PUBLISH_ONLY
}
config {
type: MONITOR
mode: PUBLISH_ONLY
}
is_ros: true
--flagfile=modules/common/data/global_flagfile.txt
--alsologtostderr=1
--sensor_conf_file=modules/drivers/delphi_esr/conf/delphi_esr_conf.pb.txt
--adapter_config_filename=modules/drivers/delphi_esr/conf/adapter.conf
--node_namespace=/apollo/drivers/delphi_esr
--sensor_node_name=delphi_esr
--hmi_name=delphi_esr
--sensor_freq=0
can_card_parameter {
brand:ESD_CAN
type: PCI_CARD
channel_id: CHANNEL_ID_TWO
}
enable_debug_mode: false
enable_receiver_log: false
can_card_parameter {
brand: FAKE_CAN
type: PCI_CARD
channel_id: CHANNEL_ID_ZERO
}
enable_debug_mode: false
/******************************************************************************
* Copyright 2017 The Apollo Authors. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*****************************************************************************/
/**
* @file
*/
#ifndef MODULES_DRIVERS_DELPHI_ESR_DELPHI_ESR_CANBUS_H_
#define MODULES_DRIVERS_DELPHI_ESR_DELPHI_ESR_CANBUS_H_
#include "modules/drivers/canbus/sensor_canbus.h"
#include "modules/drivers/delphi_esr/delphi_esr_message_manager.h"
#include "modules/drivers/proto/delphi_esr.pb.h"
/**
* @namespace apollo::drivers
* @brief apollo::drivers
*/
namespace apollo {
namespace drivers {
/**
* @class SensorCanbus
*
* @brief template of canbus-based sensor module main class (e.g., delphi_esr).
*/
template <>
void SensorCanbus<DelphiESR>::PublishSensorData() {
DelphiESR delphi_esr;
sensor_message_manager_->GetSensorData(&delphi_esr);
ADEBUG << delphi_esr.ShortDebugString();
AdapterManager::FillDelphiESRHeader(FLAGS_sensor_node_name, &delphi_esr);
AdapterManager::PublishDelphiESR(delphi_esr);
}
} // namespace drivers
} // namespace apollo
#endif // MODULES_DRIVERS_DELPHI_ESR_DELPHI_ESR_CANBUS_H_
/******************************************************************************
* Copyright 2017 The Apollo Authors. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*****************************************************************************/
#include "modules/drivers/delphi_esr/delphi_esr_canbus.h"
#include "modules/drivers/delphi_esr/delphi_esr_message_manager.h"
#include "modules/drivers/proto/delphi_esr.pb.h"
#include "gtest/gtest.h"
namespace apollo {
namespace drivers {
using apollo::common::ErrorCode;
TEST(DelphiESRCanbusTest, Simple) {
SensorCanbus<DelphiESR> cb;
EXPECT_EQ(cb.Name(), "canbus");
}
} // namespace drivers
} // namespace apollo
/******************************************************************************
* Copyright 2017 The Apollo Authors. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*****************************************************************************/
/**
* @file delphi_esr_message_manager.h
* @brief The class of DelphiESRMessageManager
*/
#ifndef MODULES_DRIVERS_DELPHI_ESR_DELPHI_ESR_MESSAGE_MANAGER_H_
#define MODULES_DRIVERS_DELPHI_ESR_DELPHI_ESR_MESSAGE_MANAGER_H_
#include "modules/drivers/canbus/can_comm/message_manager.h"
#include "modules/drivers/proto/delphi_esr.pb.h"
#include "modules/common/adapters/adapter_manager.h"
#include "modules/drivers/canbus/sensor_gflags.h"
#include "modules/drivers/delphi_esr/protocol/acm_inst_req_7e0.h"
#include "modules/drivers/delphi_esr/protocol/acm_inst_resp_7e4.h"
#include "modules/drivers/delphi_esr/protocol/esr_sim1_5c0.h"
#include "modules/drivers/delphi_esr/protocol/esr_status1_4e0.h"
#include "modules/drivers/delphi_esr/protocol/esr_status2_4e1.h"
#include "modules/drivers/delphi_esr/protocol/esr_status3_4e2.h"
#include "modules/drivers/delphi_esr/protocol/esr_status4_4e3.h"
#include "modules/drivers/delphi_esr/protocol/esr_status5_5e4.h"
#include "modules/drivers/delphi_esr/protocol/esr_status6_5e5.h"
#include "modules/drivers/delphi_esr/protocol/esr_status7_5e6.h"
#include "modules/drivers/delphi_esr/protocol/esr_status8_5e7.h"
#include "modules/drivers/delphi_esr/protocol/esr_status9_5e8.h"
#include "modules/drivers/delphi_esr/protocol/esr_track01_500.h"
#include "modules/drivers/delphi_esr/protocol/esr_trackmotionpower_540.h"
#include "modules/drivers/delphi_esr/protocol/esr_valid1_5d0.h"
#include "modules/drivers/delphi_esr/protocol/esr_valid2_5d1.h"
#include "modules/drivers/delphi_esr/protocol/vehicle1_4f0.h"
#include "modules/drivers/delphi_esr/protocol/vehicle2_4f1.h"
#include "modules/drivers/delphi_esr/protocol/vehicle3_5f2.h"
#include "modules/drivers/delphi_esr/protocol/vehicle4_5f3.h"
#include "modules/drivers/delphi_esr/protocol/vehicle5_5f4.h"
#include "modules/drivers/delphi_esr/protocol/vehicle6_5f5.h"
namespace apollo {
namespace drivers {
namespace canbus {
using ::apollo::common::adapter::AdapterManager;
template <>
MessageManager<DelphiESR>::MessageManager() {
AddRecvProtocolData<::apollo::drivers::delphi_esr::Acminstreq7e0, true>();
AddRecvProtocolData<::apollo::drivers::delphi_esr::Acminstresp7e4, true>();
AddRecvProtocolData<::apollo::drivers::delphi_esr::Esrsim15c0, true>();
AddRecvProtocolData<::apollo::drivers::delphi_esr::Esrstatus14e0, true>();
AddRecvProtocolData<::apollo::drivers::delphi_esr::Esrstatus24e1, true>();
AddRecvProtocolData<::apollo::drivers::delphi_esr::Esrstatus34e2, true>();
AddRecvProtocolData<::apollo::drivers::delphi_esr::Esrstatus44e3, true>();
AddRecvProtocolData<::apollo::drivers::delphi_esr::Esrstatus55e4, true>();
AddRecvProtocolData<::apollo::drivers::delphi_esr::Esrstatus65e5, true>();
AddRecvProtocolData<::apollo::drivers::delphi_esr::Esrstatus75e6, true>();
AddRecvProtocolData<::apollo::drivers::delphi_esr::Esrstatus85e7, true>();
AddRecvProtocolData<::apollo::drivers::delphi_esr::Esrstatus95e8, true>();
AddRecvProtocolData<::apollo::drivers::delphi_esr::Esrtrack01500, true>();
AddRecvProtocolData<::apollo::drivers::delphi_esr::Esrtrackmotionpower540,
true>();
AddRecvProtocolData<::apollo::drivers::delphi_esr::Esrvalid15d0, true>();
AddRecvProtocolData<::apollo::drivers::delphi_esr::Esrvalid25d1, true>();
AddRecvProtocolData<::apollo::drivers::delphi_esr::Vehicle14f0, true>();
AddRecvProtocolData<::apollo::drivers::delphi_esr::Vehicle24f1, true>();
AddRecvProtocolData<::apollo::drivers::delphi_esr::Vehicle35f2, true>();
AddRecvProtocolData<::apollo::drivers::delphi_esr::Vehicle45f3, true>();
AddRecvProtocolData<::apollo::drivers::delphi_esr::Vehicle55f4, true>();
AddRecvProtocolData<::apollo::drivers::delphi_esr::Vehicle65f5, true>();
}
template <>
ProtocolData<DelphiESR> *MessageManager<DelphiESR>::GetMutableProtocolDataById(
const uint32_t message_id) {
uint32_t converted_message_id = message_id;
if (message_id >= 0x500 && message_id <= 0x539) {
// repeated obstacle info
converted_message_id = 0x500;
}
if (protocol_data_map_.find(converted_message_id) ==
protocol_data_map_.end()) {
ADEBUG << "Unable to get protocol data because of invalid message_id:"
<< message_id;
return nullptr;
}
return protocol_data_map_[converted_message_id];
}
template <>
void MessageManager<DelphiESR>::Parse(const uint32_t message_id,
const uint8_t *data, int32_t length) {
ProtocolData<DelphiESR> *sensor_protocol_data =
GetMutableProtocolDataById(message_id);
if (sensor_protocol_data == nullptr) {
return;
}
std::lock_guard<std::mutex> lock(sensor_data_mutex_);
sensor_protocol_data->Parse(data, length, &sensor_data_);
// trigger publishment
if (message_id == 0x5E5) {
cvar_.notify_all();
}
received_ids_.insert(message_id);
// check if need to check period
const auto it = check_ids_.find(message_id);
if (it != check_ids_.end()) {
const int64_t time = apollo::common::time::AsInt64<micros>(Clock::Now());
it->second.real_period = time - it->second.last_time;
// if period 1.5 large than base period, inc error_count
const double period_multiplier = 1.5;
if (it->second.real_period > (it->second.period * period_multiplier)) {
it->second.error_count += 1;
} else {
it->second.error_count = 0;
}
it->second.last_time = time;
}
}
} // namespace canbus
} // namespace drivers
} // namespace apollo
#endif // MODULES_DRIVERS_DELPHI_ESR_DELPHI_ESR_MESSAGE_MANAGER_H_
/******************************************************************************
* Copyright 2017 The Apollo Authors. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*****************************************************************************/
#include "modules/drivers/delphi_esr/delphi_esr_message_manager.h"
#include <memory>
#include <set>
#include "gtest/gtest.h"
#include "modules/drivers/canbus/can_comm/protocol_data.h"
#include "modules/drivers/proto/delphi_esr.pb.h"
namespace apollo {
namespace drivers {
using apollo::common::ErrorCode;
TEST(DelphiESRMessageManagerTest, TestProtocolTest4e0) {
::apollo::drivers::delphi_esr::Esrstatus14e0 test_4e0;
canbus::MessageManager<DelphiESR> manager;
int32_t length = 8;
uint8_t bytes[8];
bytes[0] = 0b00000010;
bytes[1] = 0b00000101;
bytes[2] = 0b00000101;
bytes[3] = 0b00000001;
bytes[4] = 0b00000101;
bytes[5] = 0b00000011;
manager.Parse(test_4e0.ID, bytes, length);
DelphiESR delphi_esr;
EXPECT_EQ(manager.GetSensorData(&delphi_esr), ErrorCode::OK);
EXPECT_EQ(delphi_esr.esr_status1_4e0().can_tx_scan_index(), 261);
}
} // namespace drivers
} // namespace apollo
/******************************************************************************
* Copyright 2017 The Apollo Authors. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*****************************************************************************/
#include "modules/common/apollo_app.h"
#include "modules/drivers/delphi_esr/delphi_esr_canbus.h"
using ::apollo::drivers::DelphiESR;
APOLLO_MAIN(::apollo::drivers::SensorCanbus<DelphiESR>);
load("//tools:cpplint.bzl", "cpplint")
package(default_visibility = ["//visibility:public"])
cc_library(
name = "drivers_delphi_esr_protocol",
srcs = glob([
"*.cc",
]),
hdrs = glob([
"*.h",
]),
deps = [
"//modules/drivers/canbus/can_comm:message_manager_base",
"//modules/drivers/proto:sensor_proto",
],
)
cpplint()
/******************************************************************************
* Copyright 2017 The Apollo Authors. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*****************************************************************************/
#include "modules/drivers/delphi_esr/protocol/acm_inst_req_7e0.h"
#include "glog/logging.h"
#include "modules/drivers/canbus/common/byte.h"
#include "modules/drivers/canbus/common/canbus_consts.h"
namespace apollo {
namespace drivers {
namespace delphi_esr {
using apollo::drivers::canbus::Byte;
Acminstreq7e0::Acminstreq7e0() {}
const int32_t Acminstreq7e0::ID = 0x7E0;
void Acminstreq7e0::Parse(const std::uint8_t* bytes, int32_t length,
DelphiESR* delphi_esr) const {
delphi_esr->mutable_acm_inst_req_7e0()->set_command_ctr(
command_ctr(bytes, length));
delphi_esr->mutable_acm_inst_req_7e0()->set_command_code(
command_code(bytes, length));
delphi_esr->mutable_acm_inst_req_7e0()->set_cc_word_2(
cc_word_2(bytes, length));
delphi_esr->mutable_acm_inst_req_7e0()->set_cc_word_1(
cc_word_1(bytes, length));
delphi_esr->mutable_acm_inst_req_7e0()->set_cc_byte_2(
cc_byte_2(bytes, length));
delphi_esr->mutable_acm_inst_req_7e0()->set_cc_byte_1(
cc_byte_1(bytes, length));
}
// config detail: {'name': 'command_ctr', 'offset': 0.0, 'precision': 1.0,
// 'len': 8, 'is_signed_var': False, 'physical_range': '[0|0]', 'bit': 15,
// 'type': 'int', 'order': 'motorola', 'physical_unit': ''}
int Acminstreq7e0::command_ctr(const std::uint8_t* bytes,
int32_t length) const {
Byte t0(bytes + 1);
int32_t x = t0.get_byte(0, 8);
int ret = x;
return ret;
}
// config detail: {'name': 'command_code', 'offset': 0.0, 'precision': 1.0,
// 'len': 8, 'is_signed_var': False, 'physical_range': '[0|0]', 'bit': 7,
// 'type': 'int', 'order': 'motorola', 'physical_unit': ''}
int Acminstreq7e0::command_code(const std::uint8_t* bytes,
int32_t length) const {
Byte t0(bytes + 0);
int32_t x = t0.get_byte(0, 8);
int ret = x;
return ret;
}
// config detail: {'name': 'cc_word_2', 'offset': 0.0, 'precision': 1.0, 'len':
// 16, 'is_signed_var': False, 'physical_range': '[0|0]', 'bit': 55, 'type':
// 'int', 'order': 'motorola', 'physical_unit': ''}
int Acminstreq7e0::cc_word_2(const std::uint8_t* bytes, int32_t length) const {
Byte t0(bytes + 6);
int32_t x = t0.get_byte(0, 8);
Byte t1(bytes + 7);
int32_t t = t1.get_byte(0, 8);
x <<= 8;
x |= t;
int ret = x;
return ret;
}
// config detail: {'name': 'cc_word_1', 'offset': 0.0, 'precision': 1.0, 'len':
// 16, 'is_signed_var': False, 'physical_range': '[0|0]', 'bit': 39, 'type':
// 'int', 'order': 'motorola', 'physical_unit': ''}
int Acminstreq7e0::cc_word_1(const std::uint8_t* bytes, int32_t length) const {
Byte t0(bytes + 4);
int32_t x = t0.get_byte(0, 8);
Byte t1(bytes + 5);
int32_t t = t1.get_byte(0, 8);
x <<= 8;
x |= t;
int ret = x;
return ret;
}
// config detail: {'name': 'cc_byte_2', 'offset': 0.0, 'precision': 1.0, 'len':
// 8, 'is_signed_var': False, 'physical_range': '[0|0]', 'bit': 31, 'type':
// 'int', 'order': 'motorola', 'physical_unit': ''}
int Acminstreq7e0::cc_byte_2(const std::uint8_t* bytes, int32_t length) const {
Byte t0(bytes + 3);
int32_t x = t0.get_byte(0, 8);
int ret = x;
return ret;
}
// config detail: {'name': 'cc_byte_1', 'offset': 0.0, 'precision': 1.0, 'len':
// 8, 'is_signed_var': False, 'physical_range': '[0|0]', 'bit': 23, 'type':
// 'int', 'order': 'motorola', 'physical_unit': ''}
int Acminstreq7e0::cc_byte_1(const std::uint8_t* bytes, int32_t length) const {
Byte t0(bytes + 2);
int32_t x = t0.get_byte(0, 8);
int ret = x;
return ret;
}
} // namespace delphi_esr
} // namespace drivers
} // namespace apollo
/******************************************************************************
* Copyright 2017 The Apollo Authors. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*****************************************************************************/
#ifndef MODULES_DRIVERS_DELPHI_ESR_PROTOCOL_ACM_INST_REQ_7E0_H_
#define MODULES_DRIVERS_DELPHI_ESR_PROTOCOL_ACM_INST_REQ_7E0_H_
#include "modules/drivers/proto/delphi_esr.pb.h"
#include "modules/drivers/canbus/can_comm/protocol_data.h"
namespace apollo {
namespace drivers {
namespace delphi_esr {
using apollo::drivers::DelphiESR;
class Acminstreq7e0 : public apollo::drivers::canbus::ProtocolData<DelphiESR> {
public:
static const int32_t ID;
Acminstreq7e0();
void Parse(const std::uint8_t* bytes, int32_t length,
DelphiESR* delphi_esr) const override;
private:
// config detail: {'name': 'command_ctr', 'offset': 0.0, 'precision': 1.0,
// 'len': 8, 'is_signed_var': False, 'physical_range': '[0|0]', 'bit': 15,
// 'type': 'int', 'order': 'motorola', 'physical_unit': ''}
int command_ctr(const std::uint8_t* bytes, const int32_t length) const;
// config detail: {'name': 'command_code', 'offset': 0.0, 'precision': 1.0,
// 'len': 8, 'is_signed_var': False, 'physical_range': '[0|0]', 'bit': 7,
// 'type': 'int', 'order': 'motorola', 'physical_unit': ''}
int command_code(const std::uint8_t* bytes, const int32_t length) const;
// config detail: {'name': 'cc_word_2', 'offset': 0.0, 'precision': 1.0,
// 'len': 16, 'is_signed_var': False, 'physical_range': '[0|0]', 'bit': 55,
// 'type': 'int', 'order': 'motorola', 'physical_unit': ''}
int cc_word_2(const std::uint8_t* bytes, const int32_t length) const;
// config detail: {'name': 'cc_word_1', 'offset': 0.0, 'precision': 1.0,
// 'len': 16, 'is_signed_var': False, 'physical_range': '[0|0]', 'bit': 39,
// 'type': 'int', 'order': 'motorola', 'physical_unit': ''}
int cc_word_1(const std::uint8_t* bytes, const int32_t length) const;
// config detail: {'name': 'cc_byte_2', 'offset': 0.0, 'precision': 1.0,
// 'len': 8, 'is_signed_var': False, 'physical_range': '[0|0]', 'bit': 31,
// 'type': 'int', 'order': 'motorola', 'physical_unit': ''}
int cc_byte_2(const std::uint8_t* bytes, const int32_t length) const;
// config detail: {'name': 'cc_byte_1', 'offset': 0.0, 'precision': 1.0,
// 'len': 8, 'is_signed_var': False, 'physical_range': '[0|0]', 'bit': 23,
// 'type': 'int', 'order': 'motorola', 'physical_unit': ''}
int cc_byte_1(const std::uint8_t* bytes, const int32_t length) const;
};
} // namespace delphi_esr
} // namespace drivers
} // namespace apollo
#endif // MODULES_CANBUS_VEHICL_ESR_PROTOCOL_ACM_INST_REQ_7E0_H_
/******************************************************************************
* Copyright 2017 The Apollo Authors. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*****************************************************************************/
#include "modules/drivers/delphi_esr/protocol/acm_inst_resp_7e4.h"
#include "glog/logging.h"
#include "modules/drivers/canbus/common/byte.h"
#include "modules/drivers/canbus/common/canbus_consts.h"
namespace apollo {
namespace drivers {
namespace delphi_esr {
using apollo::drivers::canbus::Byte;
Acminstresp7e4::Acminstresp7e4() {}
const int32_t Acminstresp7e4::ID = 0x7E4;
void Acminstresp7e4::Parse(const std::uint8_t* bytes, int32_t length,
DelphiESR* delphi_esr) const {
delphi_esr->mutable_acm_inst_resp_7e4()->set_data_7(data_7(bytes, length));
delphi_esr->mutable_acm_inst_resp_7e4()->set_data_6(data_6(bytes, length));
delphi_esr->mutable_acm_inst_resp_7e4()->set_data_5(data_5(bytes, length));
delphi_esr->mutable_acm_inst_resp_7e4()->set_data_4(data_4(bytes, length));
delphi_esr->mutable_acm_inst_resp_7e4()->set_data_3(data_3(bytes, length));
delphi_esr->mutable_acm_inst_resp_7e4()->set_rtn_cmd_counter(
rtn_cmd_counter(bytes, length));
delphi_esr->mutable_acm_inst_resp_7e4()->set_command_return_code(
command_return_code(bytes, length));
delphi_esr->mutable_acm_inst_resp_7e4()->set_pid(pid(bytes, length));
}
// config detail: {'name': 'data_7', 'offset': 0.0, 'precision': 1.0, 'len': 8,
// 'is_signed_var': False, 'physical_range': '[0|0]', 'bit': 63, 'type': 'int',
// 'order': 'motorola', 'physical_unit': ''}
int Acminstresp7e4::data_7(const std::uint8_t* bytes, int32_t length) const {
Byte t0(bytes + 7);
int32_t x = t0.get_byte(0, 8);
int ret = x;
return ret;
}
// config detail: {'name': 'data_6', 'offset': 0.0, 'precision': 1.0, 'len': 8,
// 'is_signed_var': False, 'physical_range': '[0|0]', 'bit': 55, 'type': 'int',
// 'order': 'motorola', 'physical_unit': ''}
int Acminstresp7e4::data_6(const std::uint8_t* bytes, int32_t length) const {
Byte t0(bytes + 6);
int32_t x = t0.get_byte(0, 8);
int ret = x;
return ret;
}
// config detail: {'name': 'data_5', 'offset': 0.0, 'precision': 1.0, 'len': 8,
// 'is_signed_var': False, 'physical_range': '[0|0]', 'bit': 47, 'type': 'int',
// 'order': 'motorola', 'physical_unit': ''}
int Acminstresp7e4::data_5(const std::uint8_t* bytes, int32_t length) const {
Byte t0(bytes + 5);
int32_t x = t0.get_byte(0, 8);
int ret = x;
return ret;
}
// config detail: {'name': 'data_4', 'offset': 0.0, 'precision': 1.0, 'len': 8,
// 'is_signed_var': False, 'physical_range': '[0|0]', 'bit': 39, 'type': 'int',
// 'order': 'motorola', 'physical_unit': ''}
int Acminstresp7e4::data_4(const std::uint8_t* bytes, int32_t length) const {
Byte t0(bytes + 4);
int32_t x = t0.get_byte(0, 8);
int ret = x;
return ret;
}
// config detail: {'name': 'data_3', 'offset': 0.0, 'precision': 1.0, 'len': 8,
// 'is_signed_var': False, 'physical_range': '[0|0]', 'bit': 31, 'type': 'int',
// 'order': 'motorola', 'physical_unit': ''}
int Acminstresp7e4::data_3(const std::uint8_t* bytes, int32_t length) const {
Byte t0(bytes + 3);
int32_t x = t0.get_byte(0, 8);
int ret = x;
return ret;
}
// config detail: {'name': 'rtn_cmd_counter', 'offset': 0.0, 'precision': 1.0,
// 'len': 8, 'is_signed_var': False, 'physical_range': '[0|0]', 'bit': 23,
// 'type': 'int', 'order': 'motorola', 'physical_unit': ''}
int Acminstresp7e4::rtn_cmd_counter(const std::uint8_t* bytes,
int32_t length) const {
Byte t0(bytes + 2);
int32_t x = t0.get_byte(0, 8);
int ret = x;
return ret;
}
// config detail: {'name': 'command_return_code', 'offset': 0.0, 'precision':
// 1.0, 'len': 8, 'is_signed_var': False, 'physical_range': '[0|0]', 'bit': 15,
// 'type': 'int', 'order': 'motorola', 'physical_unit': ''}
int Acminstresp7e4::command_return_code(const std::uint8_t* bytes,
int32_t length) const {
Byte t0(bytes + 1);
int32_t x = t0.get_byte(0, 8);
int ret = x;
return ret;
}
// config detail: {'name': 'pid', 'offset': 0.0, 'precision': 1.0, 'len': 8,
// 'is_signed_var': False, 'physical_range': '[0|0]', 'bit': 7, 'type': 'int',
// 'order': 'motorola', 'physical_unit': ''}
int Acminstresp7e4::pid(const std::uint8_t* bytes, int32_t length) const {
Byte t0(bytes + 0);
int32_t x = t0.get_byte(0, 8);
int ret = x;
return ret;
}
} // namespace delphi_esr
} // namespace drivers
} // namespace apollo
/******************************************************************************
* Copyright 2017 The Apollo Authors. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*****************************************************************************/
#ifndef MODULES_DRIVERS_DELPHI_ESR_PROTOCOL_ACM_INST_RESP_7E4_H_
#define MODULES_DRIVERS_DELPHI_ESR_PROTOCOL_ACM_INST_RESP_7E4_H_
#include "modules/drivers/proto/delphi_esr.pb.h"
#include "modules/drivers/canbus/can_comm/protocol_data.h"
namespace apollo {
namespace drivers {
namespace delphi_esr {
using apollo::drivers::DelphiESR;
class Acminstresp7e4 : public apollo::drivers::canbus::ProtocolData<DelphiESR> {
public:
static const int32_t ID;
Acminstresp7e4();
void Parse(const std::uint8_t* bytes, int32_t length,
DelphiESR* delphi_esr) const override;
private:
// config detail: {'name': 'Data_7', 'offset': 0.0, 'precision': 1.0, 'len':
// 8, 'is_signed_var': False, 'physical_range': '[0|0]', 'bit': 63, 'type':
// 'int', 'order': 'motorola', 'physical_unit': ''}
int data_7(const std::uint8_t* bytes, const int32_t length) const;
// config detail: {'name': 'Data_6', 'offset': 0.0, 'precision': 1.0, 'len':
// 8, 'is_signed_var': False, 'physical_range': '[0|0]', 'bit': 55, 'type':
// 'int', 'order': 'motorola', 'physical_unit': ''}
int data_6(const std::uint8_t* bytes, const int32_t length) const;
// config detail: {'name': 'Data_5', 'offset': 0.0, 'precision': 1.0, 'len':
// 8, 'is_signed_var': False, 'physical_range': '[0|0]', 'bit': 47, 'type':
// 'int', 'order': 'motorola', 'physical_unit': ''}
int data_5(const std::uint8_t* bytes, const int32_t length) const;
// config detail: {'name': 'Data_4', 'offset': 0.0, 'precision': 1.0, 'len':
// 8, 'is_signed_var': False, 'physical_range': '[0|0]', 'bit': 39, 'type':
// 'int', 'order': 'motorola', 'physical_unit': ''}
int data_4(const std::uint8_t* bytes, const int32_t length) const;
// config detail: {'name': 'Data_3', 'offset': 0.0, 'precision': 1.0, 'len':
// 8, 'is_signed_var': False, 'physical_range': '[0|0]', 'bit': 31, 'type':
// 'int', 'order': 'motorola', 'physical_unit': ''}
int data_3(const std::uint8_t* bytes, const int32_t length) const;
// config detail: {'name': 'rtn_cmd_counter', 'offset': 0.0, 'precision': 1.0,
// 'len': 8, 'is_signed_var': False, 'physical_range': '[0|0]', 'bit': 23,
// 'type': 'int', 'order': 'motorola', 'physical_unit': ''}
int rtn_cmd_counter(const std::uint8_t* bytes, const int32_t length) const;
// config detail: {'name': 'command_return_code', 'offset': 0.0, 'precision':
// 1.0, 'len': 8, 'is_signed_var': False, 'physical_range': '[0|0]', 'bit':
// 15, 'type': 'int', 'order': 'motorola', 'physical_unit': ''}
int command_return_code(const std::uint8_t* bytes,
const int32_t length) const;
// config detail: {'name': 'PID', 'offset': 0.0, 'precision': 1.0, 'len': 8,
// 'is_signed_var': False, 'physical_range': '[0|0]', 'bit': 7, 'type': 'int',
// 'order': 'motorola', 'physical_unit': ''}
int pid(const std::uint8_t* bytes, const int32_t length) const;
};
} // namespace delphi_esr
} // namespace drivers
} // namespace apollo
#endif // MODULES_CANBUS_VEHICL_ESR_PROTOCOL_ACM_INST_RESP_7E4_H_
/******************************************************************************
* Copyright 2017 The Apollo Authors. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*****************************************************************************/
#include "modules/drivers/delphi_esr/protocol/esr_sim1_5c0.h"
#include "glog/logging.h"
#include "modules/drivers/canbus/common/byte.h"
#include "modules/drivers/canbus/common/canbus_consts.h"
namespace apollo {
namespace drivers {
namespace delphi_esr {
using apollo::drivers::canbus::Byte;
Esrsim15c0::Esrsim15c0() {}
const int32_t Esrsim15c0::ID = 0x5C0;
void Esrsim15c0::Parse(const std::uint8_t* bytes, int32_t length,
DelphiESR* delphi_esr) const {
delphi_esr->mutable_esr_sim1_5c0()->set_can_rx_sim_track_id(
can_rx_sim_track_id(bytes, length));
delphi_esr->mutable_esr_sim1_5c0()->set_can_rx_sim_status(
can_rx_sim_status(bytes, length));
delphi_esr->mutable_esr_sim1_5c0()->set_can_rx_sim_range_rate(
can_rx_sim_range_rate(bytes, length));
delphi_esr->mutable_esr_sim1_5c0()->set_can_rx_sim_range_accel(
can_rx_sim_range_accel(bytes, length));
delphi_esr->mutable_esr_sim1_5c0()->set_can_rx_sim_range(
can_rx_sim_range(bytes, length));
delphi_esr->mutable_esr_sim1_5c0()->set_can_rx_sim_lat_rate(
can_rx_sim_lat_rate(bytes, length));
delphi_esr->mutable_esr_sim1_5c0()->set_can_rx_sim_lat_pos(
can_rx_sim_lat_pos(bytes, length));
delphi_esr->mutable_esr_sim1_5c0()->set_can_rx_sim_function(
can_rx_sim_function(bytes, length));
delphi_esr->mutable_esr_sim1_5c0()->set_can_rx_sim_angle(
can_rx_sim_angle(bytes, length));
}
// config detail: {'name': 'can_rx_sim_track_id', 'enum': {0:
// 'CAN_RX_SIM_TRACK_ID_NO_TARGET', 1: 'CAN_RX_SIM_TRACK_ID_TARGET_1', 2:
// 'CAN_RX_SIM_TRACK_ID_TARGET_2'}, 'precision': 1.0, 'len': 2, 'is_signed_var':
// False, 'offset': 0.0, 'physical_range': '[0|0]', 'bit': 6, 'type': 'enum',
// 'order': 'motorola', 'physical_unit': ''}
Esr_sim1_5c0::Can_rx_sim_track_idType Esrsim15c0::can_rx_sim_track_id(
const std::uint8_t* bytes, int32_t length) const {
Byte t0(bytes + 0);
int32_t x = t0.get_byte(5, 2);
Esr_sim1_5c0::Can_rx_sim_track_idType ret =
static_cast<Esr_sim1_5c0::Can_rx_sim_track_idType>(x);
return ret;
}
// config detail: {'name': 'can_rx_sim_status', 'enum': {0:
// 'CAN_RX_SIM_STATUS_INVALID', 1: 'CAN_RX_SIM_STATUS_NEW', 2:
// 'CAN_RX_SIM_STATUS_UPDATED', 3: 'CAN_RX_SIM_STATUS_COASTED'}, 'precision':
// 1.0, 'len': 2, 'is_signed_var': False, 'offset': 0.0, 'physical_range':
// '[0|0]', 'bit': 4, 'type': 'enum', 'order': 'motorola', 'physical_unit': ''}
Esr_sim1_5c0::Can_rx_sim_statusType Esrsim15c0::can_rx_sim_status(
const std::uint8_t* bytes, int32_t length) const {
Byte t0(bytes + 0);
int32_t x = t0.get_byte(3, 2);
Esr_sim1_5c0::Can_rx_sim_statusType ret =
static_cast<Esr_sim1_5c0::Can_rx_sim_statusType>(x);
return ret;
}
// config detail: {'name': 'can_rx_sim_range_rate', 'offset': 0.0, 'precision':
// 0.25, 'len': 8, 'is_signed_var': True, 'physical_range': '[-32|31.75]',
// 'bit': 55, 'type': 'double', 'order': 'motorola', 'physical_unit': 'm/s'}
double Esrsim15c0::can_rx_sim_range_rate(const std::uint8_t* bytes,
int32_t length) const {
Byte t0(bytes + 6);
int32_t x = t0.get_byte(0, 8);
x <<= 24;
x >>= 24;
double ret = x * 0.250000;
return ret;
}
// config detail: {'name': 'can_rx_sim_range_accel', 'offset': 0.0, 'precision':
// 0.25, 'len': 8, 'is_signed_var': True, 'physical_range': '[-32|31.75]',
// 'bit': 47, 'type': 'double', 'order': 'motorola', 'physical_unit': 'm/s/s'}
double Esrsim15c0::can_rx_sim_range_accel(const std::uint8_t* bytes,
int32_t length) const {
Byte t0(bytes + 5);
int32_t x = t0.get_byte(0, 8);
x <<= 24;
x >>= 24;
double ret = x * 0.250000;
return ret;
}
// config detail: {'name': 'can_rx_sim_range', 'offset': 0.0, 'precision': 1.0,
// 'len': 8, 'is_signed_var': False, 'physical_range': '[0|0]', 'bit': 39,
// 'type': 'int', 'order': 'motorola', 'physical_unit': 'm'}
int Esrsim15c0::can_rx_sim_range(const std::uint8_t* bytes,
int32_t length) const {
Byte t0(bytes + 4);
int32_t x = t0.get_byte(0, 8);
int ret = x;
return ret;
}
// config detail: {'name': 'can_rx_sim_lat_rate', 'offset': 0.0, 'precision':
// 0.25, 'len': 8, 'is_signed_var': True, 'physical_range': '[-32|31.75]',
// 'bit': 31, 'type': 'double', 'order': 'motorola', 'physical_unit': 'm/s'}
double Esrsim15c0::can_rx_sim_lat_rate(const std::uint8_t* bytes,
int32_t length) const {
Byte t0(bytes + 3);
int32_t x = t0.get_byte(0, 8);
x <<= 24;
x >>= 24;
double ret = x * 0.250000;
return ret;
}
// config detail: {'name': 'can_rx_sim_lat_pos', 'offset': 0.0, 'precision':
// 0.25, 'len': 8, 'is_signed_var': True, 'physical_range': '[-32|31.75]',
// 'bit': 23, 'type': 'double', 'order': 'motorola', 'physical_unit': 'm'}
double Esrsim15c0::can_rx_sim_lat_pos(const std::uint8_t* bytes,
int32_t length) const {
Byte t0(bytes + 2);
int32_t x = t0.get_byte(0, 8);
x <<= 24;
x >>= 24;
double ret = x * 0.250000;
return ret;
}
// config detail: {'name': 'can_rx_sim_function', 'enum': {0:
// 'CAN_RX_SIM_FUNCTION_ACC', 1: 'CAN_RX_SIM_FUNCTION_RI', 2:
// 'CAN_RX_SIM_FUNCTION_FCW_MOVE', 3: 'CAN_RX_SIM_FUNCTION_FCW_STAT', 4:
// 'CAN_RX_SIM_FUNCTION_CMBB_MOVE', 5: 'CAN_RX_SIM_FUNCTION_CMBB_STAT', 6:
// 'CAN_RX_SIM_FUNCTION_ALL_MOVING_ACC_FCW_CMBB', 7:
// 'CAN_RX_SIM_FUNCTION_ALL_STAT_RI_FCW_CMBB'}, 'precision': 1.0, 'len': 3,
// 'is_signed_var': False, 'offset': 0.0, 'physical_range': '[0|0]', 'bit': 2,
// 'type': 'enum', 'order': 'motorola', 'physical_unit': ''}
Esr_sim1_5c0::Can_rx_sim_functionType Esrsim15c0::can_rx_sim_function(
const std::uint8_t* bytes, int32_t length) const {
Byte t0(bytes + 0);
int32_t x = t0.get_byte(0, 3);
Esr_sim1_5c0::Can_rx_sim_functionType ret =
static_cast<Esr_sim1_5c0::Can_rx_sim_functionType>(x);
return ret;
}
// config detail: {'name': 'can_rx_sim_angle', 'offset': 0.0, 'precision': 0.5,
// 'len': 8, 'is_signed_var': True, 'physical_range': '[-64|63.5]', 'bit': 15,
// 'type': 'double', 'order': 'motorola', 'physical_unit': 'deg'}
double Esrsim15c0::can_rx_sim_angle(const std::uint8_t* bytes,
int32_t length) const {
Byte t0(bytes + 1);
int32_t x = t0.get_byte(0, 8);
x <<= 24;
x >>= 24;
double ret = x * 0.500000;
return ret;
}
} // namespace delphi_esr
} // namespace drivers
} // namespace apollo
/******************************************************************************
* Copyright 2017 The Apollo Authors. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*****************************************************************************/
#ifndef MODULES_DRIVERS_DELPHI_ESR_PROTOCOL_ESR_SIM1_5C0_H_
#define MODULES_DRIVERS_DELPHI_ESR_PROTOCOL_ESR_SIM1_5C0_H_
#include "modules/drivers/proto/delphi_esr.pb.h"
#include "modules/drivers/canbus/can_comm/protocol_data.h"
namespace apollo {
namespace drivers {
namespace delphi_esr {
using apollo::drivers::DelphiESR;
class Esrsim15c0 : public apollo::drivers::canbus::ProtocolData<DelphiESR> {
public:
static const int32_t ID;
Esrsim15c0();
void Parse(const std::uint8_t* bytes, int32_t length,
DelphiESR* delphi_esr) const override;
private:
// config detail: {'name': 'CAN_RX_SIM_TRACK_ID', 'enum': {0:
// 'CAN_RX_SIM_TRACK_ID_NO_TARGET', 1: 'CAN_RX_SIM_TRACK_ID_TARGET_1', 2:
// 'CAN_RX_SIM_TRACK_ID_TARGET_2'}, 'precision': 1.0, 'len': 2,
// 'is_signed_var': False, 'offset': 0.0, 'physical_range': '[0|0]', 'bit': 6,
// 'type': 'enum', 'order': 'motorola', 'physical_unit': ''}
Esr_sim1_5c0::Can_rx_sim_track_idType can_rx_sim_track_id(
const std::uint8_t* bytes, const int32_t length) const;
// config detail: {'name': 'CAN_RX_SIM_STATUS', 'enum': {0:
// 'CAN_RX_SIM_STATUS_INVALID', 1: 'CAN_RX_SIM_STATUS_NEW', 2:
// 'CAN_RX_SIM_STATUS_UPDATED', 3: 'CAN_RX_SIM_STATUS_COASTED'}, 'precision':
// 1.0, 'len': 2, 'is_signed_var': False, 'offset': 0.0, 'physical_range':
// '[0|0]', 'bit': 4, 'type': 'enum', 'order': 'motorola', 'physical_unit':
// ''}
Esr_sim1_5c0::Can_rx_sim_statusType can_rx_sim_status(
const std::uint8_t* bytes, const int32_t length) const;
// config detail: {'name': 'CAN_RX_SIM_RANGE_RATE', 'offset': 0.0,
// 'precision': 0.25, 'len': 8, 'is_signed_var': True, 'physical_range':
// '[-32|31.75]', 'bit': 55, 'type': 'double', 'order': 'motorola',
// 'physical_unit': 'm/s'}
double can_rx_sim_range_rate(const std::uint8_t* bytes,
const int32_t length) const;
// config detail: {'name': 'CAN_RX_SIM_RANGE_ACCEL', 'offset': 0.0,
// 'precision': 0.25, 'len': 8, 'is_signed_var': True, 'physical_range':
// '[-32|31.75]', 'bit': 47, 'type': 'double', 'order': 'motorola',
// 'physical_unit': 'm/s/s'}
double can_rx_sim_range_accel(const std::uint8_t* bytes,
const int32_t length) const;
// config detail: {'name': 'CAN_RX_SIM_RANGE', 'offset': 0.0, 'precision':
// 1.0, 'len': 8, 'is_signed_var': False, 'physical_range': '[0|0]', 'bit':
// 39, 'type': 'int', 'order': 'motorola', 'physical_unit': 'm'}
int can_rx_sim_range(const std::uint8_t* bytes, const int32_t length) const;
// config detail: {'name': 'CAN_RX_SIM_LAT_RATE', 'offset': 0.0, 'precision':
// 0.25, 'len': 8, 'is_signed_var': True, 'physical_range': '[-32|31.75]',
// 'bit': 31, 'type': 'double', 'order': 'motorola', 'physical_unit': 'm/s'}
double can_rx_sim_lat_rate(const std::uint8_t* bytes,
const int32_t length) const;
// config detail: {'name': 'CAN_RX_SIM_LAT_POS', 'offset': 0.0, 'precision':
// 0.25, 'len': 8, 'is_signed_var': True, 'physical_range': '[-32|31.75]',
// 'bit': 23, 'type': 'double', 'order': 'motorola', 'physical_unit': 'm'}
double can_rx_sim_lat_pos(const std::uint8_t* bytes,
const int32_t length) const;
// config detail: {'name': 'CAN_RX_SIM_FUNCTION', 'enum': {0:
// 'CAN_RX_SIM_FUNCTION_ACC', 1: 'CAN_RX_SIM_FUNCTION_RI', 2:
// 'CAN_RX_SIM_FUNCTION_FCW_MOVE', 3: 'CAN_RX_SIM_FUNCTION_FCW_STAT', 4:
// 'CAN_RX_SIM_FUNCTION_CMBB_MOVE', 5: 'CAN_RX_SIM_FUNCTION_CMBB_STAT', 6:
// 'CAN_RX_SIM_FUNCTION_ALL_MOVING_ACC_FCW_CMBB', 7:
// 'CAN_RX_SIM_FUNCTION_ALL_STAT_RI_FCW_CMBB'}, 'precision': 1.0, 'len': 3,
// 'is_signed_var': False, 'offset': 0.0, 'physical_range': '[0|0]', 'bit': 2,
// 'type': 'enum', 'order': 'motorola', 'physical_unit': ''}
Esr_sim1_5c0::Can_rx_sim_functionType can_rx_sim_function(
const std::uint8_t* bytes, const int32_t length) const;
// config detail: {'name': 'CAN_RX_SIM_ANGLE', 'offset': 0.0, 'precision':
// 0.5, 'len': 8, 'is_signed_var': True, 'physical_range': '[-64|63.5]',
// 'bit': 15, 'type': 'double', 'order': 'motorola', 'physical_unit': 'deg'}
double can_rx_sim_angle(const std::uint8_t* bytes,
const int32_t length) const;
};
} // namespace delphi_esr
} // namespace drivers
} // namespace apollo
#endif // MODULES_CANBUS_VEHICL_ESR_PROTOCOL_ESR_SIM1_5C0_H_
/******************************************************************************
* Copyright 2017 The Apollo Authors. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*****************************************************************************/
#include "modules/drivers/delphi_esr/protocol/esr_status1_4e0.h"
#include "glog/logging.h"
#include "modules/drivers/canbus/common/byte.h"
#include "modules/drivers/canbus/common/canbus_consts.h"
namespace apollo {
namespace drivers {
namespace delphi_esr {
using apollo::drivers::canbus::Byte;
Esrstatus14e0::Esrstatus14e0() {}
const int32_t Esrstatus14e0::ID = 0x4E0;
void Esrstatus14e0::Parse(const std::uint8_t* bytes, int32_t length,
DelphiESR* delphi_esr) const {
delphi_esr->mutable_esr_status1_4e0()->set_can_tx_dsp_timestamp(
can_tx_dsp_timestamp(bytes, length));
delphi_esr->mutable_esr_status1_4e0()->set_can_tx_comm_error(
can_tx_comm_error(bytes, length));
delphi_esr->mutable_esr_status1_4e0()->set_can_tx_yaw_rate_calc(
can_tx_yaw_rate_calc(bytes, length));
delphi_esr->mutable_esr_status1_4e0()->set_can_tx_vehicle_speed_calc(
can_tx_vehicle_speed_calc(bytes, length));
delphi_esr->mutable_esr_status1_4e0()->set_can_tx_scan_index(
can_tx_scan_index(bytes, length));
delphi_esr->mutable_esr_status1_4e0()->set_can_tx_rolling_count_1(
can_tx_rolling_count_1(bytes, length));
delphi_esr->mutable_esr_status1_4e0()->set_can_tx_radius_curvature_calc(
can_tx_radius_curvature_calc(bytes, length));
}
// config detail: {'name': 'can_tx_dsp_timestamp', 'offset': 0.0, 'precision':
// 2.0, 'len': 7, 'is_signed_var': False, 'physical_range': '[0|254]', 'bit': 5,
// 'type': 'double', 'order': 'motorola', 'physical_unit': 'ms'}
double Esrstatus14e0::can_tx_dsp_timestamp(const std::uint8_t* bytes,
int32_t length) const {
Byte t0(bytes + 0);
int32_t x = t0.get_byte(0, 6);
Byte t1(bytes + 1);
int32_t t = t1.get_byte(7, 1);
x <<= 1;
x |= t;
double ret = x * 2.000000;
return ret;
}
// config detail: {'name': 'can_tx_comm_error', 'offset': 0.0, 'precision': 1.0,
// 'len': 1, 'is_signed_var': False, 'physical_range': '[0|0]', 'bit': 14,
// 'type': 'bool', 'order': 'motorola', 'physical_unit': ''}
bool Esrstatus14e0::can_tx_comm_error(const std::uint8_t* bytes,
int32_t length) const {
Byte t0(bytes + 1);
int32_t x = t0.get_byte(6, 1);
bool ret = x;
return ret;
}
// config detail: {'name': 'can_tx_yaw_rate_calc', 'offset': 0.0, 'precision':
// 0.0625, 'len': 12, 'is_signed_var': True, 'physical_range':
// '[-128|127.9375]', 'bit': 47, 'type': 'double', 'order': 'motorola',
// 'physical_unit': 'deg/s'}
double Esrstatus14e0::can_tx_yaw_rate_calc(const std::uint8_t* bytes,
int32_t length) const {
Byte t0(bytes + 5);
int32_t x = t0.get_byte(0, 8);
Byte t1(bytes + 6);
int32_t t = t1.get_byte(4, 4);
x <<= 4;
x |= t;
x <<= 20;
x >>= 20;
double ret = x * 0.062500;
return ret;
}
// config detail: {'name': 'can_tx_vehicle_speed_calc', 'offset': 0.0,
// 'precision': 0.0625, 'len': 11, 'is_signed_var': False, 'physical_range':
// '[0|127.9375]', 'bit': 50, 'type': 'double', 'order': 'motorola',
// 'physical_unit': 'm/s'}
double Esrstatus14e0::can_tx_vehicle_speed_calc(const std::uint8_t* bytes,
int32_t length) const {
Byte t0(bytes + 6);
int32_t x = t0.get_byte(0, 3);
Byte t1(bytes + 7);
int32_t t = t1.get_byte(0, 8);
x <<= 8;
x |= t;
double ret = x * 0.062500;
return ret;
}
// config detail: {'name': 'can_tx_scan_index', 'offset': 0.0, 'precision': 1.0,
// 'len': 16, 'is_signed_var': False, 'physical_range': '[0|65535]', 'bit': 31,
// 'type': 'int', 'order': 'motorola', 'physical_unit': ''}
int Esrstatus14e0::can_tx_scan_index(const std::uint8_t* bytes,
int32_t length) const {
Byte t0(bytes + 3);
int32_t x = t0.get_byte(0, 8);
Byte t1(bytes + 4);
int32_t t = t1.get_byte(0, 8);
x <<= 8;
x |= t;
int ret = x;
return ret;
}
// config detail: {'name': 'can_tx_rolling_count_1', 'offset': 0.0, 'precision':
// 1.0, 'len': 2, 'is_signed_var': False, 'physical_range': '[0|0]', 'bit': 7,
// 'type': 'int', 'order': 'motorola', 'physical_unit': ''}
int Esrstatus14e0::can_tx_rolling_count_1(const std::uint8_t* bytes,
int32_t length) const {
Byte t0(bytes + 0);
int32_t x = t0.get_byte(6, 2);
int ret = x;
return ret;
}
// config detail: {'name': 'can_tx_radius_curvature_calc', 'offset': 0.0,
// 'precision': 1.0, 'len': 14, 'is_signed_var': True, 'physical_range':
// '[-8192|8191]', 'bit': 13, 'type': 'int', 'order': 'motorola',
// 'physical_unit': 'm'}
int Esrstatus14e0::can_tx_radius_curvature_calc(const std::uint8_t* bytes,
int32_t length) const {
Byte t0(bytes + 1);
int32_t x = t0.get_byte(0, 6);
Byte t1(bytes + 2);
int32_t t = t1.get_byte(0, 8);
x <<= 8;
x |= t;
x <<= 18;
x >>= 18;
int ret = x;
return ret;
}
} // namespace delphi_esr
} // namespace drivers
} // namespace apollo
/******************************************************************************
* Copyright 2017 The Apollo Authors. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*****************************************************************************/
#ifndef MODULES_DRIVERS_DELPHI_ESR_PROTOCOL_ESR_STATUS1_4E0_H_
#define MODULES_DRIVERS_DELPHI_ESR_PROTOCOL_ESR_STATUS1_4E0_H_
#include "modules/drivers/proto/delphi_esr.pb.h"
#include "modules/drivers/canbus/can_comm/protocol_data.h"
namespace apollo {
namespace drivers {
namespace delphi_esr {
using apollo::drivers::DelphiESR;
class Esrstatus14e0 : public apollo::drivers::canbus::ProtocolData<DelphiESR> {
public:
static const int32_t ID;
Esrstatus14e0();
void Parse(const std::uint8_t* bytes, int32_t length,
DelphiESR* delphi_esr) const override;
private:
// config detail: {'name': 'CAN_TX_DSP_TIMESTAMP', 'offset': 0.0, 'precision':
// 2.0, 'len': 7, 'is_signed_var': False, 'physical_range': '[0|254]', 'bit':
// 5, 'type': 'double', 'order': 'motorola', 'physical_unit': 'ms'}
double can_tx_dsp_timestamp(const std::uint8_t* bytes,
const int32_t length) const;
// config detail: {'name': 'CAN_TX_COMM_ERROR', 'offset': 0.0, 'precision':
// 1.0, 'len': 1, 'is_signed_var': False, 'physical_range': '[0|0]', 'bit':
// 14, 'type': 'bool', 'order': 'motorola', 'physical_unit': ''}
bool can_tx_comm_error(const std::uint8_t* bytes, const int32_t length) const;
// config detail: {'name': 'CAN_TX_YAW_RATE_CALC', 'offset': 0.0, 'precision':
// 0.0625, 'len': 12, 'is_signed_var': True, 'physical_range':
// '[-128|127.9375]', 'bit': 47, 'type': 'double', 'order': 'motorola',
// 'physical_unit': 'deg/s'}
double can_tx_yaw_rate_calc(const std::uint8_t* bytes,
const int32_t length) const;
// config detail: {'name': 'CAN_TX_VEHICLE_SPEED_CALC', 'offset': 0.0,
// 'precision': 0.0625, 'len': 11, 'is_signed_var': False, 'physical_range':
// '[0|127.9375]', 'bit': 50, 'type': 'double', 'order': 'motorola',
// 'physical_unit': 'm/s'}
double can_tx_vehicle_speed_calc(const std::uint8_t* bytes,
const int32_t length) const;
// config detail: {'name': 'CAN_TX_SCAN_INDEX', 'offset': 0.0, 'precision':
// 1.0, 'len': 16, 'is_signed_var': False, 'physical_range': '[0|65535]',
// 'bit': 31, 'type': 'int', 'order': 'motorola', 'physical_unit': ''}
int can_tx_scan_index(const std::uint8_t* bytes, const int32_t length) const;
// config detail: {'name': 'CAN_TX_ROLLING_COUNT_1', 'offset': 0.0,
// 'precision': 1.0, 'len': 2, 'is_signed_var': False, 'physical_range':
// '[0|0]', 'bit': 7, 'type': 'int', 'order': 'motorola', 'physical_unit': ''}
int can_tx_rolling_count_1(const std::uint8_t* bytes,
const int32_t length) const;
// config detail: {'name': 'CAN_TX_RADIUS_CURVATURE_CALC', 'offset': 0.0,
// 'precision': 1.0, 'len': 14, 'is_signed_var': True, 'physical_range':
// '[-8192|8191]', 'bit': 13, 'type': 'int', 'order': 'motorola',
// 'physical_unit': 'm'}
int can_tx_radius_curvature_calc(const std::uint8_t* bytes,
const int32_t length) const;
};
} // namespace delphi_esr
} // namespace drivers
} // namespace apollo
#endif // MODULES_CANBUS_VEHICL_ESR_PROTOCOL_ESR_STATUS1_4E0_H_
/******************************************************************************
* Copyright 2017 The Apollo Authors. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*****************************************************************************/
#include "modules/drivers/delphi_esr/protocol/esr_status2_4e1.h"
#include "glog/logging.h"
#include "modules/drivers/canbus/common/byte.h"
#include "modules/drivers/canbus/common/canbus_consts.h"
namespace apollo {
namespace drivers {
namespace delphi_esr {
using apollo::drivers::canbus::Byte;
Esrstatus24e1::Esrstatus24e1() {}
const int32_t Esrstatus24e1::ID = 0x4E1;
void Esrstatus24e1::Parse(const std::uint8_t* bytes, int32_t length,
DelphiESR* delphi_esr) const {
delphi_esr->mutable_esr_status2_4e1()->set_can_tx_yaw_rate_bias(
can_tx_yaw_rate_bias(bytes, length));
delphi_esr->mutable_esr_status2_4e1()->set_can_tx_veh_spd_comp_factor(
can_tx_veh_spd_comp_factor(bytes, length));
delphi_esr->mutable_esr_status2_4e1()->set_can_tx_sw_version_dsp(
can_tx_sw_version_dsp(bytes, length));
delphi_esr->mutable_esr_status2_4e1()->set_can_tx_temperature(
can_tx_temperature(bytes, length));
delphi_esr->mutable_esr_status2_4e1()->set_can_tx_raw_data_mode(
can_tx_raw_data_mode(bytes, length));
delphi_esr->mutable_esr_status2_4e1()->set_can_tx_range_perf_error(
can_tx_range_perf_error(bytes, length));
delphi_esr->mutable_esr_status2_4e1()->set_can_tx_overheat_error(
can_tx_overheat_error(bytes, length));
delphi_esr->mutable_esr_status2_4e1()->set_can_tx_maximum_tracks_ack(
can_tx_maximum_tracks_ack(bytes, length));
delphi_esr->mutable_esr_status2_4e1()->set_can_tx_internal_error(
can_tx_internal_error(bytes, length));
delphi_esr->mutable_esr_status2_4e1()->set_can_tx_grouping_mode(
can_tx_grouping_mode(bytes, length));
delphi_esr->mutable_esr_status2_4e1()->set_can_tx_xcvr_operational(
can_tx_xcvr_operational(bytes, length));
delphi_esr->mutable_esr_status2_4e1()->set_can_tx_steering_angle_ack(
can_tx_steering_angle_ack(bytes, length));
delphi_esr->mutable_esr_status2_4e1()->set_can_tx_rolling_count_2(
can_tx_rolling_count_2(bytes, length));
}
// config detail: {'name': 'can_tx_yaw_rate_bias', 'offset': 0.0, 'precision':
// 0.125, 'len': 8, 'is_signed_var': True, 'physical_range': '[-16|15.875]',
// 'bit': 47, 'type': 'double', 'order': 'motorola', 'physical_unit': ''}
double Esrstatus24e1::can_tx_yaw_rate_bias(const std::uint8_t* bytes,
int32_t length) const {
Byte t0(bytes + 5);
int32_t x = t0.get_byte(0, 8);
x <<= 24;
x >>= 24;
double ret = x * 0.125000;
return ret;
}
// config detail: {'name': 'can_tx_veh_spd_comp_factor', 'offset': 1.0,
// 'precision': 0.001953125, 'len': 6, 'is_signed_var': True, 'physical_range':
// '[0.9375|1.060546875]', 'bit': 39, 'type': 'double', 'order': 'motorola',
// 'physical_unit': ''}
double Esrstatus24e1::can_tx_veh_spd_comp_factor(const std::uint8_t* bytes,
int32_t length) const {
Byte t0(bytes + 4);
int32_t x = t0.get_byte(2, 6);
x <<= 26;
x >>= 26;
double ret = x * 0.001953 + 1.000000;
return ret;
}
// config detail: {'name': 'can_tx_sw_version_dsp', 'offset': 0.0, 'precision':
// 1.0, 'len': 16, 'is_signed_var': False, 'physical_range': '[0|0]', 'bit': 55,
// 'type': 'int', 'order': 'motorola', 'physical_unit': ''}
int Esrstatus24e1::can_tx_sw_version_dsp(const std::uint8_t* bytes,
int32_t length) const {
Byte t0(bytes + 6);
int32_t x = t0.get_byte(0, 8);
Byte t1(bytes + 7);
int32_t t = t1.get_byte(0, 8);
x <<= 8;
x |= t;
int ret = x;
return ret;
}
// config detail: {'name': 'can_tx_temperature', 'offset': 0.0, 'precision':
// 1.0, 'len': 8, 'is_signed_var': True, 'physical_range': '[-128|127]', 'bit':
// 31, 'type': 'int', 'order': 'motorola', 'physical_unit': 'degC'}
int Esrstatus24e1::can_tx_temperature(const std::uint8_t* bytes,
int32_t length) const {
Byte t0(bytes + 3);
int32_t x = t0.get_byte(0, 8);
x <<= 24;
x >>= 24;
int ret = x;
return ret;
}
// config detail: {'name': 'can_tx_raw_data_mode', 'enum': {0:
// 'CAN_TX_RAW_DATA_MODE_FILTERED', 1: 'CAN_TX_RAW_DATA_MODE_RAW'}, 'precision':
// 1.0, 'len': 1, 'is_signed_var': False, 'offset': 0.0, 'physical_range':
// '[0|0]', 'bit': 11, 'type': 'enum', 'order': 'motorola', 'physical_unit': ''}
Esr_status2_4e1::Can_tx_raw_data_modeType Esrstatus24e1::can_tx_raw_data_mode(
const std::uint8_t* bytes, int32_t length) const {
Byte t0(bytes + 1);
int32_t x = t0.get_byte(3, 1);
Esr_status2_4e1::Can_tx_raw_data_modeType ret =
static_cast<Esr_status2_4e1::Can_tx_raw_data_modeType>(x);
return ret;
}
// config detail: {'name': 'can_tx_range_perf_error', 'enum': {0:
// 'CAN_TX_RANGE_PERF_ERROR_NOT_BLOCKED', 1: 'CAN_TX_RANGE_PERF_ERROR_BLOCKED'},
// 'precision': 1.0, 'len': 1, 'is_signed_var': False, 'offset': 0.0,
// 'physical_range': '[0|0]', 'bit': 14, 'type': 'enum', 'order': 'motorola',
// 'physical_unit': ''}
Esr_status2_4e1::Can_tx_range_perf_errorType
Esrstatus24e1::can_tx_range_perf_error(const std::uint8_t* bytes,
int32_t length) const {
Byte t0(bytes + 1);
int32_t x = t0.get_byte(6, 1);
Esr_status2_4e1::Can_tx_range_perf_errorType ret =
static_cast<Esr_status2_4e1::Can_tx_range_perf_errorType>(x);
return ret;
}
// config detail: {'name': 'can_tx_overheat_error', 'enum': {0:
// 'CAN_TX_OVERHEAT_ERROR_NOT_OVERTEMP', 1: 'CAN_TX_OVERHEAT_ERROR_OVERTEMP'},
// 'precision': 1.0, 'len': 1, 'is_signed_var': False, 'offset': 0.0,
// 'physical_range': '[0|0]', 'bit': 15, 'type': 'enum', 'order': 'motorola',
// 'physical_unit': ''}
Esr_status2_4e1::Can_tx_overheat_errorType Esrstatus24e1::can_tx_overheat_error(
const std::uint8_t* bytes, int32_t length) const {
Byte t0(bytes + 1);
int32_t x = t0.get_byte(7, 1);
Esr_status2_4e1::Can_tx_overheat_errorType ret =
static_cast<Esr_status2_4e1::Can_tx_overheat_errorType>(x);
return ret;
}
// config detail: {'name': 'can_tx_maximum_tracks_ack', 'offset': 1.0,
// 'precision': 1.0, 'len': 6, 'is_signed_var': False, 'physical_range':
// '[1|64]', 'bit': 7, 'type': 'int', 'order': 'motorola', 'physical_unit': ''}
int Esrstatus24e1::can_tx_maximum_tracks_ack(const std::uint8_t* bytes,
int32_t length) const {
Byte t0(bytes + 0);
int32_t x = t0.get_byte(2, 6);
int ret = x + 1.000000;
return ret;
}
// config detail: {'name': 'can_tx_internal_error', 'enum': {0:
// 'CAN_TX_INTERNAL_ERROR_NOT_FAILED', 1: 'CAN_TX_INTERNAL_ERROR_FAILED'},
// 'precision': 1.0, 'len': 1, 'is_signed_var': False, 'offset': 0.0,
// 'physical_range': '[0|0]', 'bit': 13, 'type': 'enum', 'order': 'motorola',
// 'physical_unit': ''}
Esr_status2_4e1::Can_tx_internal_errorType Esrstatus24e1::can_tx_internal_error(
const std::uint8_t* bytes, int32_t length) const {
Byte t0(bytes + 1);
int32_t x = t0.get_byte(5, 1);
Esr_status2_4e1::Can_tx_internal_errorType ret =
static_cast<Esr_status2_4e1::Can_tx_internal_errorType>(x);
return ret;
}
// config detail: {'name': 'can_tx_grouping_mode', 'enum': {0:
// 'CAN_TX_GROUPING_MODE_NO_GROUPING', 1:
// 'CAN_TX_GROUPING_MODE_GROUP_MOVING_ONLY', 2:
// 'CAN_TX_GROUPING_MODE_GROUP_STATIONARY_ONLY', 3:
// 'CAN_TX_GROUPING_MODE_GROUP_MOVING_STATIONARY'}, 'precision': 1.0, 'len': 2,
// 'is_signed_var': False, 'offset': 0.0, 'physical_range': '[0|0]', 'bit': 33,
// 'type': 'enum', 'order': 'motorola', 'physical_unit': ''}
Esr_status2_4e1::Can_tx_grouping_modeType Esrstatus24e1::can_tx_grouping_mode(
const std::uint8_t* bytes, int32_t length) const {
Byte t0(bytes + 4);
int32_t x = t0.get_byte(0, 2);
Esr_status2_4e1::Can_tx_grouping_modeType ret =
static_cast<Esr_status2_4e1::Can_tx_grouping_modeType>(x);
return ret;
}
// config detail: {'name': 'can_tx_xcvr_operational', 'enum': {0:
// 'CAN_TX_XCVR_OPERATIONAL_OFF', 1: 'CAN_TX_XCVR_OPERATIONAL_ON'}, 'precision':
// 1.0, 'len': 1, 'is_signed_var': False, 'offset': 0.0, 'physical_range':
// '[0|0]', 'bit': 12, 'type': 'enum', 'order': 'motorola', 'physical_unit': ''}
Esr_status2_4e1::Can_tx_xcvr_operationalType
Esrstatus24e1::can_tx_xcvr_operational(const std::uint8_t* bytes,
int32_t length) const {
Byte t0(bytes + 1);
int32_t x = t0.get_byte(4, 1);
Esr_status2_4e1::Can_tx_xcvr_operationalType ret =
static_cast<Esr_status2_4e1::Can_tx_xcvr_operationalType>(x);
return ret;
}
// config detail: {'name': 'can_tx_steering_angle_ack', 'offset': 0.0,
// 'precision': 1.0, 'len': 11, 'is_signed_var': False, 'physical_range':
// '[0|2047]', 'bit': 10, 'type': 'int', 'order': 'motorola', 'physical_unit':
// 'deg'}
int Esrstatus24e1::can_tx_steering_angle_ack(const std::uint8_t* bytes,
int32_t length) const {
Byte t0(bytes + 1);
int32_t x = t0.get_byte(0, 3);
Byte t1(bytes + 2);
int32_t t = t1.get_byte(0, 8);
x <<= 8;
x |= t;
int ret = x;
return ret;
}
// config detail: {'name': 'can_tx_rolling_count_2', 'offset': 0.0, 'precision':
// 1.0, 'len': 2, 'is_signed_var': False, 'physical_range': '[0|0]', 'bit': 1,
// 'type': 'int', 'order': 'motorola', 'physical_unit': ''}
int Esrstatus24e1::can_tx_rolling_count_2(const std::uint8_t* bytes,
int32_t length) const {
Byte t0(bytes + 0);
int32_t x = t0.get_byte(0, 2);
int ret = x;
return ret;
}
} // namespace delphi_esr
} // namespace drivers
} // namespace apollo
/******************************************************************************
* Copyright 2017 The Apollo Authors. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*****************************************************************************/
#ifndef MODULES_DRIVERS_DELPHI_ESR_PROTOCOL_ESR_STATUS2_4E1_H_
#define MODULES_DRIVERS_DELPHI_ESR_PROTOCOL_ESR_STATUS2_4E1_H_
#include "modules/drivers/proto/delphi_esr.pb.h"
#include "modules/drivers/canbus/can_comm/protocol_data.h"
namespace apollo {
namespace drivers {
namespace delphi_esr {
using apollo::drivers::DelphiESR;
class Esrstatus24e1 : public apollo::drivers::canbus::ProtocolData<DelphiESR> {
public:
static const int32_t ID;
Esrstatus24e1();
void Parse(const std::uint8_t* bytes, int32_t length,
DelphiESR* delphi_esr) const override;
private:
// config detail: {'name': 'CAN_TX_YAW_RATE_BIAS', 'offset': 0.0, 'precision':
// 0.125, 'len': 8, 'is_signed_var': True, 'physical_range': '[-16|15.875]',
// 'bit': 47, 'type': 'double', 'order': 'motorola', 'physical_unit': ''}
double can_tx_yaw_rate_bias(const std::uint8_t* bytes,
const int32_t length) const;
// config detail: {'name': 'CAN_TX_VEH_SPD_COMP_FACTOR', 'offset': 1.0,
// 'precision': 0.001953125, 'len': 6, 'is_signed_var': True,
// 'physical_range': '[0.9375|1.060546875]', 'bit': 39, 'type': 'double',
// 'order': 'motorola', 'physical_unit': ''}
double can_tx_veh_spd_comp_factor(const std::uint8_t* bytes,
const int32_t length) const;
// config detail: {'name': 'CAN_TX_SW_VERSION_DSP', 'offset': 0.0,
// 'precision': 1.0, 'len': 16, 'is_signed_var': False, 'physical_range':
// '[0|0]', 'bit': 55, 'type': 'int', 'order': 'motorola', 'physical_unit':
// ''}
int can_tx_sw_version_dsp(const std::uint8_t* bytes,
const int32_t length) const;
// config detail: {'name': 'CAN_TX_TEMPERATURE', 'offset': 0.0, 'precision':
// 1.0, 'len': 8, 'is_signed_var': True, 'physical_range': '[-128|127]',
// 'bit': 31, 'type': 'int', 'order': 'motorola', 'physical_unit': 'degC'}
int can_tx_temperature(const std::uint8_t* bytes, const int32_t length) const;
// config detail: {'name': 'CAN_TX_RAW_DATA_MODE', 'enum': {0:
// 'CAN_TX_RAW_DATA_MODE_FILTERED', 1: 'CAN_TX_RAW_DATA_MODE_RAW'},
// 'precision': 1.0, 'len': 1, 'is_signed_var': False, 'offset': 0.0,
// 'physical_range': '[0|0]', 'bit': 11, 'type': 'enum', 'order': 'motorola',
// 'physical_unit': ''}
Esr_status2_4e1::Can_tx_raw_data_modeType can_tx_raw_data_mode(
const std::uint8_t* bytes, const int32_t length) const;
// config detail: {'name': 'CAN_TX_RANGE_PERF_ERROR', 'enum': {0:
// 'CAN_TX_RANGE_PERF_ERROR_NOT_BLOCKED', 1:
// 'CAN_TX_RANGE_PERF_ERROR_BLOCKED'}, 'precision': 1.0, 'len': 1,
// 'is_signed_var': False, 'offset': 0.0, 'physical_range': '[0|0]', 'bit':
// 14, 'type': 'enum', 'order': 'motorola', 'physical_unit': ''}
Esr_status2_4e1::Can_tx_range_perf_errorType can_tx_range_perf_error(
const std::uint8_t* bytes, const int32_t length) const;
// config detail: {'name': 'CAN_TX_OVERHEAT_ERROR', 'enum': {0:
// 'CAN_TX_OVERHEAT_ERROR_NOT_OVERTEMP', 1: 'CAN_TX_OVERHEAT_ERROR_OVERTEMP'},
// 'precision': 1.0, 'len': 1, 'is_signed_var': False, 'offset': 0.0,
// 'physical_range': '[0|0]', 'bit': 15, 'type': 'enum', 'order': 'motorola',
// 'physical_unit': ''}
Esr_status2_4e1::Can_tx_overheat_errorType can_tx_overheat_error(
const std::uint8_t* bytes, const int32_t length) const;
// config detail: {'name': 'CAN_TX_MAXIMUM_TRACKS_ACK', 'offset': 1.0,
// 'precision': 1.0, 'len': 6, 'is_signed_var': False, 'physical_range':
// '[1|64]', 'bit': 7, 'type': 'int', 'order': 'motorola', 'physical_unit':
// ''}
int can_tx_maximum_tracks_ack(const std::uint8_t* bytes,
const int32_t length) const;
// config detail: {'name': 'CAN_TX_INTERNAL_ERROR', 'enum': {0:
// 'CAN_TX_INTERNAL_ERROR_NOT_FAILED', 1: 'CAN_TX_INTERNAL_ERROR_FAILED'},
// 'precision': 1.0, 'len': 1, 'is_signed_var': False, 'offset': 0.0,
// 'physical_range': '[0|0]', 'bit': 13, 'type': 'enum', 'order': 'motorola',
// 'physical_unit': ''}
Esr_status2_4e1::Can_tx_internal_errorType can_tx_internal_error(
const std::uint8_t* bytes, const int32_t length) const;
// config detail: {'name': 'CAN_TX_GROUPING_MODE', 'enum': {0:
// 'CAN_TX_GROUPING_MODE_NO_GROUPING', 1:
// 'CAN_TX_GROUPING_MODE_GROUP_MOVING_ONLY', 2:
// 'CAN_TX_GROUPING_MODE_GROUP_STATIONARY_ONLY', 3:
// 'CAN_TX_GROUPING_MODE_GROUP_MOVING_STATIONARY'}, 'precision': 1.0, 'len':
// 2, 'is_signed_var': False, 'offset': 0.0, 'physical_range': '[0|0]', 'bit':
// 33, 'type': 'enum', 'order': 'motorola', 'physical_unit': ''}
Esr_status2_4e1::Can_tx_grouping_modeType can_tx_grouping_mode(
const std::uint8_t* bytes, const int32_t length) const;
// config detail: {'name': 'CAN_TX_XCVR_OPERATIONAL', 'enum': {0:
// 'CAN_TX_XCVR_OPERATIONAL_OFF', 1: 'CAN_TX_XCVR_OPERATIONAL_ON'},
// 'precision': 1.0, 'len': 1, 'is_signed_var': False, 'offset': 0.0,
// 'physical_range': '[0|0]', 'bit': 12, 'type': 'enum', 'order': 'motorola',
// 'physical_unit': ''}
Esr_status2_4e1::Can_tx_xcvr_operationalType can_tx_xcvr_operational(
const std::uint8_t* bytes, const int32_t length) const;
// config detail: {'name': 'CAN_TX_STEERING_ANGLE_ACK', 'offset': 0.0,
// 'precision': 1.0, 'len': 11, 'is_signed_var': False, 'physical_range':
// '[0|2047]', 'bit': 10, 'type': 'int', 'order': 'motorola', 'physical_unit':
// 'deg'}
int can_tx_steering_angle_ack(const std::uint8_t* bytes,
const int32_t length) const;
// config detail: {'name': 'CAN_TX_ROLLING_COUNT_2', 'offset': 0.0,
// 'precision': 1.0, 'len': 2, 'is_signed_var': False, 'physical_range':
// '[0|0]', 'bit': 1, 'type': 'int', 'order': 'motorola', 'physical_unit': ''}
int can_tx_rolling_count_2(const std::uint8_t* bytes,
const int32_t length) const;
};
} // namespace delphi_esr
} // namespace drivers
} // namespace apollo
#endif // MODULES_CANBUS_VEHICL_ESR_PROTOCOL_ESR_STATUS2_4E1_H_
/******************************************************************************
* Copyright 2017 The Apollo Authors. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*****************************************************************************/
#include "modules/drivers/delphi_esr/protocol/esr_status3_4e2.h"
#include "glog/logging.h"
#include "modules/drivers/canbus/common/byte.h"
#include "modules/drivers/canbus/common/canbus_consts.h"
namespace apollo {
namespace drivers {
namespace delphi_esr {
using apollo::drivers::canbus::Byte;
Esrstatus34e2::Esrstatus34e2() {}
const int32_t Esrstatus34e2::ID = 0x4E2;
void Esrstatus34e2::Parse(const std::uint8_t* bytes, int32_t length,
DelphiESR* delphi_esr) const {
delphi_esr->mutable_esr_status3_4e2()->set_can_tx_sw_version_pld(
can_tx_sw_version_pld(bytes, length));
delphi_esr->mutable_esr_status3_4e2()->set_can_tx_sw_version_host(
can_tx_sw_version_host(bytes, length));
delphi_esr->mutable_esr_status3_4e2()->set_can_tx_hw_version(
can_tx_hw_version(bytes, length));
delphi_esr->mutable_esr_status3_4e2()->set_can_tx_interface_version(
can_tx_interface_version(bytes, length));
delphi_esr->mutable_esr_status3_4e2()->set_can_tx_serial_num(
can_tx_serial_num(bytes, length));
}
// config detail: {'name': 'can_tx_sw_version_pld', 'offset': 0.0, 'precision':
// 1.0, 'len': 8, 'is_signed_var': False, 'physical_range': '[0|0]', 'bit': 63,
// 'type': 'int', 'order': 'motorola', 'physical_unit': ''}
int Esrstatus34e2::can_tx_sw_version_pld(const std::uint8_t* bytes,
int32_t length) const {
Byte t0(bytes + 7);
int32_t x = t0.get_byte(0, 8);
int ret = x;
return ret;
}
// config detail: {'name': 'can_tx_sw_version_host', 'offset': 0.0, 'precision':
// 1.0, 'len': 24, 'is_signed_var': False, 'physical_range': '[0|0]', 'bit': 15,
// 'type': 'int', 'order': 'motorola', 'physical_unit': ''}
int Esrstatus34e2::can_tx_sw_version_host(const std::uint8_t* bytes,
int32_t length) const {
Byte t0(bytes + 1);
int32_t x = t0.get_byte(0, 8);
Byte t1(bytes + 2);
int32_t t = t1.get_byte(0, 8);
x <<= 8;
x |= t;
Byte t2(bytes + 3);
t = t2.get_byte(0, 8);
x <<= 8;
x |= t;
int ret = x;
return ret;
}
// config detail: {'name': 'can_tx_hw_version', 'offset': 0.0, 'precision': 1.0,
// 'len': 4, 'is_signed_var': False, 'physical_range': '[0|0]', 'bit': 3,
// 'type': 'int', 'order': 'motorola', 'physical_unit': ''}
int Esrstatus34e2::can_tx_hw_version(const std::uint8_t* bytes,
int32_t length) const {
Byte t0(bytes + 0);
int32_t x = t0.get_byte(0, 4);
int ret = x;
return ret;
}
// config detail: {'name': 'can_tx_interface_version', 'offset': 0.0,
// 'precision': 1.0, 'len': 4, 'is_signed_var': False, 'physical_range':
// '[0|0]', 'bit': 7, 'type': 'int', 'order': 'motorola', 'physical_unit': ''}
int Esrstatus34e2::can_tx_interface_version(const std::uint8_t* bytes,
int32_t length) const {
Byte t0(bytes + 0);
int32_t x = t0.get_byte(4, 4);
int ret = x;
return ret;
}
// config detail: {'name': 'can_tx_serial_num', 'offset': 0.0, 'precision': 1.0,
// 'len': 24, 'is_signed_var': False, 'physical_range': '[0|0]', 'bit': 39,
// 'type': 'int', 'order': 'motorola', 'physical_unit': ''}
int Esrstatus34e2::can_tx_serial_num(const std::uint8_t* bytes,
int32_t length) const {
Byte t0(bytes + 4);
int32_t x = t0.get_byte(0, 8);
Byte t1(bytes + 5);
int32_t t = t1.get_byte(0, 8);
x <<= 8;
x |= t;
Byte t2(bytes + 6);
t = t2.get_byte(0, 8);
x <<= 8;
x |= t;
int ret = x;
return ret;
}
} // namespace delphi_esr
} // namespace drivers
} // namespace apollo
/******************************************************************************
* Copyright 2017 The Apollo Authors. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*****************************************************************************/
#ifndef MODULES_DRIVERS_DELPHI_ESR_PROTOCOL_ESR_STATUS3_4E2_H_
#define MODULES_DRIVERS_DELPHI_ESR_PROTOCOL_ESR_STATUS3_4E2_H_
#include "modules/drivers/proto/delphi_esr.pb.h"
#include "modules/drivers/canbus/can_comm/protocol_data.h"
namespace apollo {
namespace drivers {
namespace delphi_esr {
using apollo::drivers::DelphiESR;
class Esrstatus34e2 : public apollo::drivers::canbus::ProtocolData<DelphiESR> {
public:
static const int32_t ID;
Esrstatus34e2();
void Parse(const std::uint8_t* bytes, int32_t length,
DelphiESR* delphi_esr) const override;
private:
// config detail: {'name': 'CAN_TX_SW_VERSION_PLD', 'offset': 0.0,
// 'precision': 1.0, 'len': 8, 'is_signed_var': False, 'physical_range':
// '[0|0]', 'bit': 63, 'type': 'int', 'order': 'motorola', 'physical_unit':
// ''}
int can_tx_sw_version_pld(const std::uint8_t* bytes,
const int32_t length) const;
// config detail: {'name': 'CAN_TX_SW_VERSION_HOST', 'offset': 0.0,
// 'precision': 1.0, 'len': 24, 'is_signed_var': False, 'physical_range':
// '[0|0]', 'bit': 15, 'type': 'int', 'order': 'motorola', 'physical_unit':
// ''}
int can_tx_sw_version_host(const std::uint8_t* bytes,
const int32_t length) const;
// config detail: {'name': 'CAN_TX_HW_VERSION', 'offset': 0.0, 'precision':
// 1.0, 'len': 4, 'is_signed_var': False, 'physical_range': '[0|0]', 'bit': 3,
// 'type': 'int', 'order': 'motorola', 'physical_unit': ''}
int can_tx_hw_version(const std::uint8_t* bytes, const int32_t length) const;
// config detail: {'name': 'CAN_TX_INTERFACE_VERSION', 'offset': 0.0,
// 'precision': 1.0, 'len': 4, 'is_signed_var': False, 'physical_range':
// '[0|0]', 'bit': 7, 'type': 'int', 'order': 'motorola', 'physical_unit': ''}
int can_tx_interface_version(const std::uint8_t* bytes,
const int32_t length) const;
// config detail: {'name': 'CAN_TX_SERIAL_NUM', 'offset': 0.0, 'precision':
// 1.0, 'len': 24, 'is_signed_var': False, 'physical_range': '[0|0]', 'bit':
// 39, 'type': 'int', 'order': 'motorola', 'physical_unit': ''}
int can_tx_serial_num(const std::uint8_t* bytes, const int32_t length) const;
};
} // namespace delphi_esr
} // namespace drivers
} // namespace apollo
#endif // MODULES_CANBUS_VEHICL_ESR_PROTOCOL_ESR_STATUS3_4E2_H_
/******************************************************************************
* Copyright 2017 The Apollo Authors. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*****************************************************************************/
#include "modules/drivers/delphi_esr/protocol/esr_status4_4e3.h"
#include "glog/logging.h"
#include "modules/drivers/canbus/common/byte.h"
#include "modules/drivers/canbus/common/canbus_consts.h"
namespace apollo {
namespace drivers {
namespace delphi_esr {
using apollo::drivers::canbus::Byte;
Esrstatus44e3::Esrstatus44e3() {}
const int32_t Esrstatus44e3::ID = 0x4E3;
void Esrstatus44e3::Parse(const std::uint8_t* bytes, int32_t length,
DelphiESR* delphi_esr) const {
delphi_esr->mutable_esr_status4_4e3()->set_can_tx_truck_target_det(
can_tx_truck_target_det(bytes, length));
delphi_esr->mutable_esr_status4_4e3()->set_can_tx_lr_only_grating_lobe_det(
can_tx_lr_only_grating_lobe_det(bytes, length));
delphi_esr->mutable_esr_status4_4e3()->set_can_tx_sidelobe_blockage(
can_tx_sidelobe_blockage(bytes, length));
delphi_esr->mutable_esr_status4_4e3()->set_can_tx_partial_blockage(
can_tx_partial_blockage(bytes, length));
delphi_esr->mutable_esr_status4_4e3()->set_can_tx_path_id_acc_stat(
can_tx_path_id_acc_stat(bytes, length));
delphi_esr->mutable_esr_status4_4e3()->set_can_tx_mr_lr_mode(
can_tx_mr_lr_mode(bytes, length));
delphi_esr->mutable_esr_status4_4e3()->set_can_tx_auto_align_angle(
can_tx_auto_align_angle(bytes, length));
delphi_esr->mutable_esr_status4_4e3()->set_can_tx_rolling_count_3(
can_tx_rolling_count_3(bytes, length));
delphi_esr->mutable_esr_status4_4e3()->set_can_tx_path_id_fcw_stat(
can_tx_path_id_fcw_stat(bytes, length));
delphi_esr->mutable_esr_status4_4e3()->set_can_tx_path_id_fcw_move(
can_tx_path_id_fcw_move(bytes, length));
delphi_esr->mutable_esr_status4_4e3()->set_can_tx_path_id_cmbb_stat(
can_tx_path_id_cmbb_stat(bytes, length));
delphi_esr->mutable_esr_status4_4e3()->set_can_tx_path_id_cmbb_move(
can_tx_path_id_cmbb_move(bytes, length));
delphi_esr->mutable_esr_status4_4e3()->set_can_tx_path_id_acc(
can_tx_path_id_acc(bytes, length));
}
// config detail: {'name': 'can_tx_truck_target_det', 'enum': {0:
// 'CAN_TX_TRUCK_TARGET_DET_NOT_DETECTED', 1:
// 'CAN_TX_TRUCK_TARGET_DET_DETECTED'}, 'precision': 1.0, 'len': 1,
// 'is_signed_var': False, 'offset': 0.0, 'physical_range': '[0|0]', 'bit': 7,
// 'type': 'enum', 'order': 'motorola', 'physical_unit': ''}
Esr_status4_4e3::Can_tx_truck_target_detType
Esrstatus44e3::can_tx_truck_target_det(const std::uint8_t* bytes,
int32_t length) const {
Byte t0(bytes + 0);
int32_t x = t0.get_byte(7, 1);
Esr_status4_4e3::Can_tx_truck_target_detType ret =
static_cast<Esr_status4_4e3::Can_tx_truck_target_detType>(x);
return ret;
}
// config detail: {'name': 'can_tx_lr_only_grating_lobe_det', 'enum': {0:
// 'CAN_TX_LR_ONLY_GRATING_LOBE_DET_NOT_DETECTED', 1:
// 'CAN_TX_LR_ONLY_GRATING_LOBE_DET_DETECTED'}, 'precision': 1.0, 'len': 1,
// 'is_signed_var': False, 'offset': 0.0, 'physical_range': '[0|0]', 'bit': 6,
// 'type': 'enum', 'order': 'motorola', 'physical_unit': ''}
Esr_status4_4e3::Can_tx_lr_only_grating_lobe_detType
Esrstatus44e3::can_tx_lr_only_grating_lobe_det(const std::uint8_t* bytes,
int32_t length) const {
Byte t0(bytes + 0);
int32_t x = t0.get_byte(6, 1);
Esr_status4_4e3::Can_tx_lr_only_grating_lobe_detType ret =
static_cast<Esr_status4_4e3::Can_tx_lr_only_grating_lobe_detType>(x);
return ret;
}
// config detail: {'name': 'can_tx_sidelobe_blockage', 'enum': {0:
// 'CAN_TX_SIDELOBE_BLOCKAGE_OFF', 1: 'CAN_TX_SIDELOBE_BLOCKAGE_ON'},
// 'precision': 1.0, 'len': 1, 'is_signed_var': False, 'offset': 0.0,
// 'physical_range': '[0|0]', 'bit': 5, 'type': 'enum', 'order': 'motorola',
// 'physical_unit': ''}
Esr_status4_4e3::Can_tx_sidelobe_blockageType
Esrstatus44e3::can_tx_sidelobe_blockage(const std::uint8_t* bytes,
int32_t length) const {
Byte t0(bytes + 0);
int32_t x = t0.get_byte(5, 1);
Esr_status4_4e3::Can_tx_sidelobe_blockageType ret =
static_cast<Esr_status4_4e3::Can_tx_sidelobe_blockageType>(x);
return ret;
}
// config detail: {'name': 'can_tx_partial_blockage', 'enum': {0:
// 'CAN_TX_PARTIAL_BLOCKAGE_NOT_BLOCKED', 1: 'CAN_TX_PARTIAL_BLOCKAGE_BLOCKED'},
// 'precision': 1.0, 'len': 1, 'is_signed_var': False, 'offset': 0.0,
// 'physical_range': '[0|0]', 'bit': 4, 'type': 'enum', 'order': 'motorola',
// 'physical_unit': ''}
Esr_status4_4e3::Can_tx_partial_blockageType
Esrstatus44e3::can_tx_partial_blockage(const std::uint8_t* bytes,
int32_t length) const {
Byte t0(bytes + 0);
int32_t x = t0.get_byte(4, 1);
Esr_status4_4e3::Can_tx_partial_blockageType ret =
static_cast<Esr_status4_4e3::Can_tx_partial_blockageType>(x);
return ret;
}
// config detail: {'name': 'can_tx_path_id_acc_stat', 'offset': 0.0,
// 'precision': 1.0, 'len': 8, 'is_signed_var': False, 'physical_range':
// '[0|0]', 'bit': 63, 'type': 'int', 'order': 'motorola', 'physical_unit': ''}
int Esrstatus44e3::can_tx_path_id_acc_stat(const std::uint8_t* bytes,
int32_t length) const {
Byte t0(bytes + 7);
int32_t x = t0.get_byte(0, 8);
int ret = x;
return ret;
}
// config detail: {'name': 'can_tx_mr_lr_mode', 'enum': {0:
// 'CAN_TX_MR_LR_MODE_RESERVED', 1:
// 'CAN_TX_MR_LR_MODE_OUTPUT_ONLY_MEDIUM_RANGE_TRACKS', 2:
// 'CAN_TX_MR_LR_MODE_OUTPUT_ONLY_LONG_RANGE_TRACKS', 3:
// 'CAN_TX_MR_LR_MODE_OUTPUT_ALL_MEDIUM_RANGE_AND_LONG'}, 'precision': 1.0,
// 'len': 2, 'is_signed_var': False, 'offset': 0.0, 'physical_range': '[0|3]',
// 'bit': 3, 'type': 'enum', 'order': 'motorola', 'physical_unit': ''}
Esr_status4_4e3::Can_tx_mr_lr_modeType Esrstatus44e3::can_tx_mr_lr_mode(
const std::uint8_t* bytes, int32_t length) const {
Byte t0(bytes + 0);
int32_t x = t0.get_byte(2, 2);
Esr_status4_4e3::Can_tx_mr_lr_modeType ret =
static_cast<Esr_status4_4e3::Can_tx_mr_lr_modeType>(x);
return ret;
}
// config detail: {'name': 'can_tx_auto_align_angle', 'offset': 0.0,
// 'precision': 0.0625, 'len': 8, 'is_signed_var': True, 'physical_range':
// '[-8|7.9375]', 'bit': 55, 'type': 'double', 'order': 'motorola',
// 'physical_unit': ''}
double Esrstatus44e3::can_tx_auto_align_angle(const std::uint8_t* bytes,
int32_t length) const {
Byte t0(bytes + 6);
int32_t x = t0.get_byte(0, 8);
x <<= 24;
x >>= 24;
double ret = x * 0.062500;
return ret;
}
// config detail: {'name': 'can_tx_rolling_count_3', 'offset': 0.0, 'precision':
// 1.0, 'len': 2, 'is_signed_var': False, 'physical_range': '[0|0]', 'bit': 1,
// 'type': 'int', 'order': 'motorola', 'physical_unit': ''}
int Esrstatus44e3::can_tx_rolling_count_3(const std::uint8_t* bytes,
int32_t length) const {
Byte t0(bytes + 0);
int32_t x = t0.get_byte(0, 2);
int ret = x;
return ret;
}
// config detail: {'name': 'can_tx_path_id_fcw_stat', 'offset': 0.0,
// 'precision': 1.0, 'len': 8, 'is_signed_var': False, 'physical_range':
// '[0|0]', 'bit': 47, 'type': 'int', 'order': 'motorola', 'physical_unit': ''}
int Esrstatus44e3::can_tx_path_id_fcw_stat(const std::uint8_t* bytes,
int32_t length) const {
Byte t0(bytes + 5);
int32_t x = t0.get_byte(0, 8);
int ret = x;
return ret;
}
// config detail: {'name': 'can_tx_path_id_fcw_move', 'offset': 0.0,
// 'precision': 1.0, 'len': 8, 'is_signed_var': False, 'physical_range':
// '[0|0]', 'bit': 39, 'type': 'int', 'order': 'motorola', 'physical_unit': ''}
int Esrstatus44e3::can_tx_path_id_fcw_move(const std::uint8_t* bytes,
int32_t length) const {
Byte t0(bytes + 4);
int32_t x = t0.get_byte(0, 8);
int ret = x;
return ret;
}
// config detail: {'name': 'can_tx_path_id_cmbb_stat', 'offset': 0.0,
// 'precision': 1.0, 'len': 8, 'is_signed_var': False, 'physical_range':
// '[0|0]', 'bit': 31, 'type': 'int', 'order': 'motorola', 'physical_unit': ''}
int Esrstatus44e3::can_tx_path_id_cmbb_stat(const std::uint8_t* bytes,
int32_t length) const {
Byte t0(bytes + 3);
int32_t x = t0.get_byte(0, 8);
int ret = x;
return ret;
}
// config detail: {'name': 'can_tx_path_id_cmbb_move', 'offset': 0.0,
// 'precision': 1.0, 'len': 8, 'is_signed_var': False, 'physical_range':
// '[0|0]', 'bit': 23, 'type': 'int', 'order': 'motorola', 'physical_unit': ''}
int Esrstatus44e3::can_tx_path_id_cmbb_move(const std::uint8_t* bytes,
int32_t length) const {
Byte t0(bytes + 2);
int32_t x = t0.get_byte(0, 8);
int ret = x;
return ret;
}
// config detail: {'name': 'can_tx_path_id_acc', 'offset': 0.0, 'precision':
// 1.0, 'len': 8, 'is_signed_var': False, 'physical_range': '[0|0]', 'bit': 15,
// 'type': 'int', 'order': 'motorola', 'physical_unit': ''}
int Esrstatus44e3::can_tx_path_id_acc(const std::uint8_t* bytes,
int32_t length) const {
Byte t0(bytes + 1);
int32_t x = t0.get_byte(0, 8);
int ret = x;
return ret;
}
} // namespace delphi_esr
} // namespace drivers
} // namespace apollo
/******************************************************************************
* Copyright 2017 The Apollo Authors. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*****************************************************************************/
#ifndef MODULES_DRIVERS_DELPHI_ESR_PROTOCOL_ESR_STATUS4_4E3_H_
#define MODULES_DRIVERS_DELPHI_ESR_PROTOCOL_ESR_STATUS4_4E3_H_
#include "modules/drivers/proto/delphi_esr.pb.h"
#include "modules/drivers/canbus/can_comm/protocol_data.h"
namespace apollo {
namespace drivers {
namespace delphi_esr {
using apollo::drivers::DelphiESR;
class Esrstatus44e3 : public apollo::drivers::canbus::ProtocolData<DelphiESR> {
public:
static const int32_t ID;
Esrstatus44e3();
void Parse(const std::uint8_t* bytes, int32_t length,
DelphiESR* delphi_esr) const override;
private:
// config detail: {'name': 'CAN_TX_TRUCK_TARGET_DET', 'enum': {0:
// 'CAN_TX_TRUCK_TARGET_DET_NOT_DETECTED', 1:
// 'CAN_TX_TRUCK_TARGET_DET_DETECTED'}, 'precision': 1.0, 'len': 1,
// 'is_signed_var': False, 'offset': 0.0, 'physical_range': '[0|0]', 'bit': 7,
// 'type': 'enum', 'order': 'motorola', 'physical_unit': ''}
Esr_status4_4e3::Can_tx_truck_target_detType can_tx_truck_target_det(
const std::uint8_t* bytes, const int32_t length) const;
// config detail: {'name': 'CAN_TX_LR_ONLY_GRATING_LOBE_DET', 'enum': {0:
// 'CAN_TX_LR_ONLY_GRATING_LOBE_DET_NOT_DETECTED', 1:
// 'CAN_TX_LR_ONLY_GRATING_LOBE_DET_DETECTED'}, 'precision': 1.0, 'len': 1,
// 'is_signed_var': False, 'offset': 0.0, 'physical_range': '[0|0]', 'bit': 6,
// 'type': 'enum', 'order': 'motorola', 'physical_unit': ''}
Esr_status4_4e3::Can_tx_lr_only_grating_lobe_detType
can_tx_lr_only_grating_lobe_det(const std::uint8_t* bytes,
const int32_t length) const;
// config detail: {'name': 'CAN_TX_SIDELOBE_BLOCKAGE', 'enum': {0:
// 'CAN_TX_SIDELOBE_BLOCKAGE_OFF', 1: 'CAN_TX_SIDELOBE_BLOCKAGE_ON'},
// 'precision': 1.0, 'len': 1, 'is_signed_var': False, 'offset': 0.0,
// 'physical_range': '[0|0]', 'bit': 5, 'type': 'enum', 'order': 'motorola',
// 'physical_unit': ''}
Esr_status4_4e3::Can_tx_sidelobe_blockageType can_tx_sidelobe_blockage(
const std::uint8_t* bytes, const int32_t length) const;
// config detail: {'name': 'CAN_TX_PARTIAL_BLOCKAGE', 'enum': {0:
// 'CAN_TX_PARTIAL_BLOCKAGE_NOT_BLOCKED', 1:
// 'CAN_TX_PARTIAL_BLOCKAGE_BLOCKED'}, 'precision': 1.0, 'len': 1,
// 'is_signed_var': False, 'offset': 0.0, 'physical_range': '[0|0]', 'bit': 4,
// 'type': 'enum', 'order': 'motorola', 'physical_unit': ''}
Esr_status4_4e3::Can_tx_partial_blockageType can_tx_partial_blockage(
const std::uint8_t* bytes, const int32_t length) const;
// config detail: {'name': 'CAN_TX_PATH_ID_ACC_STAT', 'offset': 0.0,
// 'precision': 1.0, 'len': 8, 'is_signed_var': False, 'physical_range':
// '[0|0]', 'bit': 63, 'type': 'int', 'order': 'motorola', 'physical_unit':
// ''}
int can_tx_path_id_acc_stat(const std::uint8_t* bytes,
const int32_t length) const;
// config detail: {'name': 'CAN_TX_MR_LR_MODE', 'enum': {0:
// 'CAN_TX_MR_LR_MODE_RESERVED', 1:
// 'CAN_TX_MR_LR_MODE_OUTPUT_ONLY_MEDIUM_RANGE_TRACKS', 2:
// 'CAN_TX_MR_LR_MODE_OUTPUT_ONLY_LONG_RANGE_TRACKS', 3:
// 'CAN_TX_MR_LR_MODE_OUTPUT_ALL_MEDIUM_RANGE_AND_LONG'}, 'precision': 1.0,
// 'len': 2, 'is_signed_var': False, 'offset': 0.0, 'physical_range': '[0|3]',
// 'bit': 3, 'type': 'enum', 'order': 'motorola', 'physical_unit': ''}
Esr_status4_4e3::Can_tx_mr_lr_modeType can_tx_mr_lr_mode(
const std::uint8_t* bytes, const int32_t length) const;
// config detail: {'name': 'CAN_TX_AUTO_ALIGN_ANGLE', 'offset': 0.0,
// 'precision': 0.0625, 'len': 8, 'is_signed_var': True, 'physical_range':
// '[-8|7.9375]', 'bit': 55, 'type': 'double', 'order': 'motorola',
// 'physical_unit': ''}
double can_tx_auto_align_angle(const std::uint8_t* bytes,
const int32_t length) const;
// config detail: {'name': 'CAN_TX_ROLLING_COUNT_3', 'offset': 0.0,
// 'precision': 1.0, 'len': 2, 'is_signed_var': False, 'physical_range':
// '[0|0]', 'bit': 1, 'type': 'int', 'order': 'motorola', 'physical_unit': ''}
int can_tx_rolling_count_3(const std::uint8_t* bytes,
const int32_t length) const;
// config detail: {'name': 'CAN_TX_PATH_ID_FCW_STAT', 'offset': 0.0,
// 'precision': 1.0, 'len': 8, 'is_signed_var': False, 'physical_range':
// '[0|0]', 'bit': 47, 'type': 'int', 'order': 'motorola', 'physical_unit':
// ''}
int can_tx_path_id_fcw_stat(const std::uint8_t* bytes,
const int32_t length) const;
// config detail: {'name': 'CAN_TX_PATH_ID_FCW_MOVE', 'offset': 0.0,
// 'precision': 1.0, 'len': 8, 'is_signed_var': False, 'physical_range':
// '[0|0]', 'bit': 39, 'type': 'int', 'order': 'motorola', 'physical_unit':
// ''}
int can_tx_path_id_fcw_move(const std::uint8_t* bytes,
const int32_t length) const;
// config detail: {'name': 'CAN_TX_PATH_ID_CMBB_STAT', 'offset': 0.0,
// 'precision': 1.0, 'len': 8, 'is_signed_var': False, 'physical_range':
// '[0|0]', 'bit': 31, 'type': 'int', 'order': 'motorola', 'physical_unit':
// ''}
int can_tx_path_id_cmbb_stat(const std::uint8_t* bytes,
const int32_t length) const;
// config detail: {'name': 'CAN_TX_PATH_ID_CMBB_MOVE', 'offset': 0.0,
// 'precision': 1.0, 'len': 8, 'is_signed_var': False, 'physical_range':
// '[0|0]', 'bit': 23, 'type': 'int', 'order': 'motorola', 'physical_unit':
// ''}
int can_tx_path_id_cmbb_move(const std::uint8_t* bytes,
const int32_t length) const;
// config detail: {'name': 'CAN_TX_PATH_ID_ACC', 'offset': 0.0, 'precision':
// 1.0, 'len': 8, 'is_signed_var': False, 'physical_range': '[0|0]', 'bit':
// 15, 'type': 'int', 'order': 'motorola', 'physical_unit': ''}
int can_tx_path_id_acc(const std::uint8_t* bytes, const int32_t length) const;
};
} // namespace delphi_esr
} // namespace drivers
} // namespace apollo
#endif // MODULES_CANBUS_VEHICL_ESR_PROTOCOL_ESR_STATUS4_4E3_H_
/******************************************************************************
* Copyright 2017 The Apollo Authors. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*****************************************************************************/
#include "modules/drivers/delphi_esr/protocol/esr_status5_5e4.h"
#include "glog/logging.h"
#include "modules/drivers/canbus/common/byte.h"
#include "modules/drivers/canbus/common/canbus_consts.h"
namespace apollo {
namespace drivers {
namespace delphi_esr {
using apollo::drivers::canbus::Byte;
Esrstatus55e4::Esrstatus55e4() {}
const int32_t Esrstatus55e4::ID = 0x5E4;
void Esrstatus55e4::Parse(const std::uint8_t* bytes, int32_t length,
DelphiESR* delphi_esr) const {
delphi_esr->mutable_esr_status5_5e4()->set_can_tx_supply_10v_a2d(
can_tx_supply_10v_a2d(bytes, length));
delphi_esr->mutable_esr_status5_5e4()->set_can_tx_temp2_a2d(
can_tx_temp2_a2d(bytes, length));
delphi_esr->mutable_esr_status5_5e4()->set_can_tx_temp1_a2d(
can_tx_temp1_a2d(bytes, length));
delphi_esr->mutable_esr_status5_5e4()->set_can_tx_swbatt_a2d(
can_tx_swbatt_a2d(bytes, length));
delphi_esr->mutable_esr_status5_5e4()->set_can_tx_supply_5vdx_a2d(
can_tx_supply_5vdx_a2d(bytes, length));
delphi_esr->mutable_esr_status5_5e4()->set_can_tx_supply_5va_a2d(
can_tx_supply_5va_a2d(bytes, length));
delphi_esr->mutable_esr_status5_5e4()->set_can_tx_supply_3p3v_a2d(
can_tx_supply_3p3v_a2d(bytes, length));
delphi_esr->mutable_esr_status5_5e4()->set_can_tx_ignp_a2d(
can_tx_ignp_a2d(bytes, length));
}
// config detail: {'name': 'can_tx_supply_10v_a2d', 'offset': 0.0, 'precision':
// 1.0, 'len': 8, 'is_signed_var': False, 'physical_range': '[0|0]', 'bit': 63,
// 'type': 'int', 'order': 'motorola', 'physical_unit': ''}
int Esrstatus55e4::can_tx_supply_10v_a2d(const std::uint8_t* bytes,
int32_t length) const {
Byte t0(bytes + 7);
int32_t x = t0.get_byte(0, 8);
int ret = x;
return ret;
}
// config detail: {'name': 'can_tx_temp2_a2d', 'offset': 0.0, 'precision': 1.0,
// 'len': 8, 'is_signed_var': False, 'physical_range': '[0|0]', 'bit': 31,
// 'type': 'int', 'order': 'motorola', 'physical_unit': ''}
int Esrstatus55e4::can_tx_temp2_a2d(const std::uint8_t* bytes,
int32_t length) const {
Byte t0(bytes + 3);
int32_t x = t0.get_byte(0, 8);
int ret = x;
return ret;
}
// config detail: {'name': 'can_tx_temp1_a2d', 'offset': 0.0, 'precision': 1.0,
// 'len': 8, 'is_signed_var': False, 'physical_range': '[0|0]', 'bit': 23,
// 'type': 'int', 'order': 'motorola', 'physical_unit': ''}
int Esrstatus55e4::can_tx_temp1_a2d(const std::uint8_t* bytes,
int32_t length) const {
Byte t0(bytes + 2);
int32_t x = t0.get_byte(0, 8);
int ret = x;
return ret;
}
// config detail: {'name': 'can_tx_swbatt_a2d', 'offset': 0.0, 'precision': 1.0,
// 'len': 8, 'is_signed_var': False, 'physical_range': '[0|0]', 'bit': 7,
// 'type': 'int', 'order': 'motorola', 'physical_unit': ''}
int Esrstatus55e4::can_tx_swbatt_a2d(const std::uint8_t* bytes,
int32_t length) const {
Byte t0(bytes + 0);
int32_t x = t0.get_byte(0, 8);
int ret = x;
return ret;
}
// config detail: {'name': 'can_tx_supply_5vdx_a2d', 'offset': 0.0, 'precision':
// 1.0, 'len': 8, 'is_signed_var': False, 'physical_range': '[0|0]', 'bit': 47,
// 'type': 'int', 'order': 'motorola', 'physical_unit': ''}
int Esrstatus55e4::can_tx_supply_5vdx_a2d(const std::uint8_t* bytes,
int32_t length) const {
Byte t0(bytes + 5);
int32_t x = t0.get_byte(0, 8);
int ret = x;
return ret;
}
// config detail: {'name': 'can_tx_supply_5va_a2d', 'offset': 0.0, 'precision':
// 1.0, 'len': 8, 'is_signed_var': False, 'physical_range': '[0|0]', 'bit': 39,
// 'type': 'int', 'order': 'motorola', 'physical_unit': ''}
int Esrstatus55e4::can_tx_supply_5va_a2d(const std::uint8_t* bytes,
int32_t length) const {
Byte t0(bytes + 4);
int32_t x = t0.get_byte(0, 8);
int ret = x;
return ret;
}
// config detail: {'name': 'can_tx_supply_3p3v_a2d', 'offset': 0.0, 'precision':
// 1.0, 'len': 8, 'is_signed_var': False, 'physical_range': '[0|0]', 'bit': 55,
// 'type': 'int', 'order': 'motorola', 'physical_unit': ''}
int Esrstatus55e4::can_tx_supply_3p3v_a2d(const std::uint8_t* bytes,
int32_t length) const {
Byte t0(bytes + 6);
int32_t x = t0.get_byte(0, 8);
int ret = x;
return ret;
}
// config detail: {'name': 'can_tx_ignp_a2d', 'offset': 0.0, 'precision': 1.0,
// 'len': 8, 'is_signed_var': False, 'physical_range': '[0|0]', 'bit': 15,
// 'type': 'int', 'order': 'motorola', 'physical_unit': ''}
int Esrstatus55e4::can_tx_ignp_a2d(const std::uint8_t* bytes,
int32_t length) const {
Byte t0(bytes + 1);
int32_t x = t0.get_byte(0, 8);
int ret = x;
return ret;
}
} // namespace delphi_esr
} // namespace drivers
} // namespace apollo
/******************************************************************************
* Copyright 2017 The Apollo Authors. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*****************************************************************************/
#ifndef MODULES_DRIVERS_DELPHI_ESR_PROTOCOL_ESR_STATUS5_5E4_H_
#define MODULES_DRIVERS_DELPHI_ESR_PROTOCOL_ESR_STATUS5_5E4_H_
#include "modules/drivers/proto/delphi_esr.pb.h"
#include "modules/drivers/canbus/can_comm/protocol_data.h"
namespace apollo {
namespace drivers {
namespace delphi_esr {
using apollo::drivers::DelphiESR;
class Esrstatus55e4 : public apollo::drivers::canbus::ProtocolData<DelphiESR> {
public:
static const int32_t ID;
Esrstatus55e4();
void Parse(const std::uint8_t* bytes, int32_t length,
DelphiESR* delphi_esr) const override;
private:
// config detail: {'name': 'CAN_TX_SUPPLY_10V_A2D', 'offset': 0.0,
// 'precision': 1.0, 'len': 8, 'is_signed_var': False, 'physical_range':
// '[0|0]', 'bit': 63, 'type': 'int', 'order': 'motorola', 'physical_unit':
// ''}
int can_tx_supply_10v_a2d(const std::uint8_t* bytes,
const int32_t length) const;
// config detail: {'name': 'CAN_TX_TEMP2_A2D', 'offset': 0.0, 'precision':
// 1.0, 'len': 8, 'is_signed_var': False, 'physical_range': '[0|0]', 'bit':
// 31, 'type': 'int', 'order': 'motorola', 'physical_unit': ''}
int can_tx_temp2_a2d(const std::uint8_t* bytes, const int32_t length) const;
// config detail: {'name': 'CAN_TX_TEMP1_A2D', 'offset': 0.0, 'precision':
// 1.0, 'len': 8, 'is_signed_var': False, 'physical_range': '[0|0]', 'bit':
// 23, 'type': 'int', 'order': 'motorola', 'physical_unit': ''}
int can_tx_temp1_a2d(const std::uint8_t* bytes, const int32_t length) const;
// config detail: {'name': 'CAN_TX_SWBATT_A2D', 'offset': 0.0, 'precision':
// 1.0, 'len': 8, 'is_signed_var': False, 'physical_range': '[0|0]', 'bit': 7,
// 'type': 'int', 'order': 'motorola', 'physical_unit': ''}
int can_tx_swbatt_a2d(const std::uint8_t* bytes, const int32_t length) const;
// config detail: {'name': 'CAN_TX_SUPPLY_5VDX_A2D', 'offset': 0.0,
// 'precision': 1.0, 'len': 8, 'is_signed_var': False, 'physical_range':
// '[0|0]', 'bit': 47, 'type': 'int', 'order': 'motorola', 'physical_unit':
// ''}
int can_tx_supply_5vdx_a2d(const std::uint8_t* bytes,
const int32_t length) const;
// config detail: {'name': 'CAN_TX_SUPPLY_5VA_A2D', 'offset': 0.0,
// 'precision': 1.0, 'len': 8, 'is_signed_var': False, 'physical_range':
// '[0|0]', 'bit': 39, 'type': 'int', 'order': 'motorola', 'physical_unit':
// ''}
int can_tx_supply_5va_a2d(const std::uint8_t* bytes,
const int32_t length) const;
// config detail: {'name': 'CAN_TX_SUPPLY_3P3V_A2D', 'offset': 0.0,
// 'precision': 1.0, 'len': 8, 'is_signed_var': False, 'physical_range':
// '[0|0]', 'bit': 55, 'type': 'int', 'order': 'motorola', 'physical_unit':
// ''}
int can_tx_supply_3p3v_a2d(const std::uint8_t* bytes,
const int32_t length) const;
// config detail: {'name': 'CAN_TX_IGNP_A2D', 'offset': 0.0, 'precision': 1.0,
// 'len': 8, 'is_signed_var': False, 'physical_range': '[0|0]', 'bit': 15,
// 'type': 'int', 'order': 'motorola', 'physical_unit': ''}
int can_tx_ignp_a2d(const std::uint8_t* bytes, const int32_t length) const;
};
} // namespace delphi_esr
} // namespace drivers
} // namespace apollo
#endif // MODULES_CANBUS_VEHICL_ESR_PROTOCOL_ESR_STATUS5_5E4_H_
/******************************************************************************
* Copyright 2017 The Apollo Authors. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*****************************************************************************/
#include "modules/drivers/delphi_esr/protocol/esr_status6_5e5.h"
#include "glog/logging.h"
#include "modules/drivers/canbus/common/byte.h"
#include "modules/drivers/canbus/common/canbus_consts.h"
namespace apollo {
namespace drivers {
namespace delphi_esr {
using apollo::drivers::canbus::Byte;
Esrstatus65e5::Esrstatus65e5() {}
const int32_t Esrstatus65e5::ID = 0x5E5;
void Esrstatus65e5::Parse(const std::uint8_t* bytes, int32_t length,
DelphiESR* delphi_esr) const {
delphi_esr->mutable_esr_status6_5e5()->set_can_tx_sw_version_dsp_3rd_byte(
can_tx_sw_version_dsp_3rd_byte(bytes, length));
delphi_esr->mutable_esr_status6_5e5()->set_can_tx_vertical_align_updated(
can_tx_vertical_align_updated(bytes, length));
delphi_esr->mutable_esr_status6_5e5()->set_can_tx_vertical_misalignment(
can_tx_vertical_misalignment(bytes, length));
delphi_esr->mutable_esr_status6_5e5()->set_can_tx_serv_align_updates_done(
can_tx_serv_align_updates_done(bytes, length));
delphi_esr->mutable_esr_status6_5e5()->set_can_tx_found_target(
can_tx_found_target(bytes, length));
delphi_esr->mutable_esr_status6_5e5()->set_can_tx_factory_misalignment(
can_tx_factory_misalignment(bytes, length));
delphi_esr->mutable_esr_status6_5e5()->set_can_tx_factory_align_status_2(
can_tx_factory_align_status_2(bytes, length));
delphi_esr->mutable_esr_status6_5e5()->set_can_tx_factory_align_status_1(
can_tx_factory_align_status_1(bytes, length));
delphi_esr->mutable_esr_status6_5e5()->set_can_tx_recommend_unconverge(
can_tx_recommend_unconverge(bytes, length));
delphi_esr->mutable_esr_status6_5e5()->set_can_tx_wave_diff_a2d(
can_tx_wave_diff_a2d(bytes, length));
delphi_esr->mutable_esr_status6_5e5()->set_can_tx_system_power_mode(
can_tx_system_power_mode(bytes, length));
delphi_esr->mutable_esr_status6_5e5()->set_can_tx_supply_n5v_a2d(
can_tx_supply_n5v_a2d(bytes, length));
delphi_esr->mutable_esr_status6_5e5()->set_can_tx_supply_1p8v_a2d(
can_tx_supply_1p8v_a2d(bytes, length));
}
// config detail: {'name': 'can_tx_sw_version_dsp_3rd_byte', 'offset': 0.0,
// 'precision': 1.0, 'len': 4, 'is_signed_var': False, 'physical_range':
// '[0|0]', 'bit': 31, 'type': 'int', 'order': 'motorola', 'physical_unit': ''}
int Esrstatus65e5::can_tx_sw_version_dsp_3rd_byte(const std::uint8_t* bytes,
int32_t length) const {
Byte t0(bytes + 3);
int32_t x = t0.get_byte(4, 4);
int ret = x;
return ret;
}
// config detail: {'name': 'can_tx_vertical_align_updated', 'enum': {0:
// 'CAN_TX_VERTICAL_ALIGN_UPDATED_NOT_UPDATED', 1:
// 'CAN_TX_VERTICAL_ALIGN_UPDATED_UPDATED'}, 'precision': 1.0, 'len': 1,
// 'is_signed_var': False, 'offset': 0.0, 'physical_range': '[0|0]', 'bit': 27,
// 'type': 'enum', 'order': 'motorola', 'physical_unit': ''}
Esr_status6_5e5::Can_tx_vertical_align_updatedType
Esrstatus65e5::can_tx_vertical_align_updated(const std::uint8_t* bytes,
int32_t length) const {
Byte t0(bytes + 3);
int32_t x = t0.get_byte(3, 1);
Esr_status6_5e5::Can_tx_vertical_align_updatedType ret =
static_cast<Esr_status6_5e5::Can_tx_vertical_align_updatedType>(x);
return ret;
}
// config detail: {'name': 'can_tx_vertical_misalignment', 'offset': 0.0,
// 'precision': 0.0625, 'len': 8, 'is_signed_var': True, 'physical_range':
// '[-6|6]', 'bit': 63, 'type': 'double', 'order': 'motorola', 'physical_unit':
// ''}
double Esrstatus65e5::can_tx_vertical_misalignment(const std::uint8_t* bytes,
int32_t length) const {
Byte t0(bytes + 7);
int32_t x = t0.get_byte(0, 8);
x <<= 24;
x >>= 24;
double ret = x * 0.062500;
return ret;
}
// config detail: {'name': 'can_tx_serv_align_updates_done', 'offset': 0.0,
// 'precision': 1.0, 'len': 8, 'is_signed_var': False, 'physical_range':
// '[0|255]', 'bit': 55, 'type': 'int', 'order': 'motorola', 'physical_unit':
// ''}
int Esrstatus65e5::can_tx_serv_align_updates_done(const std::uint8_t* bytes,
int32_t length) const {
Byte t0(bytes + 6);
int32_t x = t0.get_byte(0, 8);
int ret = x;
return ret;
}
// config detail: {'name': 'can_tx_found_target', 'enum': {0:
// 'CAN_TX_FOUND_TARGET_NOT_FOUND', 1: 'CAN_TX_FOUND_TARGET_FOUND'},
// 'precision': 1.0, 'len': 1, 'is_signed_var': False, 'offset': 0.0,
// 'physical_range': '[0|0]', 'bit': 39, 'type': 'enum', 'order': 'motorola',
// 'physical_unit': ''}
Esr_status6_5e5::Can_tx_found_targetType Esrstatus65e5::can_tx_found_target(
const std::uint8_t* bytes, int32_t length) const {
Byte t0(bytes + 4);
int32_t x = t0.get_byte(7, 1);
Esr_status6_5e5::Can_tx_found_targetType ret =
static_cast<Esr_status6_5e5::Can_tx_found_targetType>(x);
return ret;
}
// config detail: {'name': 'can_tx_factory_misalignment', 'offset': 0.0,
// 'precision': 0.0625, 'len': 8, 'is_signed_var': True, 'physical_range':
// '[-5|5]', 'bit': 47, 'type': 'double', 'order': 'motorola', 'physical_unit':
// 'deg'}
double Esrstatus65e5::can_tx_factory_misalignment(const std::uint8_t* bytes,
int32_t length) const {
Byte t0(bytes + 5);
int32_t x = t0.get_byte(0, 8);
x <<= 24;
x >>= 24;
double ret = x * 0.062500;
return ret;
}
// config detail: {'name': 'can_tx_factory_align_status_2', 'enum': {0:
// 'CAN_TX_FACTORY_ALIGN_STATUS_2_OFF', 1: 'CAN_TX_FACTORY_ALIGN_STATUS_2_BUSY',
// 2: 'CAN_TX_FACTORY_ALIGN_STATUS_2_SUCCESS', 3:
// 'CAN_TX_FACTORY_ALIGN_STATUS_2_FAIL_NO_TARGET', 4:
// 'CAN_TX_FACTORY_ALIGN_STATUS_2_FAIL_DEV_TOO_LARGE', 5:
// 'CAN_TX_FACTORY_ALIGN_STATUS_2_FAIL_VAR_TOO_LARGE'}, 'precision': 1.0, 'len':
// 3, 'is_signed_var': False, 'offset': 0.0, 'physical_range': '[0|5]', 'bit':
// 34, 'type': 'enum', 'order': 'motorola', 'physical_unit': ''}
Esr_status6_5e5::Can_tx_factory_align_status_2Type
Esrstatus65e5::can_tx_factory_align_status_2(const std::uint8_t* bytes,
int32_t length) const {
Byte t0(bytes + 4);
int32_t x = t0.get_byte(0, 3);
Esr_status6_5e5::Can_tx_factory_align_status_2Type ret =
static_cast<Esr_status6_5e5::Can_tx_factory_align_status_2Type>(x);
return ret;
}
// config detail: {'name': 'can_tx_factory_align_status_1', 'enum': {0:
// 'CAN_TX_FACTORY_ALIGN_STATUS_1_OFF', 1: 'CAN_TX_FACTORY_ALIGN_STATUS_1_BUSY',
// 2: 'CAN_TX_FACTORY_ALIGN_STATUS_1_SUCCESS', 3:
// 'CAN_TX_FACTORY_ALIGN_STATUS_1_FAIL_NO_TARGET', 4:
// 'CAN_TX_FACTORY_ALIGN_STATUS_1_FAIL_DEV_TOO_LARGE', 5:
// 'CAN_TX_FACTORY_ALIGN_STATUS_1_FAIL_VAR_TOO_LARGE'}, 'precision': 1.0, 'len':
// 3, 'is_signed_var': False, 'offset': 0.0, 'physical_range': '[0|5]', 'bit':
// 37, 'type': 'enum', 'order': 'motorola', 'physical_unit': ''}
Esr_status6_5e5::Can_tx_factory_align_status_1Type
Esrstatus65e5::can_tx_factory_align_status_1(const std::uint8_t* bytes,
int32_t length) const {
Byte t0(bytes + 4);
int32_t x = t0.get_byte(3, 3);
Esr_status6_5e5::Can_tx_factory_align_status_1Type ret =
static_cast<Esr_status6_5e5::Can_tx_factory_align_status_1Type>(x);
return ret;
}
// config detail: {'name': 'can_tx_recommend_unconverge', 'enum': {0:
// 'CAN_TX_RECOMMEND_UNCONVERGE_NOT_RECOMMEND', 1:
// 'CAN_TX_RECOMMEND_UNCONVERGE_RECOMMEND'}, 'precision': 1.0, 'len': 1,
// 'is_signed_var': False, 'offset': 0.0, 'physical_range': '[0|0]', 'bit': 38,
// 'type': 'enum', 'order': 'motorola', 'physical_unit': ''}
Esr_status6_5e5::Can_tx_recommend_unconvergeType
Esrstatus65e5::can_tx_recommend_unconverge(const std::uint8_t* bytes,
int32_t length) const {
Byte t0(bytes + 4);
int32_t x = t0.get_byte(6, 1);
Esr_status6_5e5::Can_tx_recommend_unconvergeType ret =
static_cast<Esr_status6_5e5::Can_tx_recommend_unconvergeType>(x);
return ret;
}
// config detail: {'name': 'can_tx_wave_diff_a2d', 'offset': 0.0, 'precision':
// 1.0, 'len': 8, 'is_signed_var': False, 'physical_range': '[0|0]', 'bit': 23,
// 'type': 'int', 'order': 'motorola', 'physical_unit': ''}
int Esrstatus65e5::can_tx_wave_diff_a2d(const std::uint8_t* bytes,
int32_t length) const {
Byte t0(bytes + 2);
int32_t x = t0.get_byte(0, 8);
int ret = x;
return ret;
}
// config detail: {'name': 'can_tx_system_power_mode', 'enum': {0:
// 'CAN_TX_SYSTEM_POWER_MODE_DSP_INIT', 1:
// 'CAN_TX_SYSTEM_POWER_MODE_RADIATE_OFF', 2:
// 'CAN_TX_SYSTEM_POWER_MODE_RADIATE_ON', 3:
// 'CAN_TX_SYSTEM_POWER_MODE_DSP_SHUTDOWN', 4:
// 'CAN_TX_SYSTEM_POWER_MODE_DSP_OFF', 5:
// 'CAN_TX_SYSTEM_POWER_MODE_HOST_SHUTDOWN', 6: 'CAN_TX_SYSTEM_POWER_MODE_TEST',
// 7: 'CAN_TX_SYSTEM_POWER_MODE_7INVALID'}, 'precision': 1.0, 'len': 3,
// 'is_signed_var': False, 'offset': 0.0, 'physical_range': '[0|0]', 'bit': 26,
// 'type': 'enum', 'order': 'motorola', 'physical_unit': ''}
Esr_status6_5e5::Can_tx_system_power_modeType
Esrstatus65e5::can_tx_system_power_mode(const std::uint8_t* bytes,
int32_t length) const {
Byte t0(bytes + 3);
int32_t x = t0.get_byte(0, 3);
Esr_status6_5e5::Can_tx_system_power_modeType ret =
static_cast<Esr_status6_5e5::Can_tx_system_power_modeType>(x);
return ret;
}
// config detail: {'name': 'can_tx_supply_n5v_a2d', 'offset': 0.0, 'precision':
// 1.0, 'len': 8, 'is_signed_var': False, 'physical_range': '[0|0]', 'bit': 15,
// 'type': 'int', 'order': 'motorola', 'physical_unit': ''}
int Esrstatus65e5::can_tx_supply_n5v_a2d(const std::uint8_t* bytes,
int32_t length) const {
Byte t0(bytes + 1);
int32_t x = t0.get_byte(0, 8);
int ret = x;
return ret;
}
// config detail: {'name': 'can_tx_supply_1p8v_a2d', 'offset': 0.0, 'precision':
// 1.0, 'len': 8, 'is_signed_var': False, 'physical_range': '[0|0]', 'bit': 7,
// 'type': 'int', 'order': 'motorola', 'physical_unit': ''}
int Esrstatus65e5::can_tx_supply_1p8v_a2d(const std::uint8_t* bytes,
int32_t length) const {
Byte t0(bytes + 0);
int32_t x = t0.get_byte(0, 8);
int ret = x;
return ret;
}
} // namespace delphi_esr
} // namespace drivers
} // namespace apollo
/******************************************************************************
* Copyright 2017 The Apollo Authors. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*****************************************************************************/
#ifndef MODULES_DRIVERS_DELPHI_ESR_PROTOCOL_ESR_STATUS6_5E5_H_
#define MODULES_DRIVERS_DELPHI_ESR_PROTOCOL_ESR_STATUS6_5E5_H_
#include "modules/drivers/proto/delphi_esr.pb.h"
#include "modules/drivers/canbus/can_comm/protocol_data.h"
namespace apollo {
namespace drivers {
namespace delphi_esr {
using apollo::drivers::DelphiESR;
class Esrstatus65e5 : public apollo::drivers::canbus::ProtocolData<DelphiESR> {
public:
static const int32_t ID;
Esrstatus65e5();
void Parse(const std::uint8_t* bytes, int32_t length,
DelphiESR* delphi_esr) const override;
private:
// config detail: {'name': 'CAN_TX_SW_VERSION_DSP_3RD_BYTE', 'offset': 0.0,
// 'precision': 1.0, 'len': 4, 'is_signed_var': False, 'physical_range':
// '[0|0]', 'bit': 31, 'type': 'int', 'order': 'motorola', 'physical_unit':
// ''}
int can_tx_sw_version_dsp_3rd_byte(const std::uint8_t* bytes,
const int32_t length) const;
// config detail: {'name': 'CAN_TX_VERTICAL_ALIGN_UPDATED', 'enum': {0:
// 'CAN_TX_VERTICAL_ALIGN_UPDATED_NOT_UPDATED', 1:
// 'CAN_TX_VERTICAL_ALIGN_UPDATED_UPDATED'}, 'precision': 1.0, 'len': 1,
// 'is_signed_var': False, 'offset': 0.0, 'physical_range': '[0|0]', 'bit':
// 27, 'type': 'enum', 'order': 'motorola', 'physical_unit': ''}
Esr_status6_5e5::Can_tx_vertical_align_updatedType
can_tx_vertical_align_updated(const std::uint8_t* bytes,
const int32_t length) const;
// config detail: {'name': 'CAN_TX_VERTICAL_MISALIGNMENT', 'offset': 0.0,
// 'precision': 0.0625, 'len': 8, 'is_signed_var': True, 'physical_range':
// '[-6|6]', 'bit': 63, 'type': 'double', 'order': 'motorola',
// 'physical_unit': ''}
double can_tx_vertical_misalignment(const std::uint8_t* bytes,
const int32_t length) const;
// config detail: {'name': 'CAN_TX_SERV_ALIGN_UPDATES_DONE', 'offset': 0.0,
// 'precision': 1.0, 'len': 8, 'is_signed_var': False, 'physical_range':
// '[0|255]', 'bit': 55, 'type': 'int', 'order': 'motorola', 'physical_unit':
// ''}
int can_tx_serv_align_updates_done(const std::uint8_t* bytes,
const int32_t length) const;
// config detail: {'name': 'CAN_TX_FOUND_TARGET', 'enum': {0:
// 'CAN_TX_FOUND_TARGET_NOT_FOUND', 1: 'CAN_TX_FOUND_TARGET_FOUND'},
// 'precision': 1.0, 'len': 1, 'is_signed_var': False, 'offset': 0.0,
// 'physical_range': '[0|0]', 'bit': 39, 'type': 'enum', 'order': 'motorola',
// 'physical_unit': ''}
Esr_status6_5e5::Can_tx_found_targetType can_tx_found_target(
const std::uint8_t* bytes, const int32_t length) const;
// config detail: {'name': 'CAN_TX_FACTORY_MISALIGNMENT', 'offset': 0.0,
// 'precision': 0.0625, 'len': 8, 'is_signed_var': True, 'physical_range':
// '[-5|5]', 'bit': 47, 'type': 'double', 'order': 'motorola',
// 'physical_unit': 'deg'}
double can_tx_factory_misalignment(const std::uint8_t* bytes,
const int32_t length) const;
// config detail: {'name': 'CAN_TX_FACTORY_ALIGN_STATUS_2', 'enum': {0:
// 'CAN_TX_FACTORY_ALIGN_STATUS_2_OFF', 1:
// 'CAN_TX_FACTORY_ALIGN_STATUS_2_BUSY', 2:
// 'CAN_TX_FACTORY_ALIGN_STATUS_2_SUCCESS', 3:
// 'CAN_TX_FACTORY_ALIGN_STATUS_2_FAIL_NO_TARGET', 4:
// 'CAN_TX_FACTORY_ALIGN_STATUS_2_FAIL_DEV_TOO_LARGE', 5:
// 'CAN_TX_FACTORY_ALIGN_STATUS_2_FAIL_VAR_TOO_LARGE'}, 'precision': 1.0,
// 'len': 3, 'is_signed_var': False, 'offset': 0.0, 'physical_range': '[0|5]',
// 'bit': 34, 'type': 'enum', 'order': 'motorola', 'physical_unit': ''}
Esr_status6_5e5::Can_tx_factory_align_status_2Type
can_tx_factory_align_status_2(const std::uint8_t* bytes,
const int32_t length) const;
// config detail: {'name': 'CAN_TX_FACTORY_ALIGN_STATUS_1', 'enum': {0:
// 'CAN_TX_FACTORY_ALIGN_STATUS_1_OFF', 1:
// 'CAN_TX_FACTORY_ALIGN_STATUS_1_BUSY', 2:
// 'CAN_TX_FACTORY_ALIGN_STATUS_1_SUCCESS', 3:
// 'CAN_TX_FACTORY_ALIGN_STATUS_1_FAIL_NO_TARGET', 4:
// 'CAN_TX_FACTORY_ALIGN_STATUS_1_FAIL_DEV_TOO_LARGE', 5:
// 'CAN_TX_FACTORY_ALIGN_STATUS_1_FAIL_VAR_TOO_LARGE'}, 'precision': 1.0,
// 'len': 3, 'is_signed_var': False, 'offset': 0.0, 'physical_range': '[0|5]',
// 'bit': 37, 'type': 'enum', 'order': 'motorola', 'physical_unit': ''}
Esr_status6_5e5::Can_tx_factory_align_status_1Type
can_tx_factory_align_status_1(const std::uint8_t* bytes,
const int32_t length) const;
// config detail: {'name': 'CAN_TX_RECOMMEND_UNCONVERGE', 'enum': {0:
// 'CAN_TX_RECOMMEND_UNCONVERGE_NOT_RECOMMEND', 1:
// 'CAN_TX_RECOMMEND_UNCONVERGE_RECOMMEND'}, 'precision': 1.0, 'len': 1,
// 'is_signed_var': False, 'offset': 0.0, 'physical_range': '[0|0]', 'bit':
// 38, 'type': 'enum', 'order': 'motorola', 'physical_unit': ''}
Esr_status6_5e5::Can_tx_recommend_unconvergeType can_tx_recommend_unconverge(
const std::uint8_t* bytes, const int32_t length) const;
// config detail: {'name': 'CAN_TX_WAVE_DIFF_A2D', 'offset': 0.0, 'precision':
// 1.0, 'len': 8, 'is_signed_var': False, 'physical_range': '[0|0]', 'bit':
// 23, 'type': 'int', 'order': 'motorola', 'physical_unit': ''}
int can_tx_wave_diff_a2d(const std::uint8_t* bytes,
const int32_t length) const;
// config detail: {'name': 'CAN_TX_SYSTEM_POWER_MODE', 'enum': {0:
// 'CAN_TX_SYSTEM_POWER_MODE_DSP_INIT', 1:
// 'CAN_TX_SYSTEM_POWER_MODE_RADIATE_OFF', 2:
// 'CAN_TX_SYSTEM_POWER_MODE_RADIATE_ON', 3:
// 'CAN_TX_SYSTEM_POWER_MODE_DSP_SHUTDOWN', 4:
// 'CAN_TX_SYSTEM_POWER_MODE_DSP_OFF', 5:
// 'CAN_TX_SYSTEM_POWER_MODE_HOST_SHUTDOWN', 6:
// 'CAN_TX_SYSTEM_POWER_MODE_TEST', 7: 'CAN_TX_SYSTEM_POWER_MODE_7INVALID'},
// 'precision': 1.0, 'len': 3, 'is_signed_var': False, 'offset': 0.0,
// 'physical_range': '[0|0]', 'bit': 26, 'type': 'enum', 'order': 'motorola',
// 'physical_unit': ''}
Esr_status6_5e5::Can_tx_system_power_modeType can_tx_system_power_mode(
const std::uint8_t* bytes, const int32_t length) const;
// config detail: {'name': 'CAN_TX_SUPPLY_N5V_A2D', 'offset': 0.0,
// 'precision': 1.0, 'len': 8, 'is_signed_var': False, 'physical_range':
// '[0|0]', 'bit': 15, 'type': 'int', 'order': 'motorola', 'physical_unit':
// ''}
int can_tx_supply_n5v_a2d(const std::uint8_t* bytes,
const int32_t length) const;
// config detail: {'name': 'CAN_TX_SUPPLY_1P8V_A2D', 'offset': 0.0,
// 'precision': 1.0, 'len': 8, 'is_signed_var': False, 'physical_range':
// '[0|0]', 'bit': 7, 'type': 'int', 'order': 'motorola', 'physical_unit': ''}
int can_tx_supply_1p8v_a2d(const std::uint8_t* bytes,
const int32_t length) const;
};
} // namespace delphi_esr
} // namespace drivers
} // namespace apollo
#endif // MODULES_CANBUS_VEHICL_ESR_PROTOCOL_ESR_STATUS6_5E5_H_
/******************************************************************************
* Copyright 2017 The Apollo Authors. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*****************************************************************************/
#include "modules/drivers/delphi_esr/protocol/esr_status7_5e6.h"
#include "glog/logging.h"
#include "modules/drivers/canbus/common/byte.h"
#include "modules/drivers/canbus/common/canbus_consts.h"
namespace apollo {
namespace drivers {
namespace delphi_esr {
using apollo::drivers::canbus::Byte;
Esrstatus75e6::Esrstatus75e6() {}
const int32_t Esrstatus75e6::ID = 0x5E6;
void Esrstatus75e6::Parse(const std::uint8_t* bytes, int32_t length,
DelphiESR* delphi_esr) const {
delphi_esr->mutable_esr_status7_5e6()->set_can_tx_active_fault_7(
can_tx_active_fault_7(bytes, length));
delphi_esr->mutable_esr_status7_5e6()->set_can_tx_active_fault_6(
can_tx_active_fault_6(bytes, length));
delphi_esr->mutable_esr_status7_5e6()->set_can_tx_active_fault_5(
can_tx_active_fault_5(bytes, length));
delphi_esr->mutable_esr_status7_5e6()->set_can_tx_active_fault_4(
can_tx_active_fault_4(bytes, length));
delphi_esr->mutable_esr_status7_5e6()->set_can_tx_active_fault_3(
can_tx_active_fault_3(bytes, length));
delphi_esr->mutable_esr_status7_5e6()->set_can_tx_active_fault_2(
can_tx_active_fault_2(bytes, length));
delphi_esr->mutable_esr_status7_5e6()->set_can_tx_active_fault_0(
can_tx_active_fault_0(bytes, length));
delphi_esr->mutable_esr_status7_5e6()->set_can_tx_active_fault_1(
can_tx_active_fault_1(bytes, length));
}
// config detail: {'name': 'can_tx_active_fault_7', 'offset': 0.0, 'precision':
// 1.0, 'len': 8, 'is_signed_var': False, 'physical_range': '[0|0]', 'bit': 63,
// 'type': 'int', 'order': 'motorola', 'physical_unit': ''}
int Esrstatus75e6::can_tx_active_fault_7(const std::uint8_t* bytes,
int32_t length) const {
Byte t0(bytes + 7);
int32_t x = t0.get_byte(0, 8);
int ret = x;
return ret;
}
// config detail: {'name': 'can_tx_active_fault_6', 'offset': 0.0, 'precision':
// 1.0, 'len': 8, 'is_signed_var': False, 'physical_range': '[0|0]', 'bit': 55,
// 'type': 'int', 'order': 'motorola', 'physical_unit': ''}
int Esrstatus75e6::can_tx_active_fault_6(const std::uint8_t* bytes,
int32_t length) const {
Byte t0(bytes + 6);
int32_t x = t0.get_byte(0, 8);
int ret = x;
return ret;
}
// config detail: {'name': 'can_tx_active_fault_5', 'offset': 0.0, 'precision':
// 1.0, 'len': 8, 'is_signed_var': False, 'physical_range': '[0|0]', 'bit': 47,
// 'type': 'int', 'order': 'motorola', 'physical_unit': ''}
int Esrstatus75e6::can_tx_active_fault_5(const std::uint8_t* bytes,
int32_t length) const {
Byte t0(bytes + 5);
int32_t x = t0.get_byte(0, 8);
int ret = x;
return ret;
}
// config detail: {'name': 'can_tx_active_fault_4', 'offset': 0.0, 'precision':
// 1.0, 'len': 8, 'is_signed_var': False, 'physical_range': '[0|0]', 'bit': 39,
// 'type': 'int', 'order': 'motorola', 'physical_unit': ''}
int Esrstatus75e6::can_tx_active_fault_4(const std::uint8_t* bytes,
int32_t length) const {
Byte t0(bytes + 4);
int32_t x = t0.get_byte(0, 8);
int ret = x;
return ret;
}
// config detail: {'name': 'can_tx_active_fault_3', 'offset': 0.0, 'precision':
// 1.0, 'len': 8, 'is_signed_var': False, 'physical_range': '[0|0]', 'bit': 31,
// 'type': 'int', 'order': 'motorola', 'physical_unit': ''}
int Esrstatus75e6::can_tx_active_fault_3(const std::uint8_t* bytes,
int32_t length) const {
Byte t0(bytes + 3);
int32_t x = t0.get_byte(0, 8);
int ret = x;
return ret;
}
// config detail: {'name': 'can_tx_active_fault_2', 'offset': 0.0, 'precision':
// 1.0, 'len': 8, 'is_signed_var': False, 'physical_range': '[0|0]', 'bit': 23,
// 'type': 'int', 'order': 'motorola', 'physical_unit': ''}
int Esrstatus75e6::can_tx_active_fault_2(const std::uint8_t* bytes,
int32_t length) const {
Byte t0(bytes + 2);
int32_t x = t0.get_byte(0, 8);
int ret = x;
return ret;
}
// config detail: {'name': 'can_tx_active_fault_0', 'offset': 0.0, 'precision':
// 1.0, 'len': 8, 'is_signed_var': False, 'physical_range': '[0|0]', 'bit': 7,
// 'type': 'int', 'order': 'motorola', 'physical_unit': ''}
int Esrstatus75e6::can_tx_active_fault_0(const std::uint8_t* bytes,
int32_t length) const {
Byte t0(bytes + 0);
int32_t x = t0.get_byte(0, 8);
int ret = x;
return ret;
}
// config detail: {'name': 'can_tx_active_fault_1', 'offset': 0.0, 'precision':
// 1.0, 'len': 8, 'is_signed_var': False, 'physical_range': '[0|0]', 'bit': 15,
// 'type': 'int', 'order': 'motorola', 'physical_unit': ''}
int Esrstatus75e6::can_tx_active_fault_1(const std::uint8_t* bytes,
int32_t length) const {
Byte t0(bytes + 1);
int32_t x = t0.get_byte(0, 8);
int ret = x;
return ret;
}
} // namespace delphi_esr
} // namespace drivers
} // namespace apollo
/******************************************************************************
* Copyright 2017 The Apollo Authors. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*****************************************************************************/
#ifndef MODULES_DRIVERS_DELPHI_ESR_PROTOCOL_ESR_STATUS7_5E6_H_
#define MODULES_DRIVERS_DELPHI_ESR_PROTOCOL_ESR_STATUS7_5E6_H_
#include "modules/drivers/proto/delphi_esr.pb.h"
#include "modules/drivers/canbus/can_comm/protocol_data.h"
namespace apollo {
namespace drivers {
namespace delphi_esr {
using apollo::drivers::DelphiESR;
class Esrstatus75e6 : public apollo::drivers::canbus::ProtocolData<DelphiESR> {
public:
static const int32_t ID;
Esrstatus75e6();
void Parse(const std::uint8_t* bytes, int32_t length,
DelphiESR* delphi_esr) const override;
private:
// config detail: {'name': 'CAN_TX_ACTIVE_FAULT_7', 'offset': 0.0,
// 'precision': 1.0, 'len': 8, 'is_signed_var': False, 'physical_range':
// '[0|0]', 'bit': 63, 'type': 'int', 'order': 'motorola', 'physical_unit':
// ''}
int can_tx_active_fault_7(const std::uint8_t* bytes,
const int32_t length) const;
// config detail: {'name': 'CAN_TX_ACTIVE_FAULT_6', 'offset': 0.0,
// 'precision': 1.0, 'len': 8, 'is_signed_var': False, 'physical_range':
// '[0|0]', 'bit': 55, 'type': 'int', 'order': 'motorola', 'physical_unit':
// ''}
int can_tx_active_fault_6(const std::uint8_t* bytes,
const int32_t length) const;
// config detail: {'name': 'CAN_TX_ACTIVE_FAULT_5', 'offset': 0.0,
// 'precision': 1.0, 'len': 8, 'is_signed_var': False, 'physical_range':
// '[0|0]', 'bit': 47, 'type': 'int', 'order': 'motorola', 'physical_unit':
// ''}
int can_tx_active_fault_5(const std::uint8_t* bytes,
const int32_t length) const;
// config detail: {'name': 'CAN_TX_ACTIVE_FAULT_4', 'offset': 0.0,
// 'precision': 1.0, 'len': 8, 'is_signed_var': False, 'physical_range':
// '[0|0]', 'bit': 39, 'type': 'int', 'order': 'motorola', 'physical_unit':
// ''}
int can_tx_active_fault_4(const std::uint8_t* bytes,
const int32_t length) const;
// config detail: {'name': 'CAN_TX_ACTIVE_FAULT_3', 'offset': 0.0,
// 'precision': 1.0, 'len': 8, 'is_signed_var': False, 'physical_range':
// '[0|0]', 'bit': 31, 'type': 'int', 'order': 'motorola', 'physical_unit':
// ''}
int can_tx_active_fault_3(const std::uint8_t* bytes,
const int32_t length) const;
// config detail: {'name': 'CAN_TX_ACTIVE_FAULT_2', 'offset': 0.0,
// 'precision': 1.0, 'len': 8, 'is_signed_var': False, 'physical_range':
// '[0|0]', 'bit': 23, 'type': 'int', 'order': 'motorola', 'physical_unit':
// ''}
int can_tx_active_fault_2(const std::uint8_t* bytes,
const int32_t length) const;
// config detail: {'name': 'CAN_TX_ACTIVE_FAULT_0', 'offset': 0.0,
// 'precision': 1.0, 'len': 8, 'is_signed_var': False, 'physical_range':
// '[0|0]', 'bit': 7, 'type': 'int', 'order': 'motorola', 'physical_unit': ''}
int can_tx_active_fault_0(const std::uint8_t* bytes,
const int32_t length) const;
// config detail: {'name': 'CAN_TX_ACTIVE_FAULT_1', 'offset': 0.0,
// 'precision': 1.0, 'len': 8, 'is_signed_var': False, 'physical_range':
// '[0|0]', 'bit': 15, 'type': 'int', 'order': 'motorola', 'physical_unit':
// ''}
int can_tx_active_fault_1(const std::uint8_t* bytes,
const int32_t length) const;
};
} // namespace delphi_esr
} // namespace drivers
} // namespace apollo
#endif // MODULES_CANBUS_VEHICL_ESR_PROTOCOL_ESR_STATUS7_5E6_H_
/******************************************************************************
* Copyright 2017 The Apollo Authors. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*****************************************************************************/
#include "modules/drivers/delphi_esr/protocol/esr_status8_5e7.h"
#include "glog/logging.h"
#include "modules/drivers/canbus/common/byte.h"
#include "modules/drivers/canbus/common/canbus_consts.h"
namespace apollo {
namespace drivers {
namespace delphi_esr {
using apollo::drivers::canbus::Byte;
Esrstatus85e7::Esrstatus85e7() {}
const int32_t Esrstatus85e7::ID = 0x5E7;
void Esrstatus85e7::Parse(const std::uint8_t* bytes, int32_t length,
DelphiESR* delphi_esr) const {
delphi_esr->mutable_esr_status8_5e7()->set_can_tx_history_fault_7(
can_tx_history_fault_7(bytes, length));
delphi_esr->mutable_esr_status8_5e7()->set_can_tx_history_fault_6(
can_tx_history_fault_6(bytes, length));
delphi_esr->mutable_esr_status8_5e7()->set_can_tx_history_fault_5(
can_tx_history_fault_5(bytes, length));
delphi_esr->mutable_esr_status8_5e7()->set_can_tx_history_fault_4(
can_tx_history_fault_4(bytes, length));
delphi_esr->mutable_esr_status8_5e7()->set_can_tx_history_fault_3(
can_tx_history_fault_3(bytes, length));
delphi_esr->mutable_esr_status8_5e7()->set_can_tx_history_fault_2(
can_tx_history_fault_2(bytes, length));
delphi_esr->mutable_esr_status8_5e7()->set_can_tx_history_fault_1(
can_tx_history_fault_1(bytes, length));
delphi_esr->mutable_esr_status8_5e7()->set_can_tx_history_fault_0(
can_tx_history_fault_0(bytes, length));
}
// config detail: {'name': 'can_tx_history_fault_7', 'offset': 0.0, 'precision':
// 1.0, 'len': 8, 'is_signed_var': False, 'physical_range': '[0|0]', 'bit': 63,
// 'type': 'int', 'order': 'motorola', 'physical_unit': ''}
int Esrstatus85e7::can_tx_history_fault_7(const std::uint8_t* bytes,
int32_t length) const {
Byte t0(bytes + 7);
int32_t x = t0.get_byte(0, 8);
int ret = x;
return ret;
}
// config detail: {'name': 'can_tx_history_fault_6', 'offset': 0.0, 'precision':
// 1.0, 'len': 8, 'is_signed_var': False, 'physical_range': '[0|0]', 'bit': 55,
// 'type': 'int', 'order': 'motorola', 'physical_unit': ''}
int Esrstatus85e7::can_tx_history_fault_6(const std::uint8_t* bytes,
int32_t length) const {
Byte t0(bytes + 6);
int32_t x = t0.get_byte(0, 8);
int ret = x;
return ret;
}
// config detail: {'name': 'can_tx_history_fault_5', 'offset': 0.0, 'precision':
// 1.0, 'len': 8, 'is_signed_var': False, 'physical_range': '[0|0]', 'bit': 47,
// 'type': 'int', 'order': 'motorola', 'physical_unit': ''}
int Esrstatus85e7::can_tx_history_fault_5(const std::uint8_t* bytes,
int32_t length) const {
Byte t0(bytes + 5);
int32_t x = t0.get_byte(0, 8);
int ret = x;
return ret;
}
// config detail: {'name': 'can_tx_history_fault_4', 'offset': 0.0, 'precision':
// 1.0, 'len': 8, 'is_signed_var': False, 'physical_range': '[0|0]', 'bit': 39,
// 'type': 'int', 'order': 'motorola', 'physical_unit': ''}
int Esrstatus85e7::can_tx_history_fault_4(const std::uint8_t* bytes,
int32_t length) const {
Byte t0(bytes + 4);
int32_t x = t0.get_byte(0, 8);
int ret = x;
return ret;
}
// config detail: {'name': 'can_tx_history_fault_3', 'offset': 0.0, 'precision':
// 1.0, 'len': 8, 'is_signed_var': False, 'physical_range': '[0|0]', 'bit': 31,
// 'type': 'int', 'order': 'motorola', 'physical_unit': ''}
int Esrstatus85e7::can_tx_history_fault_3(const std::uint8_t* bytes,
int32_t length) const {
Byte t0(bytes + 3);
int32_t x = t0.get_byte(0, 8);
int ret = x;
return ret;
}
// config detail: {'name': 'can_tx_history_fault_2', 'offset': 0.0, 'precision':
// 1.0, 'len': 8, 'is_signed_var': False, 'physical_range': '[0|0]', 'bit': 23,
// 'type': 'int', 'order': 'motorola', 'physical_unit': ''}
int Esrstatus85e7::can_tx_history_fault_2(const std::uint8_t* bytes,
int32_t length) const {
Byte t0(bytes + 2);
int32_t x = t0.get_byte(0, 8);
int ret = x;
return ret;
}
// config detail: {'name': 'can_tx_history_fault_1', 'offset': 0.0, 'precision':
// 1.0, 'len': 8, 'is_signed_var': False, 'physical_range': '[0|0]', 'bit': 15,
// 'type': 'int', 'order': 'motorola', 'physical_unit': ''}
int Esrstatus85e7::can_tx_history_fault_1(const std::uint8_t* bytes,
int32_t length) const {
Byte t0(bytes + 1);
int32_t x = t0.get_byte(0, 8);
int ret = x;
return ret;
}
// config detail: {'name': 'can_tx_history_fault_0', 'offset': 0.0, 'precision':
// 1.0, 'len': 8, 'is_signed_var': False, 'physical_range': '[0|0]', 'bit': 7,
// 'type': 'int', 'order': 'motorola', 'physical_unit': ''}
int Esrstatus85e7::can_tx_history_fault_0(const std::uint8_t* bytes,
int32_t length) const {
Byte t0(bytes + 0);
int32_t x = t0.get_byte(0, 8);
int ret = x;
return ret;
}
} // namespace delphi_esr
} // namespace drivers
} // namespace apollo
/******************************************************************************
* Copyright 2017 The Apollo Authors. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*****************************************************************************/
#ifndef MODULES_DRIVERS_DELPHI_ESR_PROTOCOL_ESR_STATUS8_5E7_H_
#define MODULES_DRIVERS_DELPHI_ESR_PROTOCOL_ESR_STATUS8_5E7_H_
#include "modules/drivers/proto/delphi_esr.pb.h"
#include "modules/drivers/canbus/can_comm/protocol_data.h"
namespace apollo {
namespace drivers {
namespace delphi_esr {
using apollo::drivers::DelphiESR;
class Esrstatus85e7 : public apollo::drivers::canbus::ProtocolData<DelphiESR> {
public:
static const int32_t ID;
Esrstatus85e7();
void Parse(const std::uint8_t* bytes, int32_t length,
DelphiESR* delphi_esr) const override;
private:
// config detail: {'name': 'CAN_TX_HISTORY_FAULT_7', 'offset': 0.0,
// 'precision': 1.0, 'len': 8, 'is_signed_var': False, 'physical_range':
// '[0|0]', 'bit': 63, 'type': 'int', 'order': 'motorola', 'physical_unit':
// ''}
int can_tx_history_fault_7(const std::uint8_t* bytes,
const int32_t length) const;
// config detail: {'name': 'CAN_TX_HISTORY_FAULT_6', 'offset': 0.0,
// 'precision': 1.0, 'len': 8, 'is_signed_var': False, 'physical_range':
// '[0|0]', 'bit': 55, 'type': 'int', 'order': 'motorola', 'physical_unit':
// ''}
int can_tx_history_fault_6(const std::uint8_t* bytes,
const int32_t length) const;
// config detail: {'name': 'CAN_TX_HISTORY_FAULT_5', 'offset': 0.0,
// 'precision': 1.0, 'len': 8, 'is_signed_var': False, 'physical_range':
// '[0|0]', 'bit': 47, 'type': 'int', 'order': 'motorola', 'physical_unit':
// ''}
int can_tx_history_fault_5(const std::uint8_t* bytes,
const int32_t length) const;
// config detail: {'name': 'CAN_TX_HISTORY_FAULT_4', 'offset': 0.0,
// 'precision': 1.0, 'len': 8, 'is_signed_var': False, 'physical_range':
// '[0|0]', 'bit': 39, 'type': 'int', 'order': 'motorola', 'physical_unit':
// ''}
int can_tx_history_fault_4(const std::uint8_t* bytes,
const int32_t length) const;
// config detail: {'name': 'CAN_TX_HISTORY_FAULT_3', 'offset': 0.0,
// 'precision': 1.0, 'len': 8, 'is_signed_var': False, 'physical_range':
// '[0|0]', 'bit': 31, 'type': 'int', 'order': 'motorola', 'physical_unit':
// ''}
int can_tx_history_fault_3(const std::uint8_t* bytes,
const int32_t length) const;
// config detail: {'name': 'CAN_TX_HISTORY_FAULT_2', 'offset': 0.0,
// 'precision': 1.0, 'len': 8, 'is_signed_var': False, 'physical_range':
// '[0|0]', 'bit': 23, 'type': 'int', 'order': 'motorola', 'physical_unit':
// ''}
int can_tx_history_fault_2(const std::uint8_t* bytes,
const int32_t length) const;
// config detail: {'name': 'CAN_TX_HISTORY_FAULT_1', 'offset': 0.0,
// 'precision': 1.0, 'len': 8, 'is_signed_var': False, 'physical_range':
// '[0|0]', 'bit': 15, 'type': 'int', 'order': 'motorola', 'physical_unit':
// ''}
int can_tx_history_fault_1(const std::uint8_t* bytes,
const int32_t length) const;
// config detail: {'name': 'CAN_TX_HISTORY_FAULT_0', 'offset': 0.0,
// 'precision': 1.0, 'len': 8, 'is_signed_var': False, 'physical_range':
// '[0|0]', 'bit': 7, 'type': 'int', 'order': 'motorola', 'physical_unit': ''}
int can_tx_history_fault_0(const std::uint8_t* bytes,
const int32_t length) const;
};
} // namespace delphi_esr
} // namespace drivers
} // namespace apollo
#endif // MODULES_CANBUS_VEHICL_ESR_PROTOCOL_ESR_STATUS8_5E7_H_
/******************************************************************************
* Copyright 2017 The Apollo Authors. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*****************************************************************************/
#include "modules/drivers/delphi_esr/protocol/esr_status9_5e8.h"
#include "glog/logging.h"
#include "modules/drivers/canbus/common/byte.h"
#include "modules/drivers/canbus/common/canbus_consts.h"
namespace apollo {
namespace drivers {
namespace delphi_esr {
using apollo::drivers::canbus::Byte;
Esrstatus95e8::Esrstatus95e8() {}
const int32_t Esrstatus95e8::ID = 0x5E8;
void Esrstatus95e8::Parse(const std::uint8_t* bytes, int32_t length,
DelphiESR* delphi_esr) const {
delphi_esr->mutable_esr_status9_5e8()->set_can_tx_path_id_acc_3(
can_tx_path_id_acc_3(bytes, length));
delphi_esr->mutable_esr_status9_5e8()->set_can_tx_path_id_acc_2(
can_tx_path_id_acc_2(bytes, length));
delphi_esr->mutable_esr_status9_5e8()->set_can_tx_filtered_xohp_acc_cipv(
can_tx_filtered_xohp_acc_cipv(bytes, length));
delphi_esr->mutable_esr_status9_5e8()->set_can_tx_water_spray_target_id(
can_tx_water_spray_target_id(bytes, length));
delphi_esr->mutable_esr_status9_5e8()->set_can_tx_serial_num_3rd_byte(
can_tx_serial_num_3rd_byte(bytes, length));
delphi_esr->mutable_esr_status9_5e8()->set_can_tx_sideslip_angle(
can_tx_sideslip_angle(bytes, length));
delphi_esr->mutable_esr_status9_5e8()->set_can_tx_avg_pwr_cwblkg(
can_tx_avg_pwr_cwblkg(bytes, length));
}
// config detail: {'name': 'can_tx_path_id_acc_3', 'offset': 0.0, 'precision':
// 1.0, 'len': 8, 'is_signed_var': False, 'physical_range': '[0|64]', 'bit': 63,
// 'type': 'int', 'order': 'motorola', 'physical_unit': ''}
int Esrstatus95e8::can_tx_path_id_acc_3(const std::uint8_t* bytes,
int32_t length) const {
Byte t0(bytes + 7);
int32_t x = t0.get_byte(0, 8);
int ret = x;
return ret;
}
// config detail: {'name': 'can_tx_path_id_acc_2', 'offset': 0.0, 'precision':
// 1.0, 'len': 8, 'is_signed_var': False, 'physical_range': '[0|64]', 'bit': 55,
// 'type': 'int', 'order': 'motorola', 'physical_unit': ''}
int Esrstatus95e8::can_tx_path_id_acc_2(const std::uint8_t* bytes,
int32_t length) const {
Byte t0(bytes + 6);
int32_t x = t0.get_byte(0, 8);
int ret = x;
return ret;
}
// config detail: {'name': 'can_tx_filtered_xohp_acc_cipv', 'offset': 0.0,
// 'precision': 0.03125, 'len': 9, 'is_signed_var': True, 'physical_range':
// '[-8|7.96875]', 'bit': 32, 'type': 'double', 'order': 'motorola',
// 'physical_unit': 'm'}
double Esrstatus95e8::can_tx_filtered_xohp_acc_cipv(const std::uint8_t* bytes,
int32_t length) const {
Byte t0(bytes + 4);
int32_t x = t0.get_byte(0, 1);
Byte t1(bytes + 5);
int32_t t = t1.get_byte(0, 8);
x <<= 8;
x |= t;
x <<= 23;
x >>= 23;
double ret = x * 0.031250;
return ret;
}
// config detail: {'name': 'can_tx_water_spray_target_id', 'offset': 0.0,
// 'precision': 1.0, 'len': 7, 'is_signed_var': False, 'physical_range':
// '[0|64]', 'bit': 39, 'type': 'int', 'order': 'motorola', 'physical_unit': ''}
int Esrstatus95e8::can_tx_water_spray_target_id(const std::uint8_t* bytes,
int32_t length) const {
Byte t0(bytes + 4);
int32_t x = t0.get_byte(1, 7);
int ret = x;
return ret;
}
// config detail: {'name': 'can_tx_serial_num_3rd_byte', 'offset': 0.0,
// 'precision': 1.0, 'len': 8, 'is_signed_var': False, 'physical_range':
// '[0|0]', 'bit': 31, 'type': 'int', 'order': 'motorola', 'physical_unit': ''}
int Esrstatus95e8::can_tx_serial_num_3rd_byte(const std::uint8_t* bytes,
int32_t length) const {
Byte t0(bytes + 3);
int32_t x = t0.get_byte(0, 8);
int ret = x;
return ret;
}
// config detail: {'name': 'can_tx_sideslip_angle', 'offset': 0.0, 'precision':
// 0.125, 'len': 10, 'is_signed_var': True, 'physical_range': '[-64|63.875]',
// 'bit': 9, 'type': 'double', 'order': 'motorola', 'physical_unit': 'deg'}
double Esrstatus95e8::can_tx_sideslip_angle(const std::uint8_t* bytes,
int32_t length) const {
Byte t0(bytes + 1);
int32_t x = t0.get_byte(0, 2);
Byte t1(bytes + 2);
int32_t t = t1.get_byte(0, 8);
x <<= 8;
x |= t;
x <<= 22;
x >>= 22;
double ret = x * 0.125000;
return ret;
}
// config detail: {'name': 'can_tx_avg_pwr_cwblkg', 'offset': 0.0, 'precision':
// 1.0, 'len': 12, 'is_signed_var': False, 'physical_range': '[0|0]', 'bit': 7,
// 'type': 'int', 'order': 'motorola', 'physical_unit': ''}
int Esrstatus95e8::can_tx_avg_pwr_cwblkg(const std::uint8_t* bytes,
int32_t length) const {
Byte t0(bytes + 0);
int32_t x = t0.get_byte(0, 8);
Byte t1(bytes + 1);
int32_t t = t1.get_byte(4, 4);
x <<= 4;
x |= t;
int ret = x;
return ret;
}
} // namespace delphi_esr
} // namespace drivers
} // namespace apollo
/******************************************************************************
* Copyright 2017 The Apollo Authors. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*****************************************************************************/
#ifndef MODULES_DRIVERS_DELPHI_ESR_PROTOCOL_ESR_STATUS9_5E8_H_
#define MODULES_DRIVERS_DELPHI_ESR_PROTOCOL_ESR_STATUS9_5E8_H_
#include "modules/drivers/proto/delphi_esr.pb.h"
#include "modules/drivers/canbus/can_comm/protocol_data.h"
namespace apollo {
namespace drivers {
namespace delphi_esr {
using apollo::drivers::DelphiESR;
class Esrstatus95e8 : public apollo::drivers::canbus::ProtocolData<DelphiESR> {
public:
static const int32_t ID;
Esrstatus95e8();
void Parse(const std::uint8_t* bytes, int32_t length,
DelphiESR* delphi_esr) const override;
private:
// config detail: {'name': 'CAN_TX_PATH_ID_ACC_3', 'offset': 0.0, 'precision':
// 1.0, 'len': 8, 'is_signed_var': False, 'physical_range': '[0|64]', 'bit':
// 63, 'type': 'int', 'order': 'motorola', 'physical_unit': ''}
int can_tx_path_id_acc_3(const std::uint8_t* bytes,
const int32_t length) const;
// config detail: {'name': 'CAN_TX_PATH_ID_ACC_2', 'offset': 0.0, 'precision':
// 1.0, 'len': 8, 'is_signed_var': False, 'physical_range': '[0|64]', 'bit':
// 55, 'type': 'int', 'order': 'motorola', 'physical_unit': ''}
int can_tx_path_id_acc_2(const std::uint8_t* bytes,
const int32_t length) const;
// config detail: {'name': 'CAN_TX_FILTERED_XOHP_ACC_CIPV', 'offset': 0.0,
// 'precision': 0.03125, 'len': 9, 'is_signed_var': True, 'physical_range':
// '[-8|7.96875]', 'bit': 32, 'type': 'double', 'order': 'motorola',
// 'physical_unit': 'm'}
double can_tx_filtered_xohp_acc_cipv(const std::uint8_t* bytes,
const int32_t length) const;
// config detail: {'name': 'CAN_TX_WATER_SPRAY_TARGET_ID', 'offset': 0.0,
// 'precision': 1.0, 'len': 7, 'is_signed_var': False, 'physical_range':
// '[0|64]', 'bit': 39, 'type': 'int', 'order': 'motorola', 'physical_unit':
// ''}
int can_tx_water_spray_target_id(const std::uint8_t* bytes,
const int32_t length) const;
// config detail: {'name': 'CAN_TX_SERIAL_NUM_3RD_BYTE', 'offset': 0.0,
// 'precision': 1.0, 'len': 8, 'is_signed_var': False, 'physical_range':
// '[0|0]', 'bit': 31, 'type': 'int', 'order': 'motorola', 'physical_unit':
// ''}
int can_tx_serial_num_3rd_byte(const std::uint8_t* bytes,
const int32_t length) const;
// config detail: {'name': 'CAN_TX_SIDESLIP_ANGLE', 'offset': 0.0,
// 'precision': 0.125, 'len': 10, 'is_signed_var': True, 'physical_range':
// '[-64|63.875]', 'bit': 9, 'type': 'double', 'order': 'motorola',
// 'physical_unit': 'deg'}
double can_tx_sideslip_angle(const std::uint8_t* bytes,
const int32_t length) const;
// config detail: {'name': 'CAN_TX_AVG_PWR_CWBLKG', 'offset': 0.0,
// 'precision': 1.0, 'len': 12, 'is_signed_var': False, 'physical_range':
// '[0|0]', 'bit': 7, 'type': 'int', 'order': 'motorola', 'physical_unit': ''}
int can_tx_avg_pwr_cwblkg(const std::uint8_t* bytes,
const int32_t length) const;
};
} // namespace delphi_esr
} // namespace drivers
} // namespace apollo
#endif // MODULES_CANBUS_VEHICL_ESR_PROTOCOL_ESR_STATUS9_5E8_H_
/******************************************************************************
* Copyright 2017 The Apollo Authors. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*****************************************************************************/
#include "modules/drivers/delphi_esr/protocol/esr_track01_500.h"
#include "glog/logging.h"
#include "modules/drivers/canbus/common/byte.h"
#include "modules/drivers/canbus/common/canbus_consts.h"
namespace apollo {
namespace drivers {
namespace delphi_esr {
using apollo::drivers::canbus::Byte;
Esrtrack01500::Esrtrack01500() {}
const int32_t Esrtrack01500::ID = 0x500;
void Esrtrack01500::Parse(const std::uint8_t* bytes, int32_t length,
DelphiESR* delphi_esr) const {
auto* esr_track01_500 = delphi_esr->add_esr_track01_500();
esr_track01_500->set_can_tx_track_grouping_changed(
can_tx_track_grouping_changed(bytes, length));
esr_track01_500->set_can_tx_track_oncoming(
can_tx_track_oncoming(bytes, length));
esr_track01_500->set_can_tx_track_lat_rate(
can_tx_track_lat_rate(bytes, length));
esr_track01_500->set_can_tx_track_bridge_object(
can_tx_track_bridge_object(bytes, length));
esr_track01_500->set_can_tx_track_width(can_tx_track_width(bytes, length));
esr_track01_500->set_can_tx_track_status(can_tx_track_status(bytes, length));
esr_track01_500->set_can_tx_track_rolling_count(
can_tx_track_rolling_count(bytes, length));
esr_track01_500->set_can_tx_track_range_rate(
can_tx_track_range_rate(bytes, length));
esr_track01_500->set_can_tx_track_range_accel(
can_tx_track_range_accel(bytes, length));
esr_track01_500->set_can_tx_track_range(can_tx_track_range(bytes, length));
esr_track01_500->set_can_tx_track_med_range_mode(
can_tx_track_med_range_mode(bytes, length));
esr_track01_500->set_can_tx_track_angle(can_tx_track_angle(bytes, length));
}
// config detail: {'name': 'can_tx_track_grouping_changed', 'enum': {0:
// 'CAN_TX_TRACK_GROUPING_CHANGED_GROUPINGUNCHANGED', 1:
// 'CAN_TX_TRACK_GROUPING_CHANGED_GROUPINGCHANGED'}, 'precision': 1.0, 'len': 1,
// 'is_signed_var': False, 'offset': 0.0, 'physical_range': '[0|0]', 'bit': 1,
// 'type': 'enum', 'order': 'motorola', 'physical_unit': ''}
Esr_track01_500::Can_tx_track_grouping_changedType
Esrtrack01500::can_tx_track_grouping_changed(const std::uint8_t* bytes,
int32_t length) const {
Byte t0(bytes + 0);
int32_t x = t0.get_byte(1, 1);
Esr_track01_500::Can_tx_track_grouping_changedType ret =
static_cast<Esr_track01_500::Can_tx_track_grouping_changedType>(x);
return ret;
}
// config detail: {'name': 'can_tx_track_oncoming', 'enum': {0:
// 'CAN_TX_TRACK_ONCOMING_NOTONCOMING', 1: 'CAN_TX_TRACK_ONCOMING_ONCOMING'},
// 'precision': 1.0, 'len': 1, 'is_signed_var': False, 'offset': 0.0,
// 'physical_range': '[0|0]', 'bit': 0, 'type': 'enum', 'order': 'motorola',
// 'physical_unit': ''}
Esr_track01_500::Can_tx_track_oncomingType Esrtrack01500::can_tx_track_oncoming(
const std::uint8_t* bytes, int32_t length) const {
Byte t0(bytes + 0);
int32_t x = t0.get_byte(0, 1);
Esr_track01_500::Can_tx_track_oncomingType ret =
static_cast<Esr_track01_500::Can_tx_track_oncomingType>(x);
return ret;
}
// config detail: {'name': 'can_tx_track_lat_rate', 'offset': 0.0, 'precision':
// 0.25, 'len': 6, 'is_signed_var': True, 'physical_range': '[-8|7.75]', 'bit':
// 7, 'type': 'double', 'order': 'motorola', 'physical_unit': ''}
double Esrtrack01500::can_tx_track_lat_rate(const std::uint8_t* bytes,
int32_t length) const {
Byte t0(bytes + 0);
int32_t x = t0.get_byte(2, 6);
x <<= 26;
x >>= 26;
double ret = x * 0.250000;
return ret;
}
// config detail: {'name': 'can_tx_track_bridge_object', 'enum': {0:
// 'CAN_TX_TRACK_BRIDGE_OBJECT_NOT_BRIDGE', 1:
// 'CAN_TX_TRACK_BRIDGE_OBJECT_BRIDGE'}, 'precision': 1.0, 'len': 1,
// 'is_signed_var': False, 'offset': 0.0, 'physical_range': '[0|0]', 'bit': 39,
// 'type': 'enum', 'order': 'motorola', 'physical_unit': ''}
Esr_track01_500::Can_tx_track_bridge_objectType
Esrtrack01500::can_tx_track_bridge_object(const std::uint8_t* bytes,
int32_t length) const {
Byte t0(bytes + 4);
int32_t x = t0.get_byte(7, 1);
Esr_track01_500::Can_tx_track_bridge_objectType ret =
static_cast<Esr_track01_500::Can_tx_track_bridge_objectType>(x);
return ret;
}
// config detail: {'name': 'can_tx_track_width', 'offset': 0.0, 'precision':
// 0.5, 'len': 4, 'is_signed_var': False, 'physical_range': '[0|7.5]', 'bit':
// 37, 'type': 'double', 'order': 'motorola', 'physical_unit': 'm'}
double Esrtrack01500::can_tx_track_width(const std::uint8_t* bytes,
int32_t length) const {
Byte t0(bytes + 4);
int32_t x = t0.get_byte(2, 4);
double ret = x * 0.500000;
return ret;
}
// config detail: {'name': 'can_tx_track_status', 'enum': {0:
// 'CAN_TX_TRACK_STATUS_NO_TARGET', 1: 'CAN_TX_TRACK_STATUS_NEW_TARGET', 2:
// 'CAN_TX_TRACK_STATUS_NEW_UPDATED_TARGET', 3:
// 'CAN_TX_TRACK_STATUS_UPDATED_TARGET', 4:
// 'CAN_TX_TRACK_STATUS_COASTED_TARGET', 5: 'CAN_TX_TRACK_STATUS_MERGED_TARGET',
// 6: 'CAN_TX_TRACK_STATUS_INVALID_COASTED_TARGET', 7:
// 'CAN_TX_TRACK_STATUS_NEW_COASTED_TARGET'}, 'precision': 1.0, 'len': 3,
// 'is_signed_var': False, 'offset': 0.0, 'physical_range': '[0|7]', 'bit': 15,
// 'type': 'enum', 'order': 'motorola', 'physical_unit': ''}
Esr_track01_500::Can_tx_track_statusType Esrtrack01500::can_tx_track_status(
const std::uint8_t* bytes, int32_t length) const {
Byte t0(bytes + 1);
int32_t x = t0.get_byte(5, 3);
Esr_track01_500::Can_tx_track_statusType ret =
static_cast<Esr_track01_500::Can_tx_track_statusType>(x);
return ret;
}
// config detail: {'name': 'can_tx_track_rolling_count', 'offset': 0.0,
// 'precision': 1.0, 'len': 1, 'is_signed_var': False, 'physical_range':
// '[0|1]', 'bit': 38, 'type': 'bool', 'order': 'motorola', 'physical_unit': ''}
bool Esrtrack01500::can_tx_track_rolling_count(const std::uint8_t* bytes,
int32_t length) const {
Byte t0(bytes + 4);
int32_t x = t0.get_byte(6, 1);
bool ret = x;
return ret;
}
// config detail: {'name': 'can_tx_track_range_rate', 'offset': 0.0,
// 'precision': 0.01, 'len': 14, 'is_signed_var': True, 'physical_range':
// '[-81.92|81.91]', 'bit': 53, 'type': 'double', 'order': 'motorola',
// 'physical_unit': 'm/s'}
double Esrtrack01500::can_tx_track_range_rate(const std::uint8_t* bytes,
int32_t length) const {
Byte t0(bytes + 6);
int32_t x = t0.get_byte(0, 6);
Byte t1(bytes + 7);
int32_t t = t1.get_byte(0, 8);
x <<= 8;
x |= t;
x <<= 18;
x >>= 18;
double ret = x * 0.010000;
return ret;
}
// config detail: {'name': 'can_tx_track_range_accel', 'offset': 0.0,
// 'precision': 0.05, 'len': 10, 'is_signed_var': True, 'physical_range':
// '[-25.6|25.55]', 'bit': 33, 'type': 'double', 'order': 'motorola',
// 'physical_unit': 'm/s/s'}
double Esrtrack01500::can_tx_track_range_accel(const std::uint8_t* bytes,
int32_t length) const {
Byte t0(bytes + 4);
int32_t x = t0.get_byte(0, 2);
Byte t1(bytes + 5);
int32_t t = t1.get_byte(0, 8);
x <<= 8;
x |= t;
x <<= 22;
x >>= 22;
double ret = x * 0.050000;
return ret;
}
// config detail: {'name': 'can_tx_track_range', 'offset': 0.0, 'precision':
// 0.1, 'len': 11, 'is_signed_var': False, 'physical_range': '[0|204.7]', 'bit':
// 18, 'type': 'double', 'order': 'motorola', 'physical_unit': 'm'}
double Esrtrack01500::can_tx_track_range(const std::uint8_t* bytes,
int32_t length) const {
Byte t0(bytes + 2);
int32_t x = t0.get_byte(0, 3);
Byte t1(bytes + 3);
int32_t t = t1.get_byte(0, 8);
x <<= 8;
x |= t;
double ret = x * 0.100000;
return ret;
}
// config detail: {'name': 'can_tx_track_med_range_mode', 'enum': {0:
// 'CAN_TX_TRACK_MED_RANGE_MODE_NO_MR_LR_UPDATE', 1:
// 'CAN_TX_TRACK_MED_RANGE_MODE_MR_UPDATE_ONLY', 2:
// 'CAN_TX_TRACK_MED_RANGE_MODE_LR_UPDATE_ONLY', 3:
// 'CAN_TX_TRACK_MED_RANGE_MODE_BOTH_MR_LR_UPDATE'}, 'precision': 1.0, 'len': 2,
// 'is_signed_var': False, 'offset': 0.0, 'physical_range': '[0|3]', 'bit': 55,
// 'type': 'enum', 'order': 'motorola', 'physical_unit': ''}
Esr_track01_500::Can_tx_track_med_range_modeType
Esrtrack01500::can_tx_track_med_range_mode(const std::uint8_t* bytes,
int32_t length) const {
Byte t0(bytes + 6);
int32_t x = t0.get_byte(6, 2);
Esr_track01_500::Can_tx_track_med_range_modeType ret =
static_cast<Esr_track01_500::Can_tx_track_med_range_modeType>(x);
return ret;
}
// config detail: {'name': 'can_tx_track_angle', 'offset': 0.0, 'precision':
// 0.1, 'len': 10, 'is_signed_var': True, 'physical_range': '[-51.2|51.1]',
// 'bit': 12, 'type': 'double', 'order': 'motorola', 'physical_unit': 'deg'}
double Esrtrack01500::can_tx_track_angle(const std::uint8_t* bytes,
int32_t length) const {
Byte t0(bytes + 1);
int32_t x = t0.get_byte(0, 5);
Byte t1(bytes + 2);
int32_t t = t1.get_byte(3, 5);
x <<= 5;
x |= t;
x <<= 22;
x >>= 22;
double ret = x * 0.100000;
return ret;
}
} // namespace delphi_esr
} // namespace drivers
} // namespace apollo
/******************************************************************************
* Copyright 2017 The Apollo Authors. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*****************************************************************************/
#ifndef MODULES_DRIVERS_DELPHI_ESR_PROTOCOL_ESR_TRACK01_500_H_
#define MODULES_DRIVERS_DELPHI_ESR_PROTOCOL_ESR_TRACK01_500_H_
#include "modules/drivers/proto/delphi_esr.pb.h"
#include "modules/drivers/canbus/can_comm/protocol_data.h"
namespace apollo {
namespace drivers {
namespace delphi_esr {
using apollo::drivers::DelphiESR;
class Esrtrack01500 : public apollo::drivers::canbus::ProtocolData<DelphiESR> {
public:
static const int32_t ID;
Esrtrack01500();
void Parse(const std::uint8_t* bytes, int32_t length,
DelphiESR* delphi_esr) const override;
private:
// config detail: {'name': 'CAN_TX_TRACK_GROUPING_CHANGED', 'enum': {0:
// 'CAN_TX_TRACK_GROUPING_CHANGED_GROUPINGUNCHANGED', 1:
// 'CAN_TX_TRACK_GROUPING_CHANGED_GROUPINGCHANGED'}, 'precision': 1.0, 'len':
// 1, 'is_signed_var': False, 'offset': 0.0, 'physical_range': '[0|0]', 'bit':
// 1, 'type': 'enum', 'order': 'motorola', 'physical_unit': ''}
Esr_track01_500::Can_tx_track_grouping_changedType
can_tx_track_grouping_changed(const std::uint8_t* bytes,
const int32_t length) const;
// config detail: {'name': 'CAN_TX_TRACK_ONCOMING', 'enum': {0:
// 'CAN_TX_TRACK_ONCOMING_NOTONCOMING', 1: 'CAN_TX_TRACK_ONCOMING_ONCOMING'},
// 'precision': 1.0, 'len': 1, 'is_signed_var': False, 'offset': 0.0,
// 'physical_range': '[0|0]', 'bit': 0, 'type': 'enum', 'order': 'motorola',
// 'physical_unit': ''}
Esr_track01_500::Can_tx_track_oncomingType can_tx_track_oncoming(
const std::uint8_t* bytes, const int32_t length) const;
// config detail: {'name': 'CAN_TX_TRACK_LAT_RATE', 'offset': 0.0,
// 'precision': 0.25, 'len': 6, 'is_signed_var': True, 'physical_range':
// '[-8|7.75]', 'bit': 7, 'type': 'double', 'order': 'motorola',
// 'physical_unit': ''}
double can_tx_track_lat_rate(const std::uint8_t* bytes,
const int32_t length) const;
// config detail: {'name': 'CAN_TX_TRACK_BRIDGE_OBJECT', 'enum': {0:
// 'CAN_TX_TRACK_BRIDGE_OBJECT_NOT_BRIDGE', 1:
// 'CAN_TX_TRACK_BRIDGE_OBJECT_BRIDGE'}, 'precision': 1.0, 'len': 1,
// 'is_signed_var': False, 'offset': 0.0, 'physical_range': '[0|0]', 'bit':
// 39, 'type': 'enum', 'order': 'motorola', 'physical_unit': ''}
Esr_track01_500::Can_tx_track_bridge_objectType can_tx_track_bridge_object(
const std::uint8_t* bytes, const int32_t length) const;
// config detail: {'name': 'CAN_TX_TRACK_WIDTH', 'offset': 0.0, 'precision':
// 0.5, 'len': 4, 'is_signed_var': False, 'physical_range': '[0|7.5]', 'bit':
// 37, 'type': 'double', 'order': 'motorola', 'physical_unit': 'm'}
double can_tx_track_width(const std::uint8_t* bytes,
const int32_t length) const;
// config detail: {'name': 'CAN_TX_TRACK_STATUS', 'enum': {0:
// 'CAN_TX_TRACK_STATUS_NO_TARGET', 1: 'CAN_TX_TRACK_STATUS_NEW_TARGET', 2:
// 'CAN_TX_TRACK_STATUS_NEW_UPDATED_TARGET', 3:
// 'CAN_TX_TRACK_STATUS_UPDATED_TARGET', 4:
// 'CAN_TX_TRACK_STATUS_COASTED_TARGET', 5:
// 'CAN_TX_TRACK_STATUS_MERGED_TARGET', 6:
// 'CAN_TX_TRACK_STATUS_INVALID_COASTED_TARGET', 7:
// 'CAN_TX_TRACK_STATUS_NEW_COASTED_TARGET'}, 'precision': 1.0, 'len': 3,
// 'is_signed_var': False, 'offset': 0.0, 'physical_range': '[0|7]', 'bit':
// 15, 'type': 'enum', 'order': 'motorola', 'physical_unit': ''}
Esr_track01_500::Can_tx_track_statusType can_tx_track_status(
const std::uint8_t* bytes, const int32_t length) const;
// config detail: {'name': 'CAN_TX_TRACK_ROLLING_COUNT', 'offset': 0.0,
// 'precision': 1.0, 'len': 1, 'is_signed_var': False, 'physical_range':
// '[0|1]', 'bit': 38, 'type': 'bool', 'order': 'motorola', 'physical_unit':
// ''}
bool can_tx_track_rolling_count(const std::uint8_t* bytes,
const int32_t length) const;
// config detail: {'name': 'CAN_TX_TRACK_RANGE_RATE', 'offset': 0.0,
// 'precision': 0.01, 'len': 14, 'is_signed_var': True, 'physical_range':
// '[-81.92|81.91]', 'bit': 53, 'type': 'double', 'order': 'motorola',
// 'physical_unit': 'm/s'}
double can_tx_track_range_rate(const std::uint8_t* bytes,
const int32_t length) const;
// config detail: {'name': 'CAN_TX_TRACK_RANGE_ACCEL', 'offset': 0.0,
// 'precision': 0.05, 'len': 10, 'is_signed_var': True, 'physical_range':
// '[-25.6|25.55]', 'bit': 33, 'type': 'double', 'order': 'motorola',
// 'physical_unit': 'm/s/s'}
double can_tx_track_range_accel(const std::uint8_t* bytes,
const int32_t length) const;
// config detail: {'name': 'CAN_TX_TRACK_RANGE', 'offset': 0.0, 'precision':
// 0.1, 'len': 11, 'is_signed_var': False, 'physical_range': '[0|204.7]',
// 'bit': 18, 'type': 'double', 'order': 'motorola', 'physical_unit': 'm'}
double can_tx_track_range(const std::uint8_t* bytes,
const int32_t length) const;
// config detail: {'name': 'CAN_TX_TRACK_MED_RANGE_MODE', 'enum': {0:
// 'CAN_TX_TRACK_MED_RANGE_MODE_NO_MR_LR_UPDATE', 1:
// 'CAN_TX_TRACK_MED_RANGE_MODE_MR_UPDATE_ONLY', 2:
// 'CAN_TX_TRACK_MED_RANGE_MODE_LR_UPDATE_ONLY', 3:
// 'CAN_TX_TRACK_MED_RANGE_MODE_BOTH_MR_LR_UPDATE'}, 'precision': 1.0, 'len':
// 2, 'is_signed_var': False, 'offset': 0.0, 'physical_range': '[0|3]', 'bit':
// 55, 'type': 'enum', 'order': 'motorola', 'physical_unit': ''}
Esr_track01_500::Can_tx_track_med_range_modeType can_tx_track_med_range_mode(
const std::uint8_t* bytes, const int32_t length) const;
// config detail: {'name': 'CAN_TX_TRACK_ANGLE', 'offset': 0.0, 'precision':
// 0.1, 'len': 10, 'is_signed_var': True, 'physical_range': '[-51.2|51.1]',
// 'bit': 12, 'type': 'double', 'order': 'motorola', 'physical_unit': 'deg'}
double can_tx_track_angle(const std::uint8_t* bytes,
const int32_t length) const;
};
} // namespace delphi_esr
} // namespace drivers
} // namespace apollo
#endif // MODULES_CANBUS_VEHICL_ESR_PROTOCOL_ESR_TRACK01_500_H_
/******************************************************************************
* Copyright 2017 The Apollo Authors. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*****************************************************************************/
#include "modules/drivers/delphi_esr/protocol/esr_trackmotionpower_540.h"
#include "glog/logging.h"
#include "modules/drivers/canbus/common/byte.h"
#include "modules/drivers/canbus/common/canbus_consts.h"
namespace apollo {
namespace drivers {
namespace delphi_esr {
using apollo::drivers::canbus::Byte;
Esrtrackmotionpower540::Esrtrackmotionpower540() {}
const int32_t Esrtrackmotionpower540::ID = 0x540;
void Esrtrackmotionpower540::Parse(const std::uint8_t* bytes, int32_t length,
DelphiESR* delphi_esr) const {
auto* esr_trackmotionpower_540 = delphi_esr->add_esr_trackmotionpower_540();
esr_trackmotionpower_540->set_can_tx_track_rolling_count_2(
can_tx_track_rolling_count_2(bytes, length));
esr_trackmotionpower_540->set_can_tx_track_can_id_group(
can_tx_track_can_id_group(bytes, length));
for (int32_t index = 0;
index <
(esr_trackmotionpower_540->can_tx_track_can_id_group() < 9 ? 7 : 1);
++index) {
auto* can_tx_track_motion_power =
esr_trackmotionpower_540->add_can_tx_track_motion_power();
can_tx_track_motion_power->set_can_tx_track_moving(
can_tx_track_moving(bytes, length, index));
can_tx_track_motion_power->set_can_tx_track_moving_fast(
can_tx_track_moving_fast(bytes, length, index));
can_tx_track_motion_power->set_can_tx_track_moving_slow(
can_tx_track_moving_slow(bytes, length, index));
can_tx_track_motion_power->set_can_tx_track_power(
can_tx_track_power(bytes, length, index));
}
}
// config detail: {'name': 'can_tx_track_rolling_count_2', 'offset': 0.0,
// 'precision': 1.0, 'len': 1, 'is_signed_var': False, 'physical_range':
// '[0|1]', 'bit': 4, 'type': 'bool', 'order': 'motorola', 'physical_unit': ''}
bool Esrtrackmotionpower540::can_tx_track_rolling_count_2(
const std::uint8_t* bytes, int32_t length) const {
Byte t0(bytes + 0);
int32_t x = t0.get_byte(4, 1);
bool ret = x;
return ret;
}
int32_t Esrtrackmotionpower540::can_tx_track_can_id_group(
const std::uint8_t* bytes, int32_t length) const {
Byte t0(bytes + 0);
int32_t x = t0.get_byte(0, 4);
int32_t ret = x;
return ret;
}
bool Esrtrackmotionpower540::can_tx_track_moving(const std::uint8_t* bytes,
int32_t length,
int32_t index) const {
Byte t0(bytes + 1 + index);
int32_t x = t0.get_byte(7, 1);
bool ret = x;
return ret;
}
bool Esrtrackmotionpower540::can_tx_track_moving_fast(const std::uint8_t* bytes,
int32_t length,
int32_t index) const {
Byte t0(bytes + 1 + index);
int32_t x = t0.get_byte(6, 1);
bool ret = x;
return ret;
}
bool Esrtrackmotionpower540::can_tx_track_moving_slow(const std::uint8_t* bytes,
int32_t length,
int32_t index) const {
Byte t0(bytes + 1 + index);
int32_t x = t0.get_byte(5, 1);
bool ret = x;
return ret;
}
int32_t Esrtrackmotionpower540::can_tx_track_power(const std::uint8_t* bytes,
int32_t length,
int32_t index) const {
Byte t0(bytes + 1 + index);
int32_t x = t0.get_byte(0, 5);
int32_t ret = x;
return ret;
}
} // namespace delphi_esr
} // namespace drivers
} // namespace apollo
/******************************************************************************
* Copyright 2017 The Apollo Authors. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*****************************************************************************/
#ifndef MODULES_DRIVERS_DELPHI_ESR_PROTOCOL_ESR_TRACKMOTIONPOWER_540_H_
#define MODULES_DRIVERS_DELPHI_ESR_PROTOCOL_ESR_TRACKMOTIONPOWER_540_H_
#include "modules/drivers/proto/delphi_esr.pb.h"
#include "modules/drivers/canbus/can_comm/protocol_data.h"
namespace apollo {
namespace drivers {
namespace delphi_esr {
using apollo::drivers::DelphiESR;
class Esrtrackmotionpower540 :
public apollo::drivers::canbus::ProtocolData<DelphiESR> {
public:
static const int32_t ID;
Esrtrackmotionpower540();
void Parse(const std::uint8_t* bytes, int32_t length,
DelphiESR* delphi_esr) const override;
private:
// config detail: {'name': 'CAN_TX_TRACK_ROLLING_COUNT_2', 'offset': 0.0,
// 'precision': 1.0, 'len': 1, 'is_signed_var': False, 'physical_range':
// '[0|1]', 'bit': 4, 'type': 'bool', 'order': 'motorola', 'physical_unit':
// ''}
bool can_tx_track_rolling_count_2(const std::uint8_t* bytes,
const int32_t length) const;
int32_t can_tx_track_can_id_group(const std::uint8_t* bytes,
int32_t length) const;
bool can_tx_track_moving(const std::uint8_t* bytes, int32_t length,
int32_t index) const;
bool can_tx_track_moving_fast(const std::uint8_t* bytes, int32_t length,
int32_t index) const;
bool can_tx_track_moving_slow(const std::uint8_t* bytes, int32_t length,
int32_t index) const;
int32_t can_tx_track_power(const std::uint8_t* bytes, int32_t length,
int32_t index) const;
};
} // namespace delphi_esr
} // namespace drivers
} // namespace apollo
#endif // MODULES_CANBUS_VEHICL_ESR_PROTOCOL_ESR_TRACKMOTIONPOWER_540_H_
/******************************************************************************
* Copyright 2017 The Apollo Authors. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*****************************************************************************/
#include "modules/drivers/delphi_esr/protocol/esr_valid1_5d0.h"
#include "glog/logging.h"
#include "modules/drivers/canbus/common/byte.h"
#include "modules/drivers/canbus/common/canbus_consts.h"
namespace apollo {
namespace drivers {
namespace delphi_esr {
using apollo::drivers::canbus::Byte;
Esrvalid15d0::Esrvalid15d0() {}
const int32_t Esrvalid15d0::ID = 0x5D0;
void Esrvalid15d0::Parse(const std::uint8_t* bytes, int32_t length,
DelphiESR* delphi_esr) const {
delphi_esr->mutable_esr_valid1_5d0()->set_can_tx_valid_lr_sn(
can_tx_valid_lr_sn(bytes, length));
delphi_esr->mutable_esr_valid1_5d0()->set_can_tx_valid_lr_range_rate(
can_tx_valid_lr_range_rate(bytes, length));
delphi_esr->mutable_esr_valid1_5d0()->set_can_tx_valid_lr_range(
can_tx_valid_lr_range(bytes, length));
delphi_esr->mutable_esr_valid1_5d0()->set_can_tx_valid_lr_power(
can_tx_valid_lr_power(bytes, length));
delphi_esr->mutable_esr_valid1_5d0()->set_can_tx_valid_lr_angle(
can_tx_valid_lr_angle(bytes, length));
}
// config detail: {'name': 'can_tx_valid_lr_sn', 'offset': 0.0, 'precision':
// 1.0, 'len': 8, 'is_signed_var': False, 'physical_range': '[0|0]', 'bit': 7,
// 'type': 'int', 'order': 'motorola', 'physical_unit': ''}
int Esrvalid15d0::can_tx_valid_lr_sn(const std::uint8_t* bytes,
int32_t length) const {
Byte t0(bytes + 0);
int32_t x = t0.get_byte(0, 8);
int ret = x;
return ret;
}
// config detail: {'name': 'can_tx_valid_lr_range_rate', 'offset': 0.0,
// 'precision': 0.0078125, 'len': 16, 'is_signed_var': True, 'physical_range':
// '[-128|127]', 'bit': 31, 'type': 'double', 'order': 'motorola',
// 'physical_unit': 'm/s'}
double Esrvalid15d0::can_tx_valid_lr_range_rate(const std::uint8_t* bytes,
int32_t length) const {
Byte t0(bytes + 3);
int32_t x = t0.get_byte(0, 8);
Byte t1(bytes + 4);
int32_t t = t1.get_byte(0, 8);
x <<= 8;
x |= t;
x <<= 16;
x >>= 16;
double ret = x * 0.007812;
return ret;
}
// config detail: {'name': 'can_tx_valid_lr_range', 'offset': 0.0, 'precision':
// 0.0078125, 'len': 16, 'is_signed_var': False, 'physical_range': '[0|200]',
// 'bit': 15, 'type': 'double', 'order': 'motorola', 'physical_unit': 'm'}
double Esrvalid15d0::can_tx_valid_lr_range(const std::uint8_t* bytes,
int32_t length) const {
Byte t0(bytes + 1);
int32_t x = t0.get_byte(0, 8);
Byte t1(bytes + 2);
int32_t t = t1.get_byte(0, 8);
x <<= 8;
x |= t;
double ret = x * 0.007812;
return ret;
}
// config detail: {'name': 'can_tx_valid_lr_power', 'offset': 0.0, 'precision':
// 1.0, 'len': 8, 'is_signed_var': True, 'physical_range': '[-10|40]', 'bit':
// 63, 'type': 'int', 'order': 'motorola', 'physical_unit': 'dB'}
int Esrvalid15d0::can_tx_valid_lr_power(const std::uint8_t* bytes,
int32_t length) const {
Byte t0(bytes + 7);
int32_t x = t0.get_byte(0, 8);
x <<= 24;
x >>= 24;
int ret = x;
return ret;
}
// config detail: {'name': 'can_tx_valid_lr_angle', 'offset': 0.0, 'precision':
// 0.0625, 'len': 16, 'is_signed_var': True, 'physical_range': '[-64|63.9375]',
// 'bit': 47, 'type': 'double', 'order': 'motorola', 'physical_unit': 'deg'}
double Esrvalid15d0::can_tx_valid_lr_angle(const std::uint8_t* bytes,
int32_t length) const {
Byte t0(bytes + 5);
int32_t x = t0.get_byte(0, 8);
Byte t1(bytes + 6);
int32_t t = t1.get_byte(0, 8);
x <<= 8;
x |= t;
x <<= 16;
x >>= 16;
double ret = x * 0.062500;
return ret;
}
} // namespace delphi_esr
} // namespace drivers
} // namespace apollo
/******************************************************************************
* Copyright 2017 The Apollo Authors. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*****************************************************************************/
#ifndef MODULES_DRIVERS_DELPHI_ESR_PROTOCOL_ESR_VALID1_5D0_H_
#define MODULES_DRIVERS_DELPHI_ESR_PROTOCOL_ESR_VALID1_5D0_H_
#include "modules/drivers/proto/delphi_esr.pb.h"
#include "modules/drivers/canbus/can_comm/protocol_data.h"
namespace apollo {
namespace drivers {
namespace delphi_esr {
using apollo::drivers::DelphiESR;
class Esrvalid15d0 : public apollo::drivers::canbus::ProtocolData<DelphiESR> {
public:
static const int32_t ID;
Esrvalid15d0();
void Parse(const std::uint8_t* bytes, int32_t length,
DelphiESR* delphi_esr) const override;
private:
// config detail: {'name': 'CAN_TX_VALID_LR_SN', 'offset': 0.0, 'precision':
// 1.0, 'len': 8, 'is_signed_var': False, 'physical_range': '[0|0]', 'bit': 7,
// 'type': 'int', 'order': 'motorola', 'physical_unit': ''}
int can_tx_valid_lr_sn(const std::uint8_t* bytes, const int32_t length) const;
// config detail: {'name': 'CAN_TX_VALID_LR_RANGE_RATE', 'offset': 0.0,
// 'precision': 0.0078125, 'len': 16, 'is_signed_var': True, 'physical_range':
// '[-128|127]', 'bit': 31, 'type': 'double', 'order': 'motorola',
// 'physical_unit': 'm/s'}
double can_tx_valid_lr_range_rate(const std::uint8_t* bytes,
const int32_t length) const;
// config detail: {'name': 'CAN_TX_VALID_LR_RANGE', 'offset': 0.0,
// 'precision': 0.0078125, 'len': 16, 'is_signed_var': False,
// 'physical_range': '[0|200]', 'bit': 15, 'type': 'double', 'order':
// 'motorola', 'physical_unit': 'm'}
double can_tx_valid_lr_range(const std::uint8_t* bytes,
const int32_t length) const;
// config detail: {'name': 'CAN_TX_VALID_LR_POWER', 'offset': 0.0,
// 'precision': 1.0, 'len': 8, 'is_signed_var': True, 'physical_range':
// '[-10|40]', 'bit': 63, 'type': 'int', 'order': 'motorola', 'physical_unit':
// 'dB'}
int can_tx_valid_lr_power(const std::uint8_t* bytes,
const int32_t length) const;
// config detail: {'name': 'CAN_TX_VALID_LR_ANGLE', 'offset': 0.0,
// 'precision': 0.0625, 'len': 16, 'is_signed_var': True, 'physical_range':
// '[-64|63.9375]', 'bit': 47, 'type': 'double', 'order': 'motorola',
// 'physical_unit': 'deg'}
double can_tx_valid_lr_angle(const std::uint8_t* bytes,
const int32_t length) const;
};
} // namespace delphi_esr
} // namespace drivers
} // namespace apollo
#endif // MODULES_CANBUS_VEHICL_ESR_PROTOCOL_ESR_VALID1_5D0_H_
/******************************************************************************
* Copyright 2017 The Apollo Authors. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*****************************************************************************/
#include "modules/drivers/delphi_esr/protocol/esr_valid2_5d1.h"
#include "glog/logging.h"
#include "modules/drivers/canbus/common/byte.h"
#include "modules/drivers/canbus/common/canbus_consts.h"
namespace apollo {
namespace drivers {
namespace delphi_esr {
using apollo::drivers::canbus::Byte;
Esrvalid25d1::Esrvalid25d1() {}
const int32_t Esrvalid25d1::ID = 0x5D1;
void Esrvalid25d1::Parse(const std::uint8_t* bytes, int32_t length,
DelphiESR* delphi_esr) const {
delphi_esr->mutable_esr_valid2_5d1()->set_can_tx_valid_mr_sn(
can_tx_valid_mr_sn(bytes, length));
delphi_esr->mutable_esr_valid2_5d1()->set_can_tx_valid_mr_range_rate(
can_tx_valid_mr_range_rate(bytes, length));
delphi_esr->mutable_esr_valid2_5d1()->set_can_tx_valid_mr_range(
can_tx_valid_mr_range(bytes, length));
delphi_esr->mutable_esr_valid2_5d1()->set_can_tx_valid_mr_power(
can_tx_valid_mr_power(bytes, length));
delphi_esr->mutable_esr_valid2_5d1()->set_can_tx_valid_mr_angle(
can_tx_valid_mr_angle(bytes, length));
}
// config detail: {'name': 'can_tx_valid_mr_sn', 'offset': 0.0, 'precision':
// 1.0, 'len': 8, 'is_signed_var': False, 'physical_range': '[0|0]', 'bit': 7,
// 'type': 'int', 'order': 'motorola', 'physical_unit': ''}
int Esrvalid25d1::can_tx_valid_mr_sn(const std::uint8_t* bytes,
int32_t length) const {
Byte t0(bytes + 0);
int32_t x = t0.get_byte(0, 8);
int ret = x;
return ret;
}
// config detail: {'name': 'can_tx_valid_mr_range_rate', 'offset': 0.0,
// 'precision': 0.0078125, 'len': 16, 'is_signed_var': True, 'physical_range':
// '[-128|127]', 'bit': 31, 'type': 'double', 'order': 'motorola',
// 'physical_unit': 'm/s'}
double Esrvalid25d1::can_tx_valid_mr_range_rate(const std::uint8_t* bytes,
int32_t length) const {
Byte t0(bytes + 3);
int32_t x = t0.get_byte(0, 8);
Byte t1(bytes + 4);
int32_t t = t1.get_byte(0, 8);
x <<= 8;
x |= t;
x <<= 16;
x >>= 16;
double ret = x * 0.007812;
return ret;
}
// config detail: {'name': 'can_tx_valid_mr_range', 'offset': 0.0, 'precision':
// 0.0078125, 'len': 16, 'is_signed_var': False, 'physical_range': '[0|200]',
// 'bit': 15, 'type': 'double', 'order': 'motorola', 'physical_unit': 'm'}
double Esrvalid25d1::can_tx_valid_mr_range(const std::uint8_t* bytes,
int32_t length) const {
Byte t0(bytes + 1);
int32_t x = t0.get_byte(0, 8);
Byte t1(bytes + 2);
int32_t t = t1.get_byte(0, 8);
x <<= 8;
x |= t;
double ret = x * 0.007812;
return ret;
}
// config detail: {'name': 'can_tx_valid_mr_power', 'offset': 0.0, 'precision':
// 1.0, 'len': 8, 'is_signed_var': True, 'physical_range': '[-10|40]', 'bit':
// 63, 'type': 'int', 'order': 'motorola', 'physical_unit': 'dB'}
int Esrvalid25d1::can_tx_valid_mr_power(const std::uint8_t* bytes,
int32_t length) const {
Byte t0(bytes + 7);
int32_t x = t0.get_byte(0, 8);
x <<= 24;
x >>= 24;
int ret = x;
return ret;
}
// config detail: {'name': 'can_tx_valid_mr_angle', 'offset': 0.0, 'precision':
// 0.0625, 'len': 16, 'is_signed_var': True, 'physical_range': '[-64|63.9375]',
// 'bit': 47, 'type': 'double', 'order': 'motorola', 'physical_unit': 'deg'}
double Esrvalid25d1::can_tx_valid_mr_angle(const std::uint8_t* bytes,
int32_t length) const {
Byte t0(bytes + 5);
int32_t x = t0.get_byte(0, 8);
Byte t1(bytes + 6);
int32_t t = t1.get_byte(0, 8);
x <<= 8;
x |= t;
x <<= 16;
x >>= 16;
double ret = x * 0.062500;
return ret;
}
} // namespace delphi_esr
} // namespace drivers
} // namespace apollo
/******************************************************************************
* Copyright 2017 The Apollo Authors. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*****************************************************************************/
#ifndef MODULES_DRIVERS_DELPHI_ESR_PROTOCOL_ESR_VALID2_5D1_H_
#define MODULES_DRIVERS_DELPHI_ESR_PROTOCOL_ESR_VALID2_5D1_H_
#include "modules/drivers/proto/delphi_esr.pb.h"
#include "modules/drivers/canbus/can_comm/protocol_data.h"
namespace apollo {
namespace drivers {
namespace delphi_esr {
using apollo::drivers::DelphiESR;
class Esrvalid25d1 : public apollo::drivers::canbus::ProtocolData<DelphiESR> {
public:
static const int32_t ID;
Esrvalid25d1();
void Parse(const std::uint8_t* bytes, int32_t length,
DelphiESR* delphi_esr) const override;
private:
// config detail: {'name': 'CAN_TX_VALID_MR_SN', 'offset': 0.0, 'precision':
// 1.0, 'len': 8, 'is_signed_var': False, 'physical_range': '[0|0]', 'bit': 7,
// 'type': 'int', 'order': 'motorola', 'physical_unit': ''}
int can_tx_valid_mr_sn(const std::uint8_t* bytes, const int32_t length) const;
// config detail: {'name': 'CAN_TX_VALID_MR_RANGE_RATE', 'offset': 0.0,
// 'precision': 0.0078125, 'len': 16, 'is_signed_var': True, 'physical_range':
// '[-128|127]', 'bit': 31, 'type': 'double', 'order': 'motorola',
// 'physical_unit': 'm/s'}
double can_tx_valid_mr_range_rate(const std::uint8_t* bytes,
const int32_t length) const;
// config detail: {'name': 'CAN_TX_VALID_MR_RANGE', 'offset': 0.0,
// 'precision': 0.0078125, 'len': 16, 'is_signed_var': False,
// 'physical_range': '[0|200]', 'bit': 15, 'type': 'double', 'order':
// 'motorola', 'physical_unit': 'm'}
double can_tx_valid_mr_range(const std::uint8_t* bytes,
const int32_t length) const;
// config detail: {'name': 'CAN_TX_VALID_MR_POWER', 'offset': 0.0,
// 'precision': 1.0, 'len': 8, 'is_signed_var': True, 'physical_range':
// '[-10|40]', 'bit': 63, 'type': 'int', 'order': 'motorola', 'physical_unit':
// 'dB'}
int can_tx_valid_mr_power(const std::uint8_t* bytes,
const int32_t length) const;
// config detail: {'name': 'CAN_TX_VALID_MR_ANGLE', 'offset': 0.0,
// 'precision': 0.0625, 'len': 16, 'is_signed_var': True, 'physical_range':
// '[-64|63.9375]', 'bit': 47, 'type': 'double', 'order': 'motorola',
// 'physical_unit': 'deg'}
double can_tx_valid_mr_angle(const std::uint8_t* bytes,
const int32_t length) const;
};
} // namespace delphi_esr
} // namespace drivers
} // namespace apollo
#endif // MODULES_CANBUS_VEHICL_ESR_PROTOCOL_ESR_VALID2_5D1_H_
/******************************************************************************
* Copyright 2017 The Apollo Authors. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*****************************************************************************/
#ifndef MODULES_DRIVERS_DELPHI_ESR_PROTOCOL_VEHICLE1_4F0_H_
#define MODULES_DRIVERS_DELPHI_ESR_PROTOCOL_VEHICLE1_4F0_H_
#include "modules/drivers/proto/delphi_esr.pb.h"
#include "modules/drivers/canbus/can_comm/protocol_data.h"
namespace apollo {
namespace drivers {
namespace delphi_esr {
using apollo::drivers::DelphiESR;
class Vehicle14f0 : public apollo::drivers::canbus::ProtocolData<DelphiESR> {
public:
static const int32_t ID;
Vehicle14f0();
void Parse(const std::uint8_t* bytes, int32_t length,
DelphiESR* delphi_esr) const override;
private:
// config detail: {'name': 'CAN_RX_STEERING_ANGLE_VALIDITY', 'enum': {0:
// 'CAN_RX_STEERING_ANGLE_VALIDITY_INVALID', 1:
// 'CAN_RX_STEERING_ANGLE_VALIDITY_VALID'}, 'precision': 1.0, 'len': 1,
// 'is_signed_var': False, 'offset': 0.0, 'physical_range': '[0|0]', 'bit':
// 47, 'type': 'enum', 'order': 'motorola', 'physical_unit': ''}
Vehicle1_4f0::Can_rx_steering_angle_validityType
can_rx_steering_angle_validity(const std::uint8_t* bytes,
const int32_t length) const;
// config detail: {'name': 'CAN_RX_STEERING_ANGLE_RATE', 'offset': 0.0,
// 'precision': 1.0, 'len': 11, 'is_signed_var': False, 'physical_range':
// '[0|2047]', 'bit': 50, 'type': 'int', 'order': 'motorola', 'physical_unit':
// 'deg/s'}
int can_rx_steering_angle_rate(const std::uint8_t* bytes,
const int32_t length) const;
// config detail: {'name': 'CAN_RX_STEERING_ANGLE_SIGN', 'enum': {0:
// 'CAN_RX_STEERING_ANGLE_SIGN_COUNTERCLOCKWISE', 1:
// 'CAN_RX_STEERING_ANGLE_SIGN_CLOCKWISE'}, 'precision': 1.0, 'len': 1,
// 'is_signed_var': False, 'offset': 0.0, 'physical_range': '[0|0]', 'bit':
// 46, 'type': 'enum', 'order': 'motorola', 'physical_unit': ''}
Vehicle1_4f0::Can_rx_steering_angle_signType can_rx_steering_angle_sign(
const std::uint8_t* bytes, const int32_t length) const;
// config detail: {'name': 'CAN_RX_STEERING_ANGLE_RATE_SIGN', 'enum': {0:
// 'CAN_RX_STEERING_ANGLE_RATE_SIGN_COUNTERCLOCKWISE', 1:
// 'CAN_RX_STEERING_ANGLE_RATE_SIGN_CLOCKWISE'}, 'precision': 1.0, 'len': 1,
// 'is_signed_var': False, 'offset': 0.0, 'physical_range': '[0|0]', 'bit':
// 30, 'type': 'enum', 'order': 'motorola', 'physical_unit': ''}
Vehicle1_4f0::Can_rx_steering_angle_rate_signType
can_rx_steering_angle_rate_sign(const std::uint8_t* bytes,
const int32_t length) const;
// config detail: {'name': 'CAN_RX_STEERING_ANGLE', 'offset': 0.0,
// 'precision': 1.0, 'len': 11, 'is_signed_var': False, 'physical_range':
// '[0|2047]', 'bit': 45, 'type': 'int', 'order': 'motorola', 'physical_unit':
// 'deg'}
int can_rx_steering_angle(const std::uint8_t* bytes,
const int32_t length) const;
// config detail: {'name': 'CAN_RX_RADIUS_CURVATURE', 'offset': 0.0,
// 'precision': 1.0, 'len': 14, 'is_signed_var': True, 'physical_range':
// '[-8192|8191]', 'bit': 29, 'type': 'int', 'order': 'motorola',
// 'physical_unit': 'm'}
int can_rx_radius_curvature(const std::uint8_t* bytes,
const int32_t length) const;
// config detail: {'name': 'CAN_RX_YAW_RATE_VALIDITY', 'enum': {0:
// 'CAN_RX_YAW_RATE_VALIDITY_INVALID', 1: 'CAN_RX_YAW_RATE_VALIDITY_VALID'},
// 'precision': 1.0, 'len': 1, 'is_signed_var': False, 'offset': 0.0,
// 'physical_range': '[0|0]', 'bit': 31, 'type': 'enum', 'order': 'motorola',
// 'physical_unit': ''}
Vehicle1_4f0::Can_rx_yaw_rate_validityType can_rx_yaw_rate_validity(
const std::uint8_t* bytes, const int32_t length) const;
// config detail: {'name': 'CAN_RX_YAW_RATE', 'offset': 0.0, 'precision':
// 0.0625, 'len': 12, 'is_signed_var': True, 'physical_range':
// '[-128|127.9375]', 'bit': 11, 'type': 'double', 'order': 'motorola',
// 'physical_unit': 'deg/s'}
double can_rx_yaw_rate(const std::uint8_t* bytes, const int32_t length) const;
// config detail: {'name': 'CAN_RX_VEHICLE_SPEED_DIRECTION', 'enum': {0:
// 'CAN_RX_VEHICLE_SPEED_DIRECTION_FORWARD', 1:
// 'CAN_RX_VEHICLE_SPEED_DIRECTION_REVERSE'}, 'precision': 1.0, 'len': 1,
// 'is_signed_var': False, 'offset': 0.0, 'physical_range': '[0|0]', 'bit':
// 12, 'type': 'enum', 'order': 'motorola', 'physical_unit': ''}
Vehicle1_4f0::Can_rx_vehicle_speed_directionType
can_rx_vehicle_speed_direction(const std::uint8_t* bytes,
const int32_t length) const;
// config detail: {'name': 'CAN_RX_VEHICLE_SPEED', 'offset': 0.0, 'precision':
// 0.0625, 'len': 11, 'is_signed_var': False, 'physical_range':
// '[0|127.9375]', 'bit': 7, 'type': 'double', 'order': 'motorola',
// 'physical_unit': 'm/s'}
double can_rx_vehicle_speed(const std::uint8_t* bytes,
const int32_t length) const;
};
} // namespace delphi_esr
} // namespace drivers
} // namespace apollo
#endif // MODULES_CANBUS_VEHICL_ESR_PROTOCOL_VEHICLE1_4F0_H_
/******************************************************************************
* Copyright 2017 The Apollo Authors. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*****************************************************************************/
#ifndef MODULES_DRIVERS_DELPHI_ESR_PROTOCOL_VEHICLE5_5F4_H_
#define MODULES_DRIVERS_DELPHI_ESR_PROTOCOL_VEHICLE5_5F4_H_
#include "modules/drivers/proto/delphi_esr.pb.h"
#include "modules/drivers/canbus/can_comm/protocol_data.h"
namespace apollo {
namespace drivers {
namespace delphi_esr {
using apollo::drivers::DelphiESR;
class Vehicle55f4 : public apollo::drivers::canbus::ProtocolData<DelphiESR> {
public:
static const int32_t ID;
Vehicle55f4();
void Parse(const std::uint8_t* bytes, int32_t length,
DelphiESR* delphi_esr) const override;
private:
// config detail: {'name': 'CAN_RX_YAW_RATE_BIAS_SHIFT', 'enum': {0:
// 'CAN_RX_YAW_RATE_BIAS_SHIFT_NO_DETECT', 1:
// 'CAN_RX_YAW_RATE_BIAS_SHIFT_DETECT'}, 'precision': 1.0, 'len': 1,
// 'is_signed_var': False, 'offset': 0.0, 'physical_range': '[0|0]', 'bit':
// 15, 'type': 'enum', 'order': 'motorola', 'physical_unit': ''}
Vehicle5_5f4::Can_rx_yaw_rate_bias_shiftType can_rx_yaw_rate_bias_shift(
const std::uint8_t* bytes, const int32_t length) const;
// config detail: {'name': 'CAN_RX_STEERING_GEAR_RATIO', 'offset': 0.0,
// 'precision': 0.125, 'len': 8, 'is_signed_var': False, 'physical_range':
// '[0|31.875]', 'bit': 63, 'type': 'double', 'order': 'motorola',
// 'physical_unit': ''}
double can_rx_steering_gear_ratio(const std::uint8_t* bytes,
const int32_t length) const;
// config detail: {'name': 'CAN_RX_WHEELBASE', 'offset': 200.0, 'precision':
// 2.0, 'len': 8, 'is_signed_var': False, 'physical_range': '[200|710]',
// 'bit': 55, 'type': 'double', 'order': 'motorola', 'physical_unit': 'cm'}
double can_rx_wheelbase(const std::uint8_t* bytes,
const int32_t length) const;
// config detail: {'name': 'CAN_RX_DISTANCE_REAR_AXLE', 'offset': 200.0,
// 'precision': 2.0, 'len': 8, 'is_signed_var': False, 'physical_range':
// '[200|710]', 'bit': 47, 'type': 'double', 'order': 'motorola',
// 'physical_unit': 'cm'}
double can_rx_distance_rear_axle(const std::uint8_t* bytes,
const int32_t length) const;
// config detail: {'name': 'CAN_RX_CW_BLOCKAGE_THRESHOLD', 'offset': 0.0,
// 'precision': 0.0078125, 'len': 8, 'is_signed_var': False, 'physical_range':
// '[0|1.9921875]', 'bit': 39, 'type': 'double', 'order': 'motorola',
// 'physical_unit': ''}
double can_rx_cw_blockage_threshold(const std::uint8_t* bytes,
const int32_t length) const;
// config detail: {'name': 'CAN_RX_FUNNEL_OFFSET_RIGHT', 'offset': 0.0,
// 'precision': 0.1, 'len': 8, 'is_signed_var': True, 'physical_range':
// '[-2|10]', 'bit': 31, 'type': 'double', 'order': 'motorola',
// 'physical_unit': 'm'}
double can_rx_funnel_offset_right(const std::uint8_t* bytes,
const int32_t length) const;
// config detail: {'name': 'CAN_RX_FUNNEL_OFFSET_LEFT', 'offset': 0.0,
// 'precision': 0.1, 'len': 8, 'is_signed_var': True, 'physical_range':
// '[-2|10]', 'bit': 23, 'type': 'double', 'order': 'motorola',
// 'physical_unit': 'm'}
double can_rx_funnel_offset_left(const std::uint8_t* bytes,
const int32_t length) const;
// config detail: {'name': 'CAN_RX_BEAMWIDTH_VERT', 'offset': 0.0,
// 'precision': 0.0625, 'len': 7, 'is_signed_var': False, 'physical_range':
// '[0|6]', 'bit': 14, 'type': 'double', 'order': 'motorola', 'physical_unit':
// 'deg'}
double can_rx_beamwidth_vert(const std::uint8_t* bytes,
const int32_t length) const;
// config detail: {'name': 'CAN_RX_OVERSTEER_UNDERSTEER', 'offset': 0.0,
// 'precision': 1.0, 'len': 8, 'is_signed_var': True, 'physical_range':
// '[-128|127]', 'bit': 7, 'type': 'int', 'order': 'motorola',
// 'physical_unit': '%'}
int can_rx_oversteer_understeer(const std::uint8_t* bytes,
const int32_t length) const;
};
} // namespace delphi_esr
} // namespace drivers
} // namespace apollo
#endif // MODULES_CANBUS_VEHICL_ESR_PROTOCOL_VEHICLE5_5F4_H_
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册