Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(autoware_external_cmd_converter): fix check_topic_state #1395

Closed
wants to merge 2 commits into from
Closed
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
9 changes: 7 additions & 2 deletions vehicle/autoware_external_cmd_converter/src/node.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,9 @@ void ExternalCmdConverterNode::check_topic_status(
{
using diagnostic_msgs::msg::DiagnosticStatus;
DiagnosticStatus status;

current_gate_mode_ = gate_mode_sub_.takeData();

if (!check_emergency_stop_topic_timeout()) {
status.level = DiagnosticStatus::ERROR;
status.message = "emergency stop topic is timeout";
Expand All @@ -195,6 +198,10 @@ void ExternalCmdConverterNode::check_topic_status(

bool ExternalCmdConverterNode::check_emergency_stop_topic_timeout()
{
if (current_gate_mode_ && current_gate_mode_->data == tier4_control_msgs::msg::GateMode::AUTO) {
latest_emergency_stop_heartbeat_received_time_ = nullptr;
}

if (!latest_emergency_stop_heartbeat_received_time_) {
return wait_for_first_topic_;
}
Expand All @@ -205,8 +212,6 @@ bool ExternalCmdConverterNode::check_emergency_stop_topic_timeout()

bool ExternalCmdConverterNode::check_remote_topic_rate()
{
current_gate_mode_ = gate_mode_sub_.takeData();

if (!current_gate_mode_) {
return true;
}
Expand Down
Loading