template <typename Thunk = void (*)(), typename Interval = std::chrono::seconds> \
auto waitForAutowareStateToBe_##STATE( \
Thunk && thunk = [] {}, Interval interval = std::chrono::seconds(1)) \
{ \
for (thunk(); not static_cast<const Autoware &>(*this).is_stop_requested.load() and \
static_cast<const Autoware &>(*this).autoware_state != #STATE; \
rclcpp::GenericRate<std::chrono::steady_clock>(interval).sleep()) { \
if ( \
have_never_been_engaged and \
start + initialize_duration <= std::chrono::steady_clock::now()) { \
const auto state = static_cast<const Autoware &>(*this).autoware_state; \
"Simulator waited for the Autoware state to transition to " #STATE \
", but time is up. The current Autoware state is ", \
(state.empty() ? "not published yet" : state)); \
} else { \
thunk(); \
} \
} \
if constexpr (std::string_view(#STATE) == std::string_view("DRIVING")) { \
have_never_been_engaged = false; \
} \
} \
static_assert(true)
auto start(Ts &&... xs) -> pid_t
Definition: record.hpp:40
Autoware encountered some problem that led to a simulation failure.
Definition: exception.hpp:41