Skip to content

Commit

Permalink
Fixes necessary to run Odaiba scenario
Browse files Browse the repository at this point in the history
Signed-off-by: Paweł Lech <[email protected]>
  • Loading branch information
pawellech1 committed Feb 19, 2024
1 parent 5f19d39 commit 4989e12
Show file tree
Hide file tree
Showing 4 changed files with 473 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -342,18 +342,20 @@ auto FieldOperatorApplicationFor<AutowareUniverse>::plan(

auto FieldOperatorApplicationFor<AutowareUniverse>::engage() -> void
{
task_queue.delay([this]() {
waitForAutowareStateToBeDriving([this]() {
auto request = std::make_shared<tier4_external_api_msgs::srv::Engage::Request>();
request->engage = true;
try {
return requestEngage(request);
} catch (const decltype(requestEngage)::TimeoutError &) {
// ignore timeout error because this service is validated by Autoware state transition.
return;
}
if (!isDriving()) {
task_queue.delay([this]() {
waitForAutowareStateToBeDriving([this]() {
auto request = std::make_shared<tier4_external_api_msgs::srv::Engage::Request>();
request->engage = true;
try {
return requestEngage(request);
} catch (const decltype(requestEngage)::TimeoutError &) {
// ignore timeout error because this service is validated by Autoware state transition.
return;
}
});
});
});
}
}

auto FieldOperatorApplicationFor<AutowareUniverse>::engageable() const -> bool
Expand Down
1 change: 1 addition & 0 deletions mock/cpp_mock_scenarios/src/cpp_scenario_node.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ void CppScenarioNode::spawnEgoEntity(
api_.updateFrame();
std::this_thread::sleep_for(std::chrono::duration<double>(1.0 / 20.0));
api_.spawn("ego", spawn_lanelet_pose, parameters, traffic_simulator::VehicleBehavior::autoware());
api_.asFieldOperatorApplication("ego").declare_parameter<bool>("allow_goal_modification", true);
api_.attachLidarSensor("ego", 0.0);

api_.attachDetectionSensor("ego", 200.0, true, 0.0, 0, 0.0, 0.0);
Expand Down
3 changes: 2 additions & 1 deletion mock/cpp_mock_scenarios/src/random_scenario/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ generate_parameter_library(
)

ament_auto_add_executable(random001
random001.cpp
# random001.cpp
random002-odaiba.cpp

Check warning on line 8 in mock/cpp_mock_scenarios/src/random_scenario/CMakeLists.txt

View workflow job for this annotation

GitHub Actions / spell-check

Unknown word (odaiba)

Check warning on line 8 in mock/cpp_mock_scenarios/src/random_scenario/CMakeLists.txt

View workflow job for this annotation

GitHub Actions / spell-check

Unknown word (odaiba)
)
target_link_libraries(random001
cpp_scenario_node
Expand Down
Loading

0 comments on commit 4989e12

Please sign in to comment.