Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
  • eclipse/openpass/openscenario1_engine
  • xiaopan/openscenario1_engine
  • AndreasB/openscenario1_engine
  • kcantero/openscenario1_engine
  • iabed/openscenario1_engine
  • stephenryan/openscenario1_engine
  • nmraghu/openscenario1_engine
  • dweiwg6/openscenario1_engine
  • shankarpatali/openscenario1_engine
  • etiennep/openscenario1_engine
  • fpruefer/openscenario1_engine
  • elnagdy/openscenario1_engine
  • rparisha2/ose
  • naidagoro/openscenario1engine
  • kilyas/openscenario1_engine
  • djantschar/openscenario1_engine
  • anastasiiavolkova/openscenario1_engine
  • ziqi/openscenario1_engine
  • daniilnikulin/openscenario1_engine
  • maxhei/openscenario1_engine
  • ansssardesa/openscenario1_engine
  • mkellerer/openscenario1_engine
22 results
Show changes
...@@ -85,12 +85,12 @@ void ControllerCreator::SetupEntityWithInternalConfigs( ...@@ -85,12 +85,12 @@ void ControllerCreator::SetupEntityWithInternalConfigs(
{ {
// Create internal config with default control strategy (keep lane, keep speed) // Create internal config with default control strategy (keep lane, keep speed)
auto internal_config = std::make_unique<mantle_api::InternalControllerConfig>(); auto internal_config = std::make_unique<mantle_api::InternalControllerConfig>();
internal_config->id = unique_controller_id_;
internal_config->control_strategies.push_back(std::make_unique<mantle_api::KeepVelocityControlStrategy>()); internal_config->control_strategies.push_back(std::make_unique<mantle_api::KeepVelocityControlStrategy>());
internal_config->control_strategies.push_back(std::make_unique<mantle_api::KeepLaneOffsetControlStrategy>()); internal_config->control_strategies.push_back(std::make_unique<mantle_api::KeepLaneOffsetControlStrategy>());
environment_->CreateController(std::move(internal_config)); auto &controller = environment_->GetControllerRepository().Create(*internal_config);
AddEntityToController(scenario_object);
AddEntityToController(scenario_object, controller.GetUniqueId());
} }
void ControllerCreator::SetupEntityWithExternalConfigs( void ControllerCreator::SetupEntityWithExternalConfigs(
...@@ -121,19 +121,18 @@ void ControllerCreator::SetupEntityWithExternalConfigs( ...@@ -121,19 +121,18 @@ void ControllerCreator::SetupEntityWithExternalConfigs(
} }
} }
environment_->CreateController(std::move(external_config)); auto &controller = environment_->GetControllerRepository().Create(*external_config);
AddEntityToController(scenario_object); AddEntityToController(scenario_object, controller.GetUniqueId());
} }
void ControllerCreator::AddEntityToController( void ControllerCreator::AddEntityToController(
std::shared_ptr<NET_ASAM_OPENSCENARIO::v1_1::IScenarioObject> scenario_object) std::shared_ptr<NET_ASAM_OPENSCENARIO::v1_1::IScenarioObject> scenario_object, const mantle_api::UniqueId& id)
{ {
auto entity = environment_->GetEntityRepository().Get(scenario_object->GetName()); auto entity = environment_->GetEntityRepository().Get(scenario_object->GetName());
if (entity.has_value()) if (entity.has_value())
{ {
environment_->AddEntityToController(entity.value(), unique_controller_id_); environment_->AddEntityToController(entity.value(), id);
unique_controller_id_++;
} }
} }
...@@ -147,7 +146,6 @@ std::unique_ptr<mantle_api::ExternalControllerConfig> ControllerCreator::CreateE ...@@ -147,7 +146,6 @@ std::unique_ptr<mantle_api::ExternalControllerConfig> ControllerCreator::CreateE
{ {
// Create generic external config which can be resolved by the environment // Create generic external config which can be resolved by the environment
auto external_config = std::make_unique<mantle_api::ExternalControllerConfig>(); auto external_config = std::make_unique<mantle_api::ExternalControllerConfig>();
external_config->id = unique_controller_id_;
if (controller != nullptr) if (controller != nullptr)
{ {
......
...@@ -31,12 +31,11 @@ class ControllerCreator ...@@ -31,12 +31,11 @@ class ControllerCreator
void SetupEntityWithInternalConfigs(std::shared_ptr<NET_ASAM_OPENSCENARIO::v1_1::IScenarioObject> scenario_object); void SetupEntityWithInternalConfigs(std::shared_ptr<NET_ASAM_OPENSCENARIO::v1_1::IScenarioObject> scenario_object);
void SetupEntityWithExternalConfigs(std::shared_ptr<NET_ASAM_OPENSCENARIO::v1_1::IScenarioObject> scenario_object); void SetupEntityWithExternalConfigs(std::shared_ptr<NET_ASAM_OPENSCENARIO::v1_1::IScenarioObject> scenario_object);
void AddEntityToController(std::shared_ptr<NET_ASAM_OPENSCENARIO::v1_1::IScenarioObject> scenario_object); void AddEntityToController(std::shared_ptr<NET_ASAM_OPENSCENARIO::v1_1::IScenarioObject> scenario_object, const mantle_api::UniqueId& id);
std::unique_ptr<mantle_api::ExternalControllerConfig> CreateExternalControllerConfig( std::unique_ptr<mantle_api::ExternalControllerConfig> CreateExternalControllerConfig(
const std::shared_ptr<NET_ASAM_OPENSCENARIO::v1_1::IController> controller); const std::shared_ptr<NET_ASAM_OPENSCENARIO::v1_1::IController> controller);
std::shared_ptr<mantle_api::IEnvironment> environment_; std::shared_ptr<mantle_api::IEnvironment> environment_;
uint64_t unique_controller_id_{0};
bool is_host_controlled_externally_{false}; bool is_host_controlled_externally_{false};
}; };
......
...@@ -51,6 +51,13 @@ mantle_api::ScenarioInfo OpenScenarioEngine::GetScenarioInfo() const ...@@ -51,6 +51,13 @@ mantle_api::ScenarioInfo OpenScenarioEngine::GetScenarioInfo() const
info.description = scenario_data_ptr_->GetFileHeader()->GetDescription(); info.description = scenario_data_ptr_->GetFileHeader()->GetDescription();
info.scenario_timeout_duration = storyboard_->GetDuration(); info.scenario_timeout_duration = storyboard_->GetDuration();
info.additional_information.emplace("full_scenario_path", ResolveScenarioPath(scenario_file_path_)); info.additional_information.emplace("full_scenario_path", ResolveScenarioPath(scenario_file_path_));
if (scenario_data_ptr_->GetOpenScenarioCategory()->GetScenarioDefinition()->GetCatalogLocations()->GetVehicleCatalog() != nullptr)
{
const auto& vehicle_catalog_path = scenario_data_ptr_->GetOpenScenarioCategory()->GetScenarioDefinition()->GetCatalogLocations()->GetVehicleCatalog()->GetDirectory()->GetPath();
info.additional_information.emplace("vehicle_catalog_path", vehicle_catalog_path);
}
if (scenario_definition_ptr_->GetRoadNetwork()->GetLogicFile() != nullptr) if (scenario_definition_ptr_->GetRoadNetwork()->GetLogicFile() != nullptr)
{ {
info.additional_information.emplace( info.additional_information.emplace(
......