Skip to content

Commit 8fbaf16

Browse files
shtokudapre-commit-ci[bot]shmpwk
committedJul 11, 2024
fix(autoware_external_cmd_converter): fix check_topic_state (autowarefoundation#7921)
* fix(autoware_external_cmd_converter): fix check_topic_state Signed-off-by: shtokuda <shumpei.tokuda@tier4.jp> * style(pre-commit): autofix * Update vehicle/autoware_external_cmd_converter/src/node.cpp Co-authored-by: Shumpei Wakabayashi <42209144+shmpwk@users.noreply.github.com> * style(pre-commit): autofix --------- Signed-off-by: shtokuda <shumpei.tokuda@tier4.jp> Co-authored-by: shtokuda <shumpei.tokuda@tier4.jp> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Shumpei Wakabayashi <42209144+shmpwk@users.noreply.github.com>
1 parent 65e1d20 commit 8fbaf16

File tree

1 file changed

+11
-2
lines changed
  • vehicle/autoware_external_cmd_converter/src

1 file changed

+11
-2
lines changed
 

‎vehicle/autoware_external_cmd_converter/src/node.cpp

+11-2
Original file line numberDiff line numberDiff line change
@@ -179,6 +179,9 @@ void ExternalCmdConverterNode::check_topic_status(
179179
{
180180
using diagnostic_msgs::msg::DiagnosticStatus;
181181
DiagnosticStatus status;
182+
183+
current_gate_mode_ = gate_mode_sub_.takeData();
184+
182185
if (!check_emergency_stop_topic_timeout()) {
183186
status.level = DiagnosticStatus::ERROR;
184187
status.message = "emergency stop topic is timeout";
@@ -195,6 +198,14 @@ void ExternalCmdConverterNode::check_topic_status(
195198

196199
bool ExternalCmdConverterNode::check_emergency_stop_topic_timeout()
197200
{
201+
if (!current_gate_mode_) {
202+
return true;
203+
}
204+
205+
if (current_gate_mode_->data == tier4_control_msgs::msg::GateMode::AUTO) {
206+
latest_emergency_stop_heartbeat_received_time_ = nullptr;
207+
}
208+
198209
if (!latest_emergency_stop_heartbeat_received_time_) {
199210
return wait_for_first_topic_;
200211
}
@@ -205,8 +216,6 @@ bool ExternalCmdConverterNode::check_emergency_stop_topic_timeout()
205216

206217
bool ExternalCmdConverterNode::check_remote_topic_rate()
207218
{
208-
current_gate_mode_ = gate_mode_sub_.takeData();
209-
210219
if (!current_gate_mode_) {
211220
return true;
212221
}

0 commit comments

Comments
 (0)
Please sign in to comment.