Skip to content

Commit

Permalink
Code cleaning
Browse files Browse the repository at this point in the history
Signed-off-by: Paweł Lech <[email protected]>
  • Loading branch information
pawellech1 committed Feb 22, 2024
1 parent 9f1c8a3 commit 716726d
Showing 1 changed file with 1 addition and 20 deletions.
21 changes: 1 addition & 20 deletions mock/cpp_mock_scenarios/src/cpp_scenario_node.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -113,33 +113,14 @@ void CppScenarioNode::spawnEgoEntity(
return configuration;
}());
api_.requestAssignRoute("ego", goal_lanelet_poses);

using namespace std::chrono_literals;
// std::atomic<bool> initialized(false);
// auto initialize_thread = std::thread([&]() {
// while (!api_.asFieldOperatorApplication("ego").engaged()) {
// api_.updateFrame();
// std::this_thread::sleep_for(std::chrono::duration<double>(1.0 / 20.0));
// }
// initialized.store(true);
// });
// std::atomic<bool> engaged(false);
// auto engage_thread = std::thread([&]() {
while (!api_.asFieldOperatorApplication("ego").engaged()) {
if (api_.asFieldOperatorApplication("ego").engageable())
api_.asFieldOperatorApplication("ego").engage();
api_.updateFrame();
std::this_thread::sleep_for(std::chrono::duration<double>(1.0 / 20.0));
// std::this_thread::sleep_for(1000ms);
}
// engaged.store(true);
// });
// while (!api_.asFieldOperatorApplication("ego").engaged() &&
// !(initialized.load() && engaged.load())) {
// RCLCPP_INFO_STREAM(get_logger(), "Waiting for Autoware initialization...");
// std::this_thread::sleep_for(std::chrono::duration<double>(1.0 / 20.0));
// }
// initialize_thread.join();
// engage_thread.join();
}

void CppScenarioNode::checkConfiguration(const traffic_simulator::Configuration & configuration)
Expand Down

0 comments on commit 716726d

Please sign in to comment.