Fixed style

This commit is contained in:
Marc Garcia Puig 2020-02-07 12:44:21 +01:00
parent 3e6089a192
commit 744a2d47e0
8 changed files with 97 additions and 79 deletions

View File

@ -4,6 +4,7 @@
* Vehicles get destroyed when they are stuck in Traffic Manager
* Implemented intersection anticipation algorithm in Traffic Manager
* Added support for new geometry: `spiral`, `poly3`, and `paramPoly3`
* Improved `get_waypoint(location)` performance
* New weather system: night time, fog, rain ripples, and now wind affects vegetation and rain (not car physics)
* Fixed Low/Epic quality settings transition
* Enabled Mesh distance fields

View File

@ -198,11 +198,11 @@ file(GLOB libcarla_cephes_sources
set(libcarla_sources "${libcarla_sources};${libcarla_cephes_sources}")
install(FILES ${libcarla_cephes_sources} DESTINATION include/cephes)
file(GLOB libcarla_odrSpiral_sources
file(GLOB libcarla_odr_spiral_sources
"${libcarla_source_thirdparty_path}/odrSpiral/*.cpp"
"${libcarla_source_thirdparty_path}/odrSpiral/*.h")
set(libcarla_sources "${libcarla_sources};${libcarla_odrSpiral_sources}")
install(FILES ${libcarla_odrSpiral_sources} DESTINATION include/odrSpiral)
set(libcarla_sources "${libcarla_sources};${libcarla_odr_spiral_sources}")
install(FILES ${libcarla_odr_spiral_sources} DESTINATION include/odrSpiral)
file(GLOB libcarla_moodycamel_sources
"${libcarla_source_thirdparty_path}/moodycamel/*.h")

View File

@ -94,8 +94,8 @@ namespace geom {
const value_type &b,
const value_type &c,
const value_type &d) {
_v = {{a, b, c, d}};
_s = (0.0);
_v = {a, b, c, d};
_s = 0.0;
}
// =========================================================================

View File

@ -79,6 +79,7 @@ namespace geom {
return std::sqrt(DistanceSquared2D(a, b));
}
/// Returns the angle between 2 vectors in radians
static double GetVectorAngle(const Vector3D &a, const Vector3D &b);
/// Returns a pair containing:

View File

@ -1,4 +1,4 @@
// Copyright (c) 2017 Computer Vision Center (CVC) at the Universitat Autonoma
// Copyright (c) 2020 Computer Vision Center (CVC) at the Universitat Autonoma
// de Barcelona (UAB).
//
// This work is licensed under the terms of the MIT license.
@ -15,9 +15,9 @@
namespace carla {
namespace geom {
// Rtree class working with 3D point clouds.
// Asociates a T element with a 3D point
// Useful to perform fast k-NN searches
/// Rtree class working with 3D point clouds.
/// Asociates a T element with a 3D point
/// Useful to perform fast k-NN searches
template <typename T, size_t Dimension = 3>
class PointCloudRtree {
public:
@ -36,11 +36,12 @@ namespace geom {
void InsertElements(const std::vector<TreeElement> &elements) {
_rtree.insert(elements.begin(), elements.end());
}
// Return nearest neighbors with a user defined filter.
// The filter reveices as an argument a TreeElement value and needs to
// return a bool to accept or reject the value
// [&](Rtree::TreeElement const &element){if (IsOk(element)) return true;
// else return false;}
/// Return nearest neighbors with a user defined filter.
/// The filter reveices as an argument a TreeElement value and needs to
/// return a bool to accept or reject the value
/// [&](Rtree::TreeElement const &element){if (IsOk(element)) return true;
/// else return false;}
template <typename Filter>
std::vector<TreeElement> GetNearestNeighboursWithFilter(const BPoint &point, Filter filter,
size_t number_neighbours = 1) const {
@ -50,12 +51,14 @@ namespace geom {
std::back_inserter(query_result));
return query_result;
}
std::vector<TreeElement> GetNearestNeighbours(const BPoint &point, size_t number_neighbours = 1) const {
std::vector<TreeElement> query_result;
_rtree.query(boost::geometry::index::nearest(point, static_cast<unsigned int>(number_neighbours)),
std::back_inserter(query_result));
return query_result;
}
size_t GetTreeSize() const {
return _rtree.size();
}
@ -66,9 +69,9 @@ namespace geom {
};
// Rtree class working with 3D segment clouds.
// Stores a pair of T elements (one for each end of the segment)
// Useful to perform fast k-NN searches.
/// Rtree class working with 3D segment clouds.
/// Stores a pair of T elements (one for each end of the segment)
/// Useful to perform fast k-NN searches.
template <typename T, size_t Dimension = 3>
class SegmentCloudRtree {
public:
@ -80,6 +83,7 @@ namespace geom {
void InsertElement(const BSegment &segment, const T &element_start, const T &element_end) {
_rtree.insert(std::make_pair(segment, std::make_pair(element_start, element_end)));
}
void InsertElement(const TreeElement &element) {
_rtree.insert(element);
}
@ -87,24 +91,29 @@ namespace geom {
void InsertElements(const std::vector<TreeElement> &elements) {
_rtree.insert(elements.begin(), elements.end());
}
// Return nearest neighbors with a user defined filter.
// The filter reveices as an argument a TreeElement value and needs to
// return a bool to accept or reject the value
// [&](Rtree::TreeElement const &element){if (IsOk(element)) return true;
// else return false;}
/// Return nearest neighbors with a user defined filter.
/// The filter reveices as an argument a TreeElement value and needs to
/// return a bool to accept or reject the value
/// [&](Rtree::TreeElement const &element){if (IsOk(element)) return true;
/// else return false;}
template <typename Filter>
std::vector<TreeElement> GetNearestNeighboursWithFilter(const BPoint &point, Filter filter,
std::vector<TreeElement> GetNearestNeighboursWithFilter(
const BPoint &point,
Filter filter,
size_t number_neighbours = 1) const {
std::vector<TreeElement> query_result;
_rtree.query(boost::geometry::index::nearest(point,
static_cast<unsigned int>(number_neighbours)) && boost::geometry::index::satisfies(filter),
_rtree.query(
boost::geometry::index::nearest(point, static_cast<unsigned int>(number_neighbours)) &&
boost::geometry::index::satisfies(filter),
std::back_inserter(query_result));
return query_result;
}
std::vector<TreeElement> GetNearestNeighbours(const BPoint &point, size_t number_neighbours = 1) const {
std::vector<TreeElement> query_result;
_rtree.query(boost::geometry::index::nearest(point,
static_cast<unsigned int>(number_neighbours)),
_rtree.query(
boost::geometry::index::nearest(point, static_cast<unsigned int>(number_neighbours)),
std::back_inserter(query_result));
return query_result;
}

View File

@ -140,12 +140,19 @@ private:
Rtree _rtree;
void CreateRtree();
//Helper Functions for constructing the rtree element list
void AddElementToRtree(std::vector<Rtree::TreeElement> &rtree_elements,
geom::Transform &current_transform, geom::Transform &next_transform,
Waypoint &current_waypoint, Waypoint &next_waypoint);
void AddElementToRtreeAndUpdateTransforms(std::vector<Rtree::TreeElement> &rtree_elements,
geom::Transform &current_transform, Waypoint &current_waypoint,
/// Helper Functions for constructing the rtree element list
void AddElementToRtree(
std::vector<Rtree::TreeElement> &rtree_elements,
geom::Transform &current_transform,
geom::Transform &next_transform,
Waypoint &current_waypoint,
Waypoint &next_waypoint);
void AddElementToRtreeAndUpdateTransforms(
std::vector<Rtree::TreeElement> &rtree_elements,
geom::Transform &current_transform,
Waypoint &current_waypoint,
Waypoint &next_waypoint);
};

View File

@ -91,8 +91,8 @@ else
mkdir -p ${BOOST_BASENAME}-install/include
mv ${BOOST_PACKAGE_BASENAME} ${BOOST_BASENAME}-source
# Boost patch for exception handling
cp ${CARLA_BUILD_FOLDER}/../Util/BoostFiles/rational.hpp ${BOOST_BASENAME}-source/boost/rational.hpp
cp ${CARLA_BUILD_FOLDER}/../Util/BoostFiles/read.hpp ${BOOST_BASENAME}-source/boost/geometry/io/wkt/read.hpp
cp "${CARLA_BUILD_FOLDER}/../Util/BoostFiles/rational.hpp ${BOOST_BASENAME}-source/boost/rational.hpp"
cp "${CARLA_BUILD_FOLDER}/../Util/BoostFiles/read.hpp ${BOOST_BASENAME}-source/boost/geometry/io/wkt/read.hpp"
# ---
pushd ${BOOST_BASENAME}-source >/dev/null
@ -160,8 +160,8 @@ else
fi
# Boost patch for exception handling
cp ${CARLA_BUILD_FOLDER}/../Util/BoostFiles/rational.hpp ${BOOST_BASENAME}-install/include/boost/rational.hpp
cp ${CARLA_BUILD_FOLDER}/../Util/BoostFiles/read.hpp ${BOOST_BASENAME}-install/include/boost/geometry/io/wkt/read.hpp
cp "${CARLA_BUILD_FOLDER}/../Util/BoostFiles/rational.hpp ${BOOST_BASENAME}-install/include/boost/rational.hpp"
cp "${CARLA_BUILD_FOLDER}/../Util/BoostFiles/read.hpp ${BOOST_BASENAME}-install/include/boost/geometry/io/wkt/read.hpp"
# ---
unset BOOST_BASENAME