Skip to content

Commit

Permalink
Merge branch 'RJD-1057-remove-functions-forwarded-to-entity-base-refa…
Browse files Browse the repository at this point in the history
…ctor' into ref/RJD-1057-improve-responsibility-simulator-core-api
  • Loading branch information
TauTheLepton authored Feb 12, 2025
2 parents 096f906 + ce817e2 commit b4cb89c
Showing 1 changed file with 6 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,12 @@ class API
auto updateFrame() -> bool;

// entities, ego - spawn
template <typename PoseType, typename ParamsType>
template <
typename PoseType, typename ParamsType,
typename = std::enable_if_t<std::disjunction_v<
std::is_same<std::decay_t<ParamsType>, traffic_simulator_msgs::msg::VehicleParameters>,
std::is_same<std::decay_t<ParamsType>, traffic_simulator_msgs::msg::PedestrianParameters>,
std::is_same<std::decay_t<ParamsType>, traffic_simulator_msgs::msg::MiscObjectParameters>>>>
auto spawn(
const std::string & name, const PoseType & pose, const ParamsType & parameters,
const std::string & behavior = "", const std::string & model3d = "") -> entity::EntityBase &
Expand All @@ -136,8 +141,6 @@ class API
} else if constexpr (std::is_same_v<ParamsType, MiscObjectParameters>) {
return entity_manager_ptr_->spawnEntity<entity::MiscObjectEntity>(
name, pose, parameters, getCurrentTime());
} else {
THROW_SEMANTIC_ERROR("Entity ", std::quoted(name), " has an undefined type.");
}
};

Expand Down

0 comments on commit b4cb89c

Please sign in to comment.