Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions i2rt/motor_drivers/can_interface.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ def __init__(
receive_mode: ReceiveMode = ReceiveMode.p16,
use_buffered_reader: bool = False,
):
self.channel = channel
self.bus = can.interface.Bus(bustype=bustype, channel=channel, bitrate=bitrate)
self.busstate = self.bus.state
self.name = name
Expand Down
4 changes: 4 additions & 0 deletions i2rt/motor_drivers/dm_driver.py
Original file line number Diff line number Diff line change
Expand Up @@ -510,7 +510,11 @@ def _motor_on(self) -> None:
self.running = True

def start_thread(self) -> None:
if self.start_thread_flag:
logging.info("control loop thread already started, skipping")
return
logging.info("starting separate thread for control loop")
self.start_thread_flag = True
thread = threading.Thread(target=self._set_torques_and_update_state)
thread.start()
time.sleep(0.1)
Expand Down
Loading