Skip to content

Commit

Permalink
Fix non existing Entity issue
Browse files Browse the repository at this point in the history
Fix the `SimulatorCore::DistanceConditionEvaluation::prerequisite` helper function to work not only with `std::string` but also other types convertible to `std::string` like `openscenario_interpreter::EntityRef`

Signed-off-by: Mateusz Palczuk <mateusz.palczuk@robotec.ai>
  • Loading branch information
TauTheLepton committed Feb 13, 2025
1 parent 659c294 commit bf9b99f
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -129,12 +129,12 @@ class SimulatorCore
static auto prerequisite(
const FirstType & from_pose_or_entity_name, const SecondType & to_pose_or_entity_name) -> bool
{
if constexpr (std::is_same_v<FirstType, std::string>) {
if constexpr (std::is_convertible_v<FirstType, std::string>) {
if (!core->isEntityExist(from_pose_or_entity_name)) {
return false;
}
}
if constexpr (std::is_same_v<SecondType, std::string>) {
if constexpr (std::is_convertible_v<SecondType, std::string>) {
if (!core->isEntityExist(to_pose_or_entity_name)) {
return false;
}
Expand Down

0 comments on commit bf9b99f

Please sign in to comment.