Skip to content

Commit

Permalink
Added main/actuator board overheat protection.
Browse files Browse the repository at this point in the history
  • Loading branch information
tunefs committed Jan 25, 2022
1 parent 293f61c commit 8ceb876
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions lexxpluss_apps/src/can_controller.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -300,12 +300,18 @@ class can_controller_impl {
}
}
void send_message() const {
bool main_overheat{board2ros.main_board_temp > 75.0f};
bool actuator_overheat{false};
for (const auto &i: board2ros.actuator_board_temp) {
if (i > 75.0f)
actuator_overheat = true;
}
zcan_frame frame{
.id{0x201},
.rtr{CAN_DATAFRAME},
.id_type{CAN_STANDARD_IDENTIFIER},
.dlc{3},
.data{ros2board.emergency_stop, ros2board.power_off, false}
.dlc{5},
.data{ros2board.emergency_stop, ros2board.power_off, false, main_overheat, actuator_overheat}
// .data{ros2board.emergency_stop, ros2board.power_off, heartbeat_timeout}
};
can_send(dev, &frame, K_MSEC(100), nullptr, nullptr);
Expand Down

0 comments on commit 8ceb876

Please sign in to comment.