예제 #1
0
 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)
예제 #2
0
 def _get_gains(self, payload):
     vals: Tuple = (self._state["position_gain"],
                    self._state["velocity_gain"])
     gen_payload = self.codec.serialize(vals,
                                        *can_endpoints["gains"]["types"])
     self.buffer = create_frame(self.node_id, 0x18, False, gen_payload)
예제 #3
0
 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)
예제 #4
0
 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)
예제 #5
0
 def _get_encoder_estimates(self, payload):
     vals: Tuple = (self._state["position_estimate"],
                    self._state["velocity_estimate"])
     gen_payload = self.codec.serialize(
         vals, *can_endpoints["encoder_estimates"]["types"])
     self.buffer = create_frame(self.node_id, 0x09, False, gen_payload)
예제 #6
0
 def _get_device_info(self, payload):
     vals: Tuple = (0, 0, 7, 1, 25)
     gen_payload = self.codec.serialize(
         vals, *can_endpoints["device_info"]["types"])
     self.buffer = create_frame(self.node_id, 0x1A, False, gen_payload)
예제 #7
0
 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)