Merge branch 'master' into sensor-interface#200
This commit is contained in:
commit
a84debd50f
|
@ -94,13 +94,6 @@ F.A.Q.
|
||||||
If you run into problems, check our
|
If you run into problems, check our
|
||||||
[FAQ](http://carla.readthedocs.io/en/latest/faq/).
|
[FAQ](http://carla.readthedocs.io/en/latest/faq/).
|
||||||
|
|
||||||
Jobs
|
|
||||||
----
|
|
||||||
|
|
||||||
We are currently looking for a new programmer to join our team
|
|
||||||
|
|
||||||
* [C++ (UE4) Programmer](https://drive.google.com/open?id=1Hx0eUgpXl95d4IL9meEGhJECgSRos1T1)
|
|
||||||
|
|
||||||
License
|
License
|
||||||
-------
|
-------
|
||||||
|
|
||||||
|
|
|
@ -16,11 +16,32 @@
|
||||||
#include "Paths.h"
|
#include "Paths.h"
|
||||||
|
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
|
#include <unordered_set>
|
||||||
|
|
||||||
#ifdef CARLA_ROAD_GENERATOR_EXTRA_LOG
|
#ifdef CARLA_ROAD_GENERATOR_EXTRA_LOG
|
||||||
#include <sstream>
|
#include <sstream>
|
||||||
#endif // CARLA_ROAD_GENERATOR_EXTRA_LOG
|
#endif // CARLA_ROAD_GENERATOR_EXTRA_LOG
|
||||||
|
|
||||||
|
// =============================================================================
|
||||||
|
// -- Private types ------------------------------------------------------------
|
||||||
|
// =============================================================================
|
||||||
|
|
||||||
|
class FHalfEdgeCounter {
|
||||||
|
public:
|
||||||
|
|
||||||
|
using HalfEdge = MapGen::DoublyConnectedEdgeList::HalfEdge;
|
||||||
|
|
||||||
|
bool Insert(const HalfEdge &InHalfEdge)
|
||||||
|
{
|
||||||
|
return Set.insert(&InHalfEdge).second &&
|
||||||
|
Set.insert(&MapGen::DoublyConnectedEdgeList::GetPair(InHalfEdge)).second;
|
||||||
|
}
|
||||||
|
|
||||||
|
private:
|
||||||
|
|
||||||
|
std::unordered_set<const HalfEdge *> Set;
|
||||||
|
};
|
||||||
|
|
||||||
// =============================================================================
|
// =============================================================================
|
||||||
// -- Constructor and destructor -----------------------------------------------
|
// -- Constructor and destructor -----------------------------------------------
|
||||||
// =============================================================================
|
// =============================================================================
|
||||||
|
@ -135,8 +156,11 @@ void ACityMapGenerator::GenerateRoads()
|
||||||
|
|
||||||
const uint32 margin = CityMapMeshTag::GetRoadIntersectionSize() / 2u;
|
const uint32 margin = CityMapMeshTag::GetRoadIntersectionSize() / 2u;
|
||||||
|
|
||||||
|
FHalfEdgeCounter HalfEdgeCounter;
|
||||||
|
|
||||||
// For each edge add road segment.
|
// For each edge add road segment.
|
||||||
for (auto &edge : graph.GetHalfEdges()) {
|
for (auto &edge : graph.GetHalfEdges()) {
|
||||||
|
if (HalfEdgeCounter.Insert(edge)) {
|
||||||
auto source = Graph::GetSource(edge).GetPosition();
|
auto source = Graph::GetSource(edge).GetPosition();
|
||||||
auto target = Graph::GetTarget(edge).GetPosition();
|
auto target = Graph::GetTarget(edge).GetPosition();
|
||||||
|
|
||||||
|
@ -166,6 +190,7 @@ void ACityMapGenerator::GenerateRoads()
|
||||||
UE_LOG(LogCarla, Warning, TEXT("Diagonal edge ignored"));
|
UE_LOG(LogCarla, Warning, TEXT("Diagonal edge ignored"));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
#define ADD_INTERSECTION(tag, x, y, angle) \
|
#define ADD_INTERSECTION(tag, x, y, angle) \
|
||||||
AddInstance(tag ##_Lane0, x, y, angle); \
|
AddInstance(tag ##_Lane0, x, y, angle); \
|
||||||
|
|
Loading…
Reference in New Issue