diff --git a/LibCarla/source/carla/trafficmanager/BatchControlStage.cpp b/LibCarla/source/carla/trafficmanager/BatchControlStage.cpp index 6765cd1c1..cf39560f1 100644 --- a/LibCarla/source/carla/trafficmanager/BatchControlStage.cpp +++ b/LibCarla/source/carla/trafficmanager/BatchControlStage.cpp @@ -27,7 +27,7 @@ namespace traffic_manager { void BatchControlStage::Action() { // Looping over registered actors. - for (uint i = 0u; i < number_of_vehicles; ++i) { + for (uint64_t i = 0u; i < number_of_vehicles; ++i) { cr::VehicleControl vehicle_control; diff --git a/LibCarla/source/carla/trafficmanager/BatchControlStage.h b/LibCarla/source/carla/trafficmanager/BatchControlStage.h index fbd37901f..41bd61bfb 100644 --- a/LibCarla/source/carla/trafficmanager/BatchControlStage.h +++ b/LibCarla/source/carla/trafficmanager/BatchControlStage.h @@ -40,7 +40,7 @@ namespace traffic_manager { /// Array to hold command batch. std::shared_ptr> commands; /// Number of vehicles registered with the traffic manager. - uint number_of_vehicles; + uint64_t number_of_vehicles; public: diff --git a/LibCarla/source/carla/trafficmanager/CollisionStage.cpp b/LibCarla/source/carla/trafficmanager/CollisionStage.cpp index 1b42e729f..04695eb9c 100644 --- a/LibCarla/source/carla/trafficmanager/CollisionStage.cpp +++ b/LibCarla/source/carla/trafficmanager/CollisionStage.cpp @@ -98,7 +98,7 @@ namespace CollisionStageConstants { } // Looping over registered actors. - for (uint i = 0u; i < number_of_vehicles; ++i) { + for (uint64_t i = 0u; i < number_of_vehicles; ++i) { const LocalizationToCollisionData &data = localization_frame->at(i); const Actor ego_actor = data.actor; @@ -165,7 +165,7 @@ namespace CollisionStageConstants { // This map also provides us the additional benefit of being able to // quickly identify // if a vehicle id is registered with the traffic manager or not. - uint index = 0u; + uint64_t index = 0u; for (auto &element: *localization_frame.get()) { vehicle_id_to_index.insert({element.actor->GetId(), index++}); } @@ -301,7 +301,7 @@ namespace CollisionStageConstants { const float length = vehicle->GetBoundingBox().extent.x; SimpleWaypointPtr boundary_start = waypoint_buffer.front(); - uint boundary_start_index = 0u; + uint64_t boundary_start_index = 0u; while (boundary_start->DistanceSquared(vehicle_location) < std::pow(length, 2) && boundary_start_index < waypoint_buffer.size() -1) { boundary_start = waypoint_buffer.at(boundary_start_index); @@ -314,7 +314,7 @@ namespace CollisionStageConstants { // At non-signalized junctions, we extend the boundary across the junction // and in all other situations, boundary length is velocity-dependent. bool reached_distance = false; - for (uint j = boundary_start_index; !reached_distance && (j < waypoint_buffer.size()); ++j) { + for (uint64_t j = boundary_start_index; !reached_distance && (j < waypoint_buffer.size()); ++j) { if (boundary_start->DistanceSquared(current_point) > std::pow(bbox_extension, 2)) { reached_distance = true; @@ -432,7 +432,7 @@ namespace CollisionStageConstants { } void CollisionStage::DrawBoundary(const LocationList &boundary) const { - for (uint i = 0u; i < boundary.size(); ++i) { + for (uint64_t i = 0u; i < boundary.size(); ++i) { debug_helper.DrawLine( boundary[i] + cg::Location(0.0f, 0.0f, 1.0f), boundary[(i + 1) % boundary.size()] + cg::Location(0.0f, 0.0f, 1.0f), diff --git a/LibCarla/source/carla/trafficmanager/CollisionStage.h b/LibCarla/source/carla/trafficmanager/CollisionStage.h index dce515b14..5fbb20709 100644 --- a/LibCarla/source/carla/trafficmanager/CollisionStage.h +++ b/LibCarla/source/carla/trafficmanager/CollisionStage.h @@ -83,9 +83,9 @@ namespace traffic_manager { std::unordered_map unregistered_actors; /// An object used to keep track of time between checking for all world /// actors. - chr::time_point last_world_actors_pass_instance; + chr::time_point last_world_actors_pass_instance; /// Number of vehicles registered with the traffic manager. - uint number_of_vehicles; + uint64_t number_of_vehicles; /// Returns the bounding box corners of the vehicle passed to the method. LocationList GetBoundary(const Actor &actor) const; diff --git a/LibCarla/source/carla/trafficmanager/InMemoryMap.cpp b/LibCarla/source/carla/trafficmanager/InMemoryMap.cpp index 8d8fd91c4..9e7ee17e6 100644 --- a/LibCarla/source/carla/trafficmanager/InMemoryMap.cpp +++ b/LibCarla/source/carla/trafficmanager/InMemoryMap.cpp @@ -13,7 +13,7 @@ namespace MapConstants { // Very important that this is less than 10^-4. static const float ZERO_LENGTH = 0.0001f; static const float INFINITE_DISTANCE = std::numeric_limits::max(); - static const uint LANE_CHANGE_LOOK_AHEAD = 5u; + static const uint64_t LANE_CHANGE_LOOK_AHEAD = 5u; // Cosine of the angle. static const float LANE_CHANGE_ANGULAR_THRESHOLD = 0.5f; static const float GRID_SIZE = 4.0f; @@ -76,7 +76,7 @@ namespace MapConstants { } // Linking segments. - uint i = 0u, j = 0u; + uint64_t i = 0u, j = 0u; for (SimpleWaypointPtr end_point : exit_node_list) { for (SimpleWaypointPtr begin_point : entry_node_list) { if (end_point->DistanceSquared(begin_point) < square(ZERO_LENGTH) and i != j) { @@ -110,7 +110,7 @@ namespace MapConstants { relative_vector = relative_vector.MakeUnitVector(); const float relative_dot = cg::Math::Dot(end_point_vector, relative_vector); if (relative_dot < LANE_CHANGE_ANGULAR_THRESHOLD) { - uint count = LANE_CHANGE_LOOK_AHEAD; + uint64_t count = LANE_CHANGE_LOOK_AHEAD; while (count > 0u) { closest_connection = closest_connection->GetNextWaypoint()[0]; --count; diff --git a/LibCarla/source/carla/trafficmanager/LocalizationStage.cpp b/LibCarla/source/carla/trafficmanager/LocalizationStage.cpp index ff8ce56f4..1f2e53f70 100644 --- a/LibCarla/source/carla/trafficmanager/LocalizationStage.cpp +++ b/LibCarla/source/carla/trafficmanager/LocalizationStage.cpp @@ -70,7 +70,7 @@ namespace LocalizationConstants { traffic_light_frame_selector ? traffic_light_frame_a : traffic_light_frame_b; // Looping over registered actors. - for (uint i = 0u; i < actor_list.size(); ++i) { + for (uint64_t i = 0u; i < actor_list.size(); ++i) { const Actor vehicle = actor_list.at(i); const ActorId actor_id = vehicle->GetId(); @@ -125,7 +125,7 @@ namespace LocalizationConstants { if (change_over_point != nullptr) { auto number_of_pops = waypoint_buffer.size(); - for (uint j = 0u; j < number_of_pops; ++j) { + for (uint64_t j = 0u; j < number_of_pops; ++j) { PopWaypoint(waypoint_buffer, actor_id); } @@ -138,7 +138,7 @@ namespace LocalizationConstants { <= std::pow(horizon_size, 2)) { std::vector next_waypoints = waypoint_buffer.back()->GetNextWaypoint(); - uint selection_index = 0u; + uint64_t selection_index = 0u; // Pseudo-randomized path selection if found more than one choice. if (next_waypoints.size() > 1) { selection_index = static_cast(rand()) % next_waypoints.size(); @@ -151,7 +151,7 @@ namespace LocalizationConstants { const float target_point_distance = std::max(std::ceil(vehicle_velocity * TARGET_WAYPOINT_TIME_HORIZON), TARGET_WAYPOINT_HORIZON_LENGTH); SimpleWaypointPtr target_waypoint = waypoint_buffer.front(); - for (uint j = 0u; + for (uint64_t j = 0u; (j < waypoint_buffer.size()) && (waypoint_buffer.front()->DistanceSquared(target_waypoint) < std::pow(target_point_distance, 2)); @@ -176,8 +176,8 @@ namespace LocalizationConstants { const float look_ahead_distance = std::max(2.0f * vehicle_velocity, MINIMUM_JUNCTION_LOOK_AHEAD); SimpleWaypointPtr look_ahead_point = waypoint_buffer.front(); - uint look_ahead_index = 0u; - for (uint j = 0u; + uint64_t look_ahead_index = 0u; + for (uint64_t j = 0u; (waypoint_buffer.front()->DistanceSquared(look_ahead_point) < std::pow(look_ahead_distance, 2)) && (j < waypoint_buffer.size()); @@ -189,7 +189,7 @@ namespace LocalizationConstants { bool approaching_junction = false; if (waypoint_buffer.front()->CheckJunction() || (look_ahead_point->CheckJunction() && !(waypoint_buffer.front()->CheckJunction()))) { if (speed_limit > HIGHWAY_SPEED) { - for (uint j = 0u; (j < look_ahead_index) && !approaching_junction; ++j) { + for (uint64_t j = 0u; (j < look_ahead_index) && !approaching_junction; ++j) { SimpleWaypointPtr swp = waypoint_buffer.at(j); if (swp->GetNextWaypoint().size() > 1) { approaching_junction = true; @@ -264,7 +264,7 @@ namespace LocalizationConstants { actor_list = registered_actors.GetList(); - uint index = 0u; + uint64_t index = 0u; for (auto &actor: actor_list) { vehicle_id_to_index.insert({actor->GetId(), index}); @@ -339,7 +339,7 @@ namespace LocalizationConstants { void LocalizationStage::DrawBuffer(Buffer &buffer) { - for (uint i = 0u; i < buffer.size() && i < 5; ++i) { + for (uint64_t i = 0u; i < buffer.size() && i < 5; ++i) { debug_helper.DrawPoint(buffer.at(i)->GetLocation(), 0.1f, {255u, 0u, 0u}, 0.5f); } } diff --git a/LibCarla/source/carla/trafficmanager/LocalizationStage.h b/LibCarla/source/carla/trafficmanager/LocalizationStage.h index e51bcda2b..c52127903 100644 --- a/LibCarla/source/carla/trafficmanager/LocalizationStage.h +++ b/LibCarla/source/carla/trafficmanager/LocalizationStage.h @@ -91,7 +91,7 @@ namespace traffic_manager { /// Map connecting actor ids to indices of data arrays. std::unordered_map vehicle_id_to_index; /// Number of vehicles currently registered with the traffic manager. - uint number_of_vehicles; + uint64_t number_of_vehicles; /// Used to only calculate the extended buffer once at junctions std::map approached; /// Final Waypoint of the bounding box at intersections, amps to their respective IDs @@ -99,7 +99,7 @@ namespace traffic_manager { /// Object for tracking paths of the traffic vehicles. TrackTraffic track_traffic; /// Map of all vehicles' idle time - std::unordered_map> idle_time; + std::unordered_map> idle_time; /// A simple method used to draw waypoint buffer ahead of a vehicle. void DrawBuffer(Buffer &buffer); diff --git a/LibCarla/source/carla/trafficmanager/MotionPlannerStage.cpp b/LibCarla/source/carla/trafficmanager/MotionPlannerStage.cpp index 53f717d19..bb7577fd7 100644 --- a/LibCarla/source/carla/trafficmanager/MotionPlannerStage.cpp +++ b/LibCarla/source/carla/trafficmanager/MotionPlannerStage.cpp @@ -63,7 +63,7 @@ namespace PlannerConstants { const auto current_control_frame = frame_selector ? control_frame_a : control_frame_b; // Looping over all vehicles. - for (uint i = 0u; i < number_of_vehicles; ++i) { + for (uint64_t i = 0u; i < number_of_vehicles; ++i) { const LocalizationToPlannerData &localization_data = localization_frame->at(i); const Actor actor = localization_data.actor; diff --git a/LibCarla/source/carla/trafficmanager/MotionPlannerStage.h b/LibCarla/source/carla/trafficmanager/MotionPlannerStage.h index 857f09772..09fbaa029 100644 --- a/LibCarla/source/carla/trafficmanager/MotionPlannerStage.h +++ b/LibCarla/source/carla/trafficmanager/MotionPlannerStage.h @@ -69,7 +69,7 @@ namespace traffic_manager { /// Controller object. PIDController controller; /// Number of vehicles registered with the traffic manager. - uint number_of_vehicles; + uint64_t number_of_vehicles; /// Reference to Carla's debug helper object. cc::DebugHelper &debug_helper; diff --git a/LibCarla/source/carla/trafficmanager/PIDController.h b/LibCarla/source/carla/trafficmanager/PIDController.h index ea2b41cf0..403a180db 100644 --- a/LibCarla/source/carla/trafficmanager/PIDController.h +++ b/LibCarla/source/carla/trafficmanager/PIDController.h @@ -13,7 +13,7 @@ namespace traffic_manager { namespace chr = std::chrono; - using TimeInstance = chr::time_point; + using TimeInstance = chr::time_point; /// Structure to hold the actuation signals. struct ActuationSignal { diff --git a/LibCarla/source/carla/trafficmanager/PerformanceDiagnostics.h b/LibCarla/source/carla/trafficmanager/PerformanceDiagnostics.h index 5a9e8401d..be72185bf 100644 --- a/LibCarla/source/carla/trafficmanager/PerformanceDiagnostics.h +++ b/LibCarla/source/carla/trafficmanager/PerformanceDiagnostics.h @@ -21,11 +21,11 @@ namespace traffic_manager { /// Stage name. std::string stage_name; /// Throughput clock. - chr::time_point throughput_clock; + chr::time_point throughput_clock; /// Throughput counter. - uint throughput_counter; + uint64_t throughput_counter; /// Inter-update clock. - chr::time_point inter_update_clock; + chr::time_point inter_update_clock; /// Inter-update duration. chr::duration inter_update_duration; diff --git a/LibCarla/source/carla/trafficmanager/SimpleWaypoint.cpp b/LibCarla/source/carla/trafficmanager/SimpleWaypoint.cpp index fd770ed7b..8f1f184bb 100644 --- a/LibCarla/source/carla/trafficmanager/SimpleWaypoint.cpp +++ b/LibCarla/source/carla/trafficmanager/SimpleWaypoint.cpp @@ -45,7 +45,7 @@ namespace traffic_manager { return waypoint->GetTransform().rotation.GetForwardVector(); } - uint SimpleWaypoint::SetNextWaypoint(const std::vector &waypoints) { + uint64_t SimpleWaypoint::SetNextWaypoint(const std::vector &waypoints) { for (auto &simple_waypoint: waypoints) { next_waypoints.push_back(simple_waypoint); } diff --git a/LibCarla/source/carla/trafficmanager/SimpleWaypoint.h b/LibCarla/source/carla/trafficmanager/SimpleWaypoint.h index 04b53ca7b..0e891a50f 100644 --- a/LibCarla/source/carla/trafficmanager/SimpleWaypoint.h +++ b/LibCarla/source/carla/trafficmanager/SimpleWaypoint.h @@ -59,7 +59,7 @@ namespace traffic_manager { uint64_t GetId() const; /// This method is used to set the next waypoints. - uint SetNextWaypoint(const std::vector &next_waypoints); + uint64_t SetNextWaypoint(const std::vector &next_waypoints); /// This method is used to set the closest left waypoint for a lane change. void SetLeftWaypoint(SimpleWaypointPtr waypoint); diff --git a/LibCarla/source/carla/trafficmanager/TrafficLightStage.cpp b/LibCarla/source/carla/trafficmanager/TrafficLightStage.cpp index dc4a84d3b..f11711b86 100644 --- a/LibCarla/source/carla/trafficmanager/TrafficLightStage.cpp +++ b/LibCarla/source/carla/trafficmanager/TrafficLightStage.cpp @@ -10,7 +10,7 @@ namespace traffic_manager { - static const uint NO_SIGNAL_PASSTHROUGH_INTERVAL = 5u; + static const uint64_t NO_SIGNAL_PASSTHROUGH_INTERVAL = 5u; TrafficLightStage::TrafficLightStage( std::string stage_name, @@ -45,7 +45,7 @@ namespace traffic_manager { // Selecting the output frame based on the selection key. const auto current_planner_frame = frame_selector ? planner_frame_a : planner_frame_b; // Looping over registered actors. - for (uint i = 0u; i < number_of_vehicles; ++i) { + for (uint64_t i = 0u; i < number_of_vehicles; ++i) { bool traffic_light_hazard = false; const LocalizationToTrafficLightData &data = localization_frame->at(i); diff --git a/LibCarla/source/carla/trafficmanager/TrafficLightStage.h b/LibCarla/source/carla/trafficmanager/TrafficLightStage.h index 0eba334db..956e6c438 100644 --- a/LibCarla/source/carla/trafficmanager/TrafficLightStage.h +++ b/LibCarla/source/carla/trafficmanager/TrafficLightStage.h @@ -35,7 +35,7 @@ namespace traffic_manager { using SimpleWaypointPtr = std::shared_ptr; using TrafficLight = carla::SharedPtr; using TLS = carla::rpc::TrafficLightState; - using TimeInstance = chr::time_point; + using TimeInstance = chr::time_point; /// This class provides the information about the Traffic Lights at the /// junctions. @@ -69,7 +69,7 @@ namespace traffic_manager { /// No signal negotiation mutex. std::mutex no_signal_negotiation_mutex; /// Number of vehicles registered with the traffic manager. - uint number_of_vehicles; + uint64_t number_of_vehicles; void DrawLight(TLS traffic_light_state, const Actor &ego_actor) const; diff --git a/LibCarla/source/carla/trafficmanager/TrafficManager.cpp b/LibCarla/source/carla/trafficmanager/TrafficManager.cpp index 8e3708ee5..e1a801ee0 100644 --- a/LibCarla/source/carla/trafficmanager/TrafficManager.cpp +++ b/LibCarla/source/carla/trafficmanager/TrafficManager.cpp @@ -223,7 +223,7 @@ namespace traffic_manager { if (!(std::find(list_of_ids.begin(), list_of_ids.end(), tl->GetId()) != list_of_ids.end())) { const TLGroup tl_group = boost::static_pointer_cast(tl)->GetGroupTrafficLights(); list_of_all_groups.push_back(tl_group); - for (uint i=0u; iGetId()); if(i!=0u) { tl_to_freeze.push_back(tl_group.at(i));