Namespaces fix

This commit is contained in:
Jacopo Bartiromo 2019-12-13 04:56:04 +01:00 committed by bernat
parent 09b9821fdc
commit 6f3c4e261c
36 changed files with 84 additions and 18 deletions

View File

@ -13,6 +13,7 @@
#include "carla/client/Actor.h"
#include "carla/Memory.h"
namespace carla {
namespace traffic_manager {
namespace cc = carla::client;
@ -80,3 +81,4 @@ namespace traffic_manager {
};
} // namespace traffic_manager
} // namespace carla

View File

@ -9,6 +9,7 @@
#include <mutex>
#include <unordered_map>
namespace carla {
namespace traffic_manager {
template <typename Key, typename Value>
@ -50,3 +51,4 @@ namespace traffic_manager {
};
} // namespace traffic_manager
} // namespace carla

View File

@ -6,6 +6,7 @@
#include "BatchControlStage.h"
namespace carla {
namespace traffic_manager {
BatchControlStage::BatchControlStage(
@ -69,3 +70,4 @@ namespace traffic_manager {
}
} // namespace traffic_manager
} // namespace carla

View File

@ -17,6 +17,7 @@
#include "carla/trafficmanager/MessengerAndDataTypes.h"
#include "carla/trafficmanager/PipelineStage.h"
namespace carla {
namespace traffic_manager {
namespace cc = carla::client;
@ -59,3 +60,4 @@ namespace traffic_manager {
};
} // namespace traffic_manager
} // namespace carla

View File

@ -6,6 +6,7 @@
#include "CarlaDataAccessLayer.h"
namespace carla {
namespace traffic_manager {
CarlaDataAccessLayer::CarlaDataAccessLayer(carla::SharedPtr<cc::Map> _world_map) {
@ -17,3 +18,4 @@ namespace traffic_manager {
return world_map->GetTopology();
}
} // namespace traffic_manager
} // namespace carla

View File

@ -12,6 +12,7 @@
#include "carla/client/Waypoint.h"
#include "carla/Memory.h"
namespace carla {
namespace traffic_manager {
namespace cc = carla::client;
@ -35,3 +36,4 @@ namespace traffic_manager {
};
} // namespace traffic_manager
} // namespace carla

View File

@ -6,6 +6,7 @@
#include "CollisionStage.h"
namespace carla {
namespace traffic_manager {
namespace CollisionStageConstants {
@ -441,3 +442,4 @@ namespace CollisionStageConstants {
}
} // namespace traffic_manager
} // namespace carla

View File

@ -34,6 +34,7 @@
#include "carla/trafficmanager/PipelineStage.h"
#include "carla/trafficmanager/VicinityGrid.h"
namespace carla {
namespace traffic_manager {
namespace cc = carla::client;
@ -131,3 +132,4 @@ namespace traffic_manager {
};
} // namespace traffic_manager
} // namespace carla

View File

@ -6,6 +6,7 @@
#include "InMemoryMap.h"
namespace carla {
namespace traffic_manager {
namespace MapConstants {
@ -255,3 +256,4 @@ namespace MapConstants {
}
} // namespace traffic_manager
} // namespace carla

View File

@ -21,6 +21,7 @@
#include "carla/trafficmanager/SimpleWaypoint.h"
namespace carla {
namespace traffic_manager {
namespace cg = carla::geom;
@ -78,3 +79,4 @@ namespace traffic_manager {
};
} // namespace traffic_manager
} // namespace carla

View File

@ -6,6 +6,7 @@
#include "LocalizationStage.h"
namespace carla {
namespace traffic_manager {
namespace LocalizationConstants {
@ -519,3 +520,4 @@ namespace LocalizationConstants {
}
} // namespace traffic_manager
} // namespace carla

View File

@ -32,6 +32,7 @@
#include "carla/trafficmanager/PipelineStage.h"
#include "carla/trafficmanager/SimpleWaypoint.h"
namespace carla {
namespace traffic_manager {
using namespace std::chrono;
@ -133,3 +134,4 @@ namespace traffic_manager {
};
} // namespace traffic_manager
} // namespace carla

View File

@ -6,6 +6,7 @@
#include "carla/trafficmanager/LocalizationUtils.h"
namespace carla {
namespace traffic_manager {
float DeviationCrossProduct(Actor actor, const cg::Location &target_location) {
@ -124,3 +125,4 @@ namespace traffic_manager {
}
} // namespace traffic_manager
} // namespace carla

View File

@ -13,6 +13,7 @@
#include "carla/trafficmanager/SimpleWaypoint.h"
namespace carla {
namespace traffic_manager {
namespace cc = carla::client;
@ -58,3 +59,4 @@ namespace traffic_manager {
float DeviationDotProduct(Actor actor, const cg::Location &target_location, bool rear_offset=false);
} // namespace traffic_manager
} // namespace carla

View File

@ -11,6 +11,7 @@
#include <condition_variable>
#include <mutex>
namespace carla {
namespace traffic_manager {
using namespace std::chrono_literals;
@ -104,3 +105,4 @@ namespace traffic_manager {
};
} // namespace traffic_manager
} // namespace carla

View File

@ -16,6 +16,7 @@
#include "carla/trafficmanager/Messenger.h"
#include "carla/trafficmanager/SimpleWaypoint.h"
namespace carla {
namespace traffic_manager {
namespace cc = carla::client;
@ -90,3 +91,4 @@ namespace traffic_manager {
using TrafficLightToPlannerMessenger = Messenger<std::shared_ptr<TrafficLightToPlannerFrame>>;
} // namespace traffic_manager
} // namespace carla

View File

@ -6,6 +6,7 @@
#include "MotionPlannerStage.h"
namespace carla {
namespace traffic_manager {
namespace PlannerConstants {
@ -190,3 +191,4 @@ namespace PlannerConstants {
}
} // namespace traffic_manager
} // namespace carla

View File

@ -18,6 +18,7 @@
#include "carla/trafficmanager/PIDController.h"
#include "carla/trafficmanager/PipelineStage.h"
namespace carla {
namespace traffic_manager {
namespace chr = std::chrono;
@ -102,3 +103,4 @@ namespace traffic_manager {
};
} // namespace traffic_manager
} // namespace carla

View File

@ -7,6 +7,7 @@
#include "PIDController.h"
#include <algorithm>
namespace carla {
namespace traffic_manager {
namespace PIDControllerConstants {
@ -91,3 +92,4 @@ namespace PIDControllerConstants {
}
} // namespace traffic_manager
} // namespace carla

View File

@ -10,6 +10,7 @@
#include <cmath>
#include <vector>
namespace carla {
namespace traffic_manager {
namespace chr = std::chrono;
@ -64,3 +65,4 @@ namespace traffic_manager {
};
} // namespace traffic_manager
} // namespace carla

View File

@ -8,6 +8,7 @@
#include "Parameters.h"
namespace carla {
namespace traffic_manager {
Parameters::Parameters() {}
@ -179,3 +180,4 @@ float Parameters::GetPercentageIgnoreActors(const ActorPtr &actor) {
}
} // namespace traffic_manager
} // namespace carla

View File

@ -14,6 +14,7 @@
#include "carla/trafficmanager/AtomicActorSet.h"
#include "carla/trafficmanager/AtomicMap.h"
namespace carla {
namespace traffic_manager {
namespace cc = carla::client;
@ -104,3 +105,4 @@ namespace traffic_manager {
};
} // namespace traffic_manager
} // namespace carla

View File

@ -6,6 +6,7 @@
#include "carla/trafficmanager/PerformanceDiagnostics.h"
namespace carla {
namespace traffic_manager {
PerformanceDiagnostics::PerformanceDiagnostics(std::string stage_name)
@ -37,3 +38,4 @@ namespace traffic_manager {
}
} // namespace traffic_manager
} // namespace carla

View File

@ -11,6 +11,7 @@
#include "carla/Logging.h"
namespace carla {
namespace traffic_manager {
namespace chr = std::chrono;
@ -36,3 +37,4 @@ namespace traffic_manager {
};
} // namespace traffic_manager
} // namespace carla

View File

@ -6,6 +6,7 @@
#include "PipelineStage.h"
namespace carla {
namespace traffic_manager {
PipelineStage::PipelineStage(std::string stage_name)
@ -106,3 +107,4 @@ namespace traffic_manager {
}
} // namespace traffic_manager
} // namespace carla

View File

@ -22,6 +22,7 @@
#include "carla/trafficmanager/Messenger.h"
#include "carla/trafficmanager/PerformanceDiagnostics.h"
namespace carla {
namespace traffic_manager {
namespace chr = std::chrono;
@ -91,3 +92,4 @@ namespace traffic_manager {
};
} // namespace traffic_manager
} // namespace carla

View File

@ -6,6 +6,7 @@
#include "SimpleWaypoint.h"
namespace carla {
namespace traffic_manager {
using SimpleWaypointPtr = std::shared_ptr<SimpleWaypoint>;
@ -99,3 +100,4 @@ namespace traffic_manager {
}
} // namespace traffic_manager
} // namespace carla

View File

@ -15,6 +15,7 @@
#include "carla/geom/Vector3D.h"
#include "carla/Memory.h"
namespace carla {
namespace traffic_manager {
namespace cc = carla::client;
@ -95,3 +96,4 @@ namespace traffic_manager {
};
} // namespace traffic_manager
} // namespace carla

View File

@ -8,6 +8,7 @@
#include "TrafficLightStage.h"
namespace carla {
namespace traffic_manager {
static const uint64_t NO_SIGNAL_PASSTHROUGH_INTERVAL = 5u;
@ -206,3 +207,4 @@ namespace traffic_manager {
}
} // namespace traffic_manager
} // namespace carla

View File

@ -23,6 +23,7 @@
#include "carla/trafficmanager/PipelineStage.h"
namespace carla {
namespace traffic_manager {
namespace chr = std::chrono;
@ -93,3 +94,4 @@ namespace traffic_manager {
};
} // namespace traffic_manager
} // namespace carla

View File

@ -8,6 +8,7 @@
#include "carla/client/TrafficLight.h"
namespace carla {
namespace traffic_manager {
TrafficManager::TrafficManager(
@ -248,3 +249,4 @@ namespace traffic_manager {
}
} // namespace traffic_manager
} // namespace carla

View File

@ -31,6 +31,7 @@
#include "carla/trafficmanager/Parameters.h"
#include "carla/trafficmanager/TrafficLightStage.h"
namespace carla {
namespace traffic_manager {
namespace cc = carla::client;
@ -153,3 +154,4 @@ namespace traffic_manager {
};
} // namespace traffic_manager
} // namespace carla

View File

@ -6,6 +6,7 @@
#include "VicinityGrid.h"
namespace carla {
namespace traffic_manager {
static const float GRID_SIZE = 10.0f;
@ -93,3 +94,4 @@ namespace traffic_manager {
}
} // namespace traffic_manager
} // namespace carla

View File

@ -20,6 +20,7 @@
#include "carla/trafficmanager/SimpleWaypoint.h"
namespace carla {
namespace traffic_manager {
namespace cc = carla::client;
@ -63,3 +64,4 @@ namespace traffic_manager {
};
} // namespace traffic_manager
} // namespace carla

View File

@ -22,20 +22,20 @@ void export_trafficmanager() {
class_<Parameters>("TM_Parameters").def(vector_indexing_suite<Parameters>());
class_<traffic_manager::TrafficManager, boost::noncopyable>("TrafficManager", no_init)
.def("register_vehicles", &traffic_manager::TrafficManager::RegisterVehicles)
.def("unregister_vehicles", &traffic_manager::TrafficManager::UnregisterVehicles)
.def("set_vehicle_max_speed_difference", &traffic_manager::TrafficManager::SetPercentageSpeedDifference)
.def("set_global_max_speed_difference", &traffic_manager::TrafficManager::SetGlobalPercentageSpeedDifference)
.def("set_collision_detection", &traffic_manager::TrafficManager::SetCollisionDetection)
.def("force_lane_change", &traffic_manager::TrafficManager::SetForceLaneChange)
.def("set_auto_lane_change", &traffic_manager::TrafficManager::SetAutoLaneChange)
.def("set_distance_to_leading_vehicle", &traffic_manager::TrafficManager::SetDistanceToLeadingVehicle)
.def("reset_traffic_lights", &traffic_manager::TrafficManager::ResetAllTrafficLights)
.def("destroy_vehicle", &traffic_manager::TrafficManager::DestroyVehicle)
.def("ignore_actors_percentage", &traffic_manager::TrafficManager::SetPercentageIgnoreActors)
.def("ignore_lights_percentage", &traffic_manager::TrafficManager::SetPercentageRunningLight);
class_<carla::traffic_manager::TrafficManager, boost::noncopyable>("TrafficManager", no_init)
.def("register_vehicles", &carla::traffic_manager::TrafficManager::RegisterVehicles)
.def("unregister_vehicles", &carla::traffic_manager::TrafficManager::UnregisterVehicles)
.def("set_vehicle_max_speed_difference", &carla::traffic_manager::TrafficManager::SetPercentageSpeedDifference)
.def("set_global_max_speed_difference", &carla::traffic_manager::TrafficManager::SetGlobalPercentageSpeedDifference)
.def("set_collision_detection", &carla::traffic_manager::TrafficManager::SetCollisionDetection)
.def("force_lane_change", &carla::traffic_manager::TrafficManager::SetForceLaneChange)
.def("set_auto_lane_change", &carla::traffic_manager::TrafficManager::SetAutoLaneChange)
.def("set_distance_to_leading_vehicle", &carla::traffic_manager::TrafficManager::SetDistanceToLeadingVehicle)
.def("reset_traffic_lights", &carla::traffic_manager::TrafficManager::ResetAllTrafficLights)
.def("destroy_vehicle", &carla::traffic_manager::TrafficManager::DestroyVehicle)
.def("ignore_actors_percentage", &carla::traffic_manager::TrafficManager::SetPercentageIgnoreActors)
.def("ignore_lights_percentage", &carla::traffic_manager::TrafficManager::SetPercentageRunningLight);
def("GetTrafficManager", &traffic_manager::TrafficManager::GetInstance, return_value_policy<reference_existing_object>());
def("GetTrafficManager", &carla::traffic_manager::TrafficManager::GetInstance, return_value_policy<reference_existing_object>());
}

View File

@ -176,10 +176,8 @@ def main():
traffic_manager = carla.GetTrafficManager(client)
time.sleep(1)
vehicle_vec = carla.TM_ActorList()
vehicle_vec.extend(vehicles_list)
traffic_manager.register_vehicles(vehicle_vec)
for v in vehicles_list:
v.set_autopilot(True)
while True:
time.sleep(1)