Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New module: lanelet2_ml_converter #329

Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
66 commits
Select commit Hold shift + click to select a range
01805e6
initial commit lanelet2_map_learning module
immel-f Jul 18, 2023
4db0c18
bugfixes after cleanup
immel-f Jul 19, 2023
60ea2c6
fix dot visualization
immel-f Jul 20, 2023
3f6c08b
wip map graph data provider
immel-f Jul 20, 2023
39faaa0
wip graph conversion
immel-f Jul 24, 2023
8f757a5
wip polyline repr
immel-f Jul 25, 2023
0c2168c
wip node feature calculation
immel-f Jul 27, 2023
283c49f
draft lane lane graph
immel-f Aug 2, 2023
5155b53
wip lane to te graph
immel-f Aug 3, 2023
fb65688
draft lane to te graph
immel-f Aug 8, 2023
d3e3f34
wip partial rewrite new concept
immel-f Oct 30, 2023
8fe4100
wip partial rewrite, continue map feature classes
immel-f Oct 31, 2023
071a6b2
continue rewrite
immel-f Nov 7, 2023
d07a486
wip compound features
immel-f Nov 8, 2023
6aadd3f
further work map features
immel-f Nov 9, 2023
44d6194
first draft map features
immel-f Nov 22, 2023
1320216
wip MapData
immel-f Nov 23, 2023
aadf394
wip MapData and remove copy of lanelet2_routing classes
immel-f Nov 23, 2023
15cabc2
wip map data
immel-f Nov 24, 2023
1ac2c69
first draft compound feature calculation
immel-f Nov 29, 2023
d8cf015
draft, whole module builds again
immel-f Dec 1, 2023
95ccdd4
add unit test map
immel-f Dec 6, 2023
d80f461
add unit test map visualization file
immel-f Dec 6, 2023
025f234
add utils unit tests and fix bugs
immel-f Dec 7, 2023
3517b2d
unit tests for map features and fixes
immel-f Dec 7, 2023
835184f
wip MapData tests, add matplot++ for debug (remove later)
immel-f Dec 8, 2023
f314d4b
fix MapData
immel-f Dec 11, 2023
b809af7
add MapData Unit tests
immel-f Dec 12, 2023
24cb1d4
bugfix extract submap
immel-f Dec 13, 2023
742e47a
add associated ll ids
immel-f Dec 14, 2023
2f185fb
finish MapDataInterface unit tests
immel-f Dec 14, 2023
b04797a
wip serialization
immel-f Dec 15, 2023
03a8854
finish serialization, bugfixes
immel-f Dec 18, 2023
6bb3a84
wip python bindings
immel-f Dec 18, 2023
eeb1f1d
cont wip python bindings
immel-f Dec 20, 2023
dd8bb73
fix const ref properties
immel-f Dec 20, 2023
7ca574b
wip python bindings
immel-f Dec 21, 2023
7db76cd
wip python bindings
immel-f Jan 8, 2024
8a486e9
bugfixes python bindings
immel-f Jan 9, 2024
8cfe875
first finished version with python bindings; add transformation to ve…
immel-f Jan 10, 2024
dab156d
bugfixes
immel-f Jan 12, 2024
506a891
more bugfixes, now tested working on real map
immel-f Jan 15, 2024
63cd77d
fix python serialization, properly handle splitted cut lines
immel-f Jan 16, 2024
bf6d8c0
add following edges
immel-f Jan 17, 2024
d444210
add tracing pointMatrix -> cpdFeat
immel-f Jan 18, 2024
d9578d1
remove debug prints
immel-f Jan 18, 2024
65aac9e
fix path loop edge case, support multi file save and load
immel-f Jan 19, 2024
df54547
bugfix double cpdFeats
immel-f Jan 22, 2024
8763e4d
bugfix invalid feats
immel-f Jan 22, 2024
6e8af47
bugfix transform rotation
immel-f Jan 23, 2024
8beb2ca
better edge support
immel-f Jan 25, 2024
f914eb5
rename module
immel-f Jan 29, 2024
226073a
Merge branch 'fzi-forschungszentrum-informatik:master' into feature_m…
immel-f Jan 29, 2024
d255929
remove seq to support older eigen
immel-f Jan 29, 2024
b0d70a6
add missing virtual placeholder
immel-f Jan 29, 2024
f271a5d
add module to lint
immel-f Jan 29, 2024
df0d71d
add missing commands to conanfile
immel-f Jan 29, 2024
059cca1
add missing include
immel-f Jan 29, 2024
e0b63fc
add missing conan include
immel-f Jan 30, 2024
82bd169
Merge branch 'fzi-forschungszentrum-informatik:master' into feature_m…
immel-f Jan 30, 2024
2b050fb
fix conan build
immel-f Jan 30, 2024
e773b16
fix python test and dockerfile
immel-f Jan 30, 2024
54d7712
add numpy to dockerfile
immel-f Jan 30, 2024
ed33a0e
add doc and readme
immel-f Feb 1, 2024
aa3b023
add pre-release note
immel-f Feb 1, 2024
07bc92f
add download link
immel-f Feb 1, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
initial commit lanelet2_map_learning module
  • Loading branch information
