From 525eeda97adfdb95a9f7c8345ca33131af4280c8 Mon Sep 17 00:00:00 2001 From: Takamasa Horibe Date: Thu, 8 Feb 2024 22:19:10 +0900 Subject: [PATCH] fix(control_validator): process died for an empty trajectory Signed-off-by: Takamasa Horibe --- control/control_validator/src/control_validator.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/control/control_validator/src/control_validator.cpp b/control/control_validator/src/control_validator.cpp index ffce38f009a41..03285a284453d 100644 --- a/control/control_validator/src/control_validator.cpp +++ b/control/control_validator/src/control_validator.cpp @@ -121,6 +121,11 @@ bool ControlValidator::isDataReady() void ControlValidator::onReferenceTrajectory(const Trajectory::ConstSharedPtr msg) { + if (msg->points.size() < 2) { + RCLCPP_ERROR(get_logger(), "planning trajectory size is invalid (%lu)", msg->points.size()); + return; + } + current_reference_trajectory_ = msg; return;