Skip to content

Commit

Permalink
added CAN msg for debugging
Browse files Browse the repository at this point in the history
  • Loading branch information
pmoegenburg committed Jul 25, 2024
1 parent d81441b commit 9207cf4
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions include/motor-control/core/tasks/motion_controller_task.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,16 @@ class MotionControllerMessageHandler {
const motor_control_task_messages::RouteMotorDriverInterrupt& m) {
if (m.debounce_count > DIAG0_DEBOUNCE_REPS) {
if (controller.read_tmc_diag0()) {
can_client.send_can_message(
can::ids::NodeId::host,
can::messages::ErrorMessage{
.message_index = m.message_index,
.severity = can::ids::ErrorSeverity::unrecoverable,
.error_code = can::ids::ErrorCode::
motor_driver_error_detected});
driver_client.send_motor_driver_queue(
can::messages::ReadMotorDriverErrorStatusRequest{
.message_index = m.message_index});
controller.stop(
can::ids::ErrorSeverity::unrecoverable,
can::ids::ErrorCode::motor_driver_error_detected);
Expand Down

0 comments on commit 9207cf4

Please sign in to comment.