immel-f committed Jul 18, 2023
commit 01805e6e0beb3d43a05aaae3e3c7d613919e1b9e
3 changes: 3 additions & 0 deletions lanelet2_map_learning/CHANGELOG.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Changelog for package lanelet2_map_learning
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
69 changes: 69 additions & 0 deletions lanelet2_map_learning/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
set(MRT_PKG_VERSION 4.0.0)
# Modify only if you know what you are doing!
cmake_minimum_required(VERSION 3.5.1)
project(lanelet2_map_learning)

###################
## Find packages ##
###################
find_package(mrt_cmake_modules REQUIRED)
include(UseMrtStdCompilerFlags)
include(GatherDeps)

# You can add a custom.cmake in order to add special handling for this package. E.g. you can do:
# list(REMOVE_ITEM DEPENDEND_PACKAGES <package name 1> <package name 2> ...)
# To remove libs which cannot be found automatically. You can also "find_package" other, custom dependencies there.
# You can also set PROJECT_INSTALL_FILES to install files that are not installed by default.
if(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/custom.cmake")
include("${CMAKE_CURRENT_SOURCE_DIR}/custom.cmake")
endif()

find_package(AutoDeps REQUIRED COMPONENTS ${DEPENDEND_PACKAGES})

mrt_parse_package_xml()

########################
## Add python modules ##
########################
# This adds a python module if located under src/{PROJECT_NAME)
mrt_python_module_setup()

mrt_glob_files(PROJECT_PYTHON_SOURCE_FILES_SRC "python_api/*.cpp")
if (PROJECT_PYTHON_SOURCE_FILES_SRC)
# Add a cpp-python api library. Make sure there are no name collisions with python modules in this project
mrt_add_python_api( ${PROJECT_NAME}
FILES ${PROJECT_PYTHON_SOURCE_FILES_SRC}
)
endif()

############################
## Read source code files ##
############################
mrt_glob_files_recurse(PROJECT_HEADER_FILES_INC "include/*.h" "include/*.hpp" "include/*.cuh")
mrt_glob_files(PROJECT_SOURCE_FILES_INC "src/*.h" "src/*.hpp" "src/*.cuh")
mrt_glob_files(PROJECT_SOURCE_FILES_SRC "src/*.cpp" "src/*.cu")

###########
## Build ##
###########
# Declare a cpp library
mrt_add_library(${PROJECT_NAME}
INCLUDES ${PROJECT_HEADER_FILES_INC} ${PROJECT_SOURCE_FILES_INC}
SOURCES ${PROJECT_SOURCE_FILES_SRC}
)

#############
## Install ##
#############
# Install all targets, headers by default and scripts and other files if specified (folders or files).
# This command also exports libraries and config files for dependent packages and this supersedes catkin_package.
mrt_install(PROGRAMS scripts FILES res data ${PROJECT_INSTALL_FILES})

#############
## Testing ##
#############
# Add test targets for cpp and python tests
if (CATKIN_ENABLE_TESTING)
mrt_add_tests(test)
mrt_add_nosetests(test)
endif()
3 changes: 3 additions & 0 deletions lanelet2_map_learning/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Lanelet2 Map Learning

The map learning module for lanelet2.
23 changes: 23 additions & 0 deletions lanelet2_map_learning/include/lanelet2_map_learning/Exceptions.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
#pragma once
#include <lanelet2_core/Exceptions.h>
#include <lanelet2_core/Forward.h>

#include <stdexcept>

namespace lanelet {
/**
* @brief Thrown when an export to the provided file(name) cannot be done.
*/
class ExportError : public LaneletError {
using LaneletError::LaneletError;
};

/**
* @brief Thrown when an there's an error in the graph.
* It will feature further information.
*/
class MapGraphError : public LaneletError {
using LaneletError::LaneletError;
};

} // namespace lanelet
116 changes: 116 additions & 0 deletions lanelet2_map_learning/include/lanelet2_map_learning/Forward.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,116 @@
#pragma once

#include <lanelet2_core/Forward.h>

#include <memory>
#include <string>
#include <unordered_map>
#include <vector>

namespace lanelet {
namespace map_learning {
namespace internal {

using IdPair = std::pair<Id, Id>;

template <typename BaseGraphT>
class Graph;

class MapGraphGraph;
class RouteGraph;
} // namespace internal

using LaneId = uint16_t;
class MapGraph;
using MapGraphPtr = std::shared_ptr<MapGraph>;
using MapGraphUPtr = std::unique_ptr<MapGraph>;
using MapGraphConstPtr = std::shared_ptr<const MapGraph>;

class MapGraphContainer;
using MapGraphContainerUPtr = std::unique_ptr<MapGraphContainer>;

class Route;
struct LaneletRelation;
using LaneletRelations = std::vector<LaneletRelation>;

class LaneletPath;
using LaneletPaths = std::vector<LaneletPath>;
class LaneletOrAreaPath;
using LaneletOrAreaPaths = std::vector<LaneletOrAreaPath>;

//! This enum expresses the types of relations lanelet2 distiguishes internally. Between two lanelets a and b (in this
//! order), exactly one of these relation exists.
//!
//! @note The relation between b and a is different than between a and b. There is also no obvious
//! symmetry. When a is left of b, b can be either right or adjacent right to b.
enum class RelationType : uint8_t {
None = 0, //!< No relation
Successor = 0b1, //!< A (the only) direct, reachable successor. Not merging and not diverging.
Left = 0b10, //!< (the only) directly adjacent, reachable left neighbour
Right = 0b100, //!< (the only) directly adjacent, reachable right neighbour
AdjacentLeft = 0b1000, //!< directly adjacent, unreachable left neighbor
AdjacentRight = 0b10000, //!< directly adjacent, unreachable right neighbor
Conflicting = 0b100000, //!< Unreachable but with overlapping shape
Area = 0b1000000 //!< Adjacent to a reachable area
};

using RelationUnderlyingType = std::underlying_type_t<RelationType>;

constexpr RelationType allRelations() { return static_cast<RelationType>(0b1111111); }
static_assert(allRelations() > RelationType::Area, "allRelations is wrong!");

constexpr RelationType operator~(RelationType r) { return RelationType(~RelationUnderlyingType(r)); }
constexpr RelationType operator&(RelationType r1, RelationType r2) {
return RelationType(RelationUnderlyingType(r1) & RelationUnderlyingType(r2));
}
constexpr RelationType operator&=(RelationType& r1, RelationType r2) { return r1 = r1 & r2; }
constexpr RelationType operator|(RelationType r1, RelationType r2) {
return RelationType(std::underlying_type_t<RelationType>(r1) | RelationUnderlyingType(r2));
}
constexpr RelationType operator|=(RelationType& r1, RelationType r2) { return r1 = r1 | r2; }

// Used for graph export
inline std::string relationToString(RelationType type) {
switch (type) {
case RelationType::None:
return "None";
case RelationType::Successor:
return "Successor";
case RelationType::Left:
return "Left";
case RelationType::Right:
return "Right";
case RelationType::AdjacentLeft:
return "AdjacentLeft";
case RelationType::AdjacentRight:
return "AdjacentRight";
case RelationType::Conflicting:
return "Conflicting";
case RelationType::Area:
return "Area";
}
return ""; // some compilers need that
}

inline std::string relationToColor(RelationType type) {
switch (type) {
case RelationType::None:
return "";
case RelationType::Successor:
return "green";
case RelationType::Left:
return "blue";
case RelationType::Right:
return "magenta";
case RelationType::Conflicting:
return "red";
case RelationType::AdjacentLeft:
case RelationType::AdjacentRight:
return "black";
case RelationType::Area:
return "yellow";
}
return ""; // some compilers need that
}
} // namespace map_learning
} // namespace lanelet
Loading