Skip to content

Commit

Permalink
Cleanup ControlModeCommand service callback
Browse files Browse the repository at this point in the history
Signed-off-by: yamacir-kit <[email protected]>
  • Loading branch information
yamacir-kit committed Dec 24, 2024
1 parent 94364ea commit 3fd6cde
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 12 deletions.
27 changes: 16 additions & 11 deletions external/concealer/src/autoware_universe.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -46,17 +46,22 @@ AutowareUniverse::AutowareUniverse(bool simulate_localization)
[this](
const ControlModeCommand::Request::SharedPtr request,
ControlModeCommand::Response::SharedPtr response) {
if (request->mode == ControlModeCommand::Request::AUTONOMOUS) {
current_control_mode.store(ControlModeReport::AUTONOMOUS);
response->success = true;
} else if (request->mode == ControlModeCommand::Request::MANUAL) {
/*
NOTE: MANUAL request will come when a remote override is triggered.
But scenario_simulator_v2 don't support a remote override for now.
*/
response->success = false;
} else {
response->success = false;
switch (request->mode) {
case ControlModeCommand::Request::AUTONOMOUS:
current_control_mode.store(ControlModeReport::AUTONOMOUS);
response->success = true;
break;
case ControlModeCommand::Request::MANUAL:
/*
NOTE: MANUAL request will come when a remote override is
triggered. But scenario_simulator_v2 don't support a remote
override for now.
*/
response->success = false;
break;
default:
response->success = false;
break;
}
})),
localization_update_timer(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ namespace traffic_simulator
{
namespace entity
{
class EgoEntity : public VehicleEntity, public concealer::FieldOperatorApplication
class EgoEntity : public VehicleEntity, private concealer::FieldOperatorApplication
{
bool is_controlled_by_simulator_{false};
std::optional<double> target_speed_;
Expand Down

0 comments on commit 3fd6cde

Please sign in to comment.