25using ::apollo::drivers::canbus::Byte;
34 static const uint32_t PERIOD = 10 * 1000;
39 set_p_adc_cmd_throttlecommandlimit(data, adc_cmd_throttlecommandlimit_);
40 set_p_adc_cmd_steeringrate(data, adc_cmd_steeringrate_);
41 set_p_adc_cmd_steerwheelanglelimit(data, adc_cmd_steerwheelanglelimit_);
46 adc_cmd_throttlecommandlimit_ = 0.0;
47 adc_cmd_steeringrate_ = 0.0;
48 adc_cmd_steerwheelanglelimit_ = 0.0;
53 double adc_cmd_throttlecommandlimit) {
54 adc_cmd_throttlecommandlimit_ = adc_cmd_throttlecommandlimit;
62void Adcmotioncontrollimits112::set_p_adc_cmd_throttlecommandlimit(
63 uint8_t* data,
double adc_cmd_throttlecommandlimit) {
64 adc_cmd_throttlecommandlimit =
65 ProtocolData::BoundedValue(0.0, 100.0, adc_cmd_throttlecommandlimit);
66 int x =
static_cast<int>(adc_cmd_throttlecommandlimit / 0.500000);
68 Byte to_set(data + 3);
69 to_set.set_value(
static_cast<uint8_t
>(x), 0, 8);
73 double adc_cmd_steeringrate) {
74 adc_cmd_steeringrate_ = adc_cmd_steeringrate;
82void Adcmotioncontrollimits112::set_p_adc_cmd_steeringrate(
83 uint8_t* data,
double adc_cmd_steeringrate) {
84 adc_cmd_steeringrate =
85 ProtocolData::BoundedValue(0.0, 3276.75, adc_cmd_steeringrate);
86 int x =
static_cast<int>(adc_cmd_steeringrate / 0.050000);
89 t =
static_cast<uint8_t
>(x & 0xFF);
90 Byte to_set0(data + 0);
91 to_set0.set_value(t, 0, 8);
94 t =
static_cast<uint8_t
>(x & 0xFF);
95 Byte to_set1(data + 1);
96 to_set1.set_value(t, 0, 8);
99Adcmotioncontrollimits112*
101 double adc_cmd_steerwheelanglelimit) {
102 adc_cmd_steerwheelanglelimit_ = adc_cmd_steerwheelanglelimit;
111void Adcmotioncontrollimits112::set_p_adc_cmd_steerwheelanglelimit(
112 uint8_t* data,
double adc_cmd_steerwheelanglelimit) {
113 adc_cmd_steerwheelanglelimit =
114 ProtocolData::BoundedValue(0.0, 1275.0, adc_cmd_steerwheelanglelimit);
115 int x =
static_cast<int>(adc_cmd_steerwheelanglelimit / 5.000000);
117 Byte to_set(data + 2);
118 to_set.set_value(
static_cast<uint8_t
>(x), 0, 8);
Adcmotioncontrollimits112 * set_adc_cmd_steeringrate(double adc_cmd_steeringrate)
void UpdateData(uint8_t *data) override
Adcmotioncontrollimits112()
Adcmotioncontrollimits112 * set_adc_cmd_throttlecommandlimit(double adc_cmd_throttlecommandlimit)
uint32_t GetPeriod() const override
Adcmotioncontrollimits112 * set_adc_cmd_steerwheelanglelimit(double adc_cmd_steerwheelanglelimit)