MCPcopy Create free account
hub / github.com/MarkFzp/act-plus-plus / _update_data

Method _update_data

dynamixel_client.py:552–557  ·  view source on GitHub ↗

Updates the data index for the given motor ID.

(self, index: int, motor_id: int)

Source from the content-addressed store, hash-verified

550 self._cur_data = np.zeros(len(self.motor_ids), dtype=np.float32)
551
552 def _update_data(self, index: int, motor_id: int):
553 """Updates the data index for the given motor ID."""
554 cur = self.operation.getData(motor_id, ADDR_PRESENT_CURRENT,
555 LEN_PRESENT_CURRENT)
556 cur = unsigned_to_signed(cur, size=2)
557 self._cur_data[index] = float(cur) * self.cur_scale
558
559 def _get_data(self):
560 """Returns a copy of the data."""

Callers

nothing calls this directly

Calls 1

unsigned_to_signedFunction · 0.85

Tested by

no test coverage detected