def _get_setpoints(self, payload): vals: Tuple = ( self._state["position_setpoint"], self._state["velocity_setpoint"], ) gen_payload = self.codec.serialize(vals, *can_endpoints["setpoints"]["types"]) self.buffer = create_frame(self.node_id, 0x0A, False, gen_payload)
def _get_state(self, payload): if self.legacy_errors: vals: Tuple = ( self._state["error"], self._state["state"], self._state["mode"], 0, 0, 0, 0, 0, ) else: vals: Tuple = ( 0, self._state["state"], self._state["mode"], self._state["error"], 0, 0, 0, 0, ) gen_payload = self.codec.serialize(vals, *can_endpoints["state"]["types"]) self.buffer = create_frame(self.node_id, 0x03, False, gen_payload)
def _get_limits(self, payload): vals: Tuple = (self._state["velocity_limit"], self._state["current_limit"]) gen_payload = self.codec.serialize(vals, *can_endpoints["limits"]["types"]) self.buffer = create_frame(self.node_id, 0x15, False, gen_payload)
def _get_Iq_estimates(self, payload): vals: Tuple = (self._state["current_estimate"], self._state["current_setpoint"]) gen_payload = self.codec.serialize(vals, *can_endpoints["Iq"]["types"]) self.buffer = create_frame(self.node_id, 0x14, False, gen_payload)
def _get_device_info(self, payload): vals: Tuple = (0, 0, 8, 5, 25) gen_payload = self.codec.serialize(vals, *can_endpoints["device_info"]["types"]) self.buffer = create_frame(self.node_id, 0x1A, False, gen_payload)
def _get_vbus(self, payload): vals: Tuple = (self._state["vbus"],) gen_payload = self.codec.serialize(vals, *can_endpoints["Vbus"]["types"]) self.buffer = create_frame(self.node_id, 0x17, False, gen_payload)
def _get_min_studio_version(self, payload): vals: Tuple = (0, 3, 7) gen_payload = self.codec.serialize(vals, *can_endpoints["min_studio_version"]["types"]) self.buffer = create_frame(self.node_id, 0x04, False, gen_payload)