25using ::apollo::drivers::canbus::Byte;
34 static const uint32_t PERIOD = 20 * 1000;
39 set_p_driven_torque(data, driven_torque_);
40 set_p_driven_enable_control(data, driven_enable_control_);
46 driven_enable_control_ =
51 driven_torque_ = driven_torque;
58void Torquecontrola3::set_p_driven_torque(uint8_t* data,
double driven_torque) {
59 driven_torque = ProtocolData::BoundedValue(0.0, 100.0, driven_torque);
60 int x =
static_cast<int>(driven_torque / 0.050000);
63 t =
static_cast<uint8_t
>(x & 0xFF);
64 Byte to_set0(data + 1);
65 to_set0.set_value(t, 0, 8);
68 t =
static_cast<uint8_t
>(x & 0xFF);
69 Byte to_set1(data + 2);
70 to_set1.set_value(t, 0, 8);
75 driven_enable_control_ = driven_enable_control;
84void Torquecontrola3::set_p_driven_enable_control(
87 int x = driven_enable_control;
89 Byte to_set(data + 0);
90 to_set.set_value(
static_cast<uint8_t
>(x), 0, 8);
uint32_t GetPeriod() const override
void UpdateData(uint8_t *data) override
Torquecontrola3 * set_driven_torque(double driven_torque)
Torquecontrola3 * set_driven_enable_control(Torque_control_a3::Driven_enable_controlType driven_enable_control)
Driven_enable_controlType
@ DRIVEN_ENABLE_CONTROL_DRIVE_MANUAL