Fixes from review

This commit is contained in:
bernatx 2023-04-14 08:49:03 +02:00 committed by bernat
parent 938ee194d8
commit b7a1c8ad6a
4 changed files with 23 additions and 20 deletions

View File

@ -288,7 +288,8 @@ namespace nav {
// check traffic lights only
if (actor.description.id == "traffic.traffic_light") {
// get the TL actor
SharedPtr<carla::client::TrafficLight> tl = boost::static_pointer_cast<carla::client::TrafficLight>(world.GetActor(actor.id));
SharedPtr<carla::client::TrafficLight> tl =
boost::static_pointer_cast<carla::client::TrafficLight>(world.GetActor(actor.id));
// get the waypoints where the TL affects
std::vector<SharedPtr<carla::client::Waypoint>> list = tl->GetStopWaypoints();
for (auto &way : list) {
@ -302,7 +303,9 @@ namespace nav {
// return the trafficlight affecting that position
SharedPtr<carla::client::TrafficLight> WalkerManager::GetTrafficLightAffecting(carla::geom::Location UnrealPos, float max_distance) {
SharedPtr<carla::client::TrafficLight> WalkerManager::GetTrafficLightAffecting(
carla::geom::Location UnrealPos,
float max_distance) {
float min_dist = std::numeric_limits<float>::infinity();
SharedPtr<carla::client::TrafficLight> actor;
for (auto &&item : _traffic_lights) {