Skip to content
This repository has been archived by the owner on Jul 1, 2024. It is now read-only.

feat(lanelet2_extension): add multi osm parser #234

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
1 change: 1 addition & 0 deletions tmp/lanelet2_extension/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ add_definitions(${GeographicLib_DEFINITIONS})

ament_auto_add_library(lanelet2_extension_lib SHARED
lib/autoware_osm_parser.cpp
lib/autoware_multi_osm_parser.cpp
lib/autoware_traffic_light.cpp
lib/crosswalk.cpp
lib/detection_area.cpp
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,188 @@
// Copyright 2023 Autoware Foundation
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

#ifndef LANELET2_EXTENSION__IO__AUTOWARE_MULTI_OSM_PARSER_HPP_
#define LANELET2_EXTENSION__IO__AUTOWARE_MULTI_OSM_PARSER_HPP_

#include "lanelet2_io/Exceptions.h"
#include "lanelet2_io/io_handlers/Factory.h"
#include "lanelet2_io/io_handlers/OsmFile.h"
#include "lanelet2_io/io_handlers/OsmHandler.h"

#include <boost/geometry/algorithms/is_valid.hpp>

#include <lanelet2_core/geometry/LineString.h>
#include <lanelet2_core/geometry/Polygon.h>

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

using std::string_literals::operator""s;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ google-global-names-in-headers ⚠️
using declarations in the global namespace in headers are prohibited

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ misc-unused-using-decls ⚠️
using decl operator""s is unused


namespace lanelet
{
namespace io_handlers
Comment on lines +37 to +39
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ modernize-concat-nested-namespaces ⚠️
nested namespaces can be concatenated

Suggested change
namespace lanelet
{
namespace io_handlers
namespace lanelet::io_handlers

{

class MultiOsmParser : public Parser
{
public:
using Parser::Parser;

std::unique_ptr<LaneletMap> parse(
const std::string & lanelet2_filename, ErrorMessages & errors) const override;

std::unique_ptr<LaneletMap> parse(
const std::vector<std::string> & lanelet2_filenames, ErrorMessages & errors) const;

std::unique_ptr<LaneletMap> fromOsmFile(const osm::File & file, ErrorMessages & errors) const;
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ readability-identifier-naming ⚠️
invalid case style for function fromOsmFile

Suggested change
std::unique_ptr<LaneletMap> fromOsmFile(const osm::File & file, ErrorMessages & errors) const;
std::unique_ptr<LaneletMap> from_osm_file(const osm::File & file, ErrorMessages & errors) const;


std::unique_ptr<LaneletMap> fromOsmFile(
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ readability-identifier-naming ⚠️
invalid case style for function fromOsmFile

Suggested change
std::unique_ptr<LaneletMap> fromOsmFile(
std::unique_ptr<LaneletMap> from_osm_file(

const std::map<std::string, osm::File> & files_map, ErrorMessages & errors) const;

static void parseVersions(
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ readability-identifier-naming ⚠️
invalid case style for function parseVersions

Suggested change
static void parseVersions(
static void parse_versions(

const std::string & filename, std::string * format_version, std::string * map_version);

static constexpr const char * extension() { return ".osm"; }

static constexpr const char * name() { return "autoware_multi_osm_handler"; }
};

namespace
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ google-build-namespaces ⚠️
do not use unnamed namespaces in header files

{
RegisterParser<MultiOsmParser> regParser;
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ misc-definitions-in-headers ⚠️
variable regParser defined in a header file; variable definitions in header files can lead to ODR violations

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ readability-identifier-naming ⚠️
invalid case style for variable regParser

Suggested change
RegisterParser<MultiOsmParser> regParser;
RegisterParser<MultiOsmParser> reg_parser;


class MultiFileLoader
{
public:
static std::unique_ptr<LaneletMap> loadMap(
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ readability-identifier-naming ⚠️
invalid case style for function loadMap

Suggested change
static std::unique_ptr<LaneletMap> loadMap(
static std::unique_ptr<LaneletMap> load_map(

const osm::File & file, const Projector & projector, ErrorMessages & errors)
{
MultiFileLoader loader;
loader.loadNodes(file.nodes, projector);
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ readability-identifier-naming ⚠️
invalid case style for function loadNodes

Suggested change
loader.loadNodes(file.nodes, projector);
loader.load_nodes(file.nodes, projector);

loader.loadWays(file.ways);
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ readability-identifier-naming ⚠️
invalid case style for function loadWays

Suggested change
loader.loadWays(file.ways);
loader.load_ways(file.ways);

auto laneletsWithRelation = loader.loadLanelets(file.relations);
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ readability-identifier-naming ⚠️
invalid case style for variable laneletsWithRelation

Suggested change
auto laneletsWithRelation = loader.loadLanelets(file.relations);
auto lanelets_with_relation = loader.loadLanelets(file.relations);

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ readability-identifier-naming ⚠️
invalid case style for function loadLanelets

Suggested change
auto laneletsWithRelation = loader.loadLanelets(file.relations);
auto laneletsWithRelation = loader.load_lanelets(file.relations);

auto areasWithRelation = loader.loadAreas(file.relations);
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ readability-identifier-naming ⚠️
invalid case style for variable areasWithRelation

Suggested change
auto areasWithRelation = loader.loadAreas(file.relations);
auto areas_with_relation = loader.loadAreas(file.relations);

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ readability-identifier-naming ⚠️
invalid case style for function loadAreas

Suggested change
auto areasWithRelation = loader.loadAreas(file.relations);
auto areasWithRelation = loader.load_areas(file.relations);

loader.loadRegulatoryElements(file.relations);
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ readability-identifier-naming ⚠️
invalid case style for function loadRegulatoryElements

Suggested change
loader.loadRegulatoryElements(file.relations);
loader.load_regulatory_elements(file.relations);

loader.addRegulatoryElements(laneletsWithRelation);
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ readability-identifier-naming ⚠️
invalid case style for variable laneletsWithRelation

Suggested change
loader.addRegulatoryElements(laneletsWithRelation);
loader.addRegulatoryElements(lanelets_with_relation);

loader.addRegulatoryElements(areasWithRelation);
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ readability-identifier-naming ⚠️
invalid case style for variable areasWithRelation

Suggested change
loader.addRegulatoryElements(areasWithRelation);
loader.addRegulatoryElements(areas_with_relation);

Comment on lines +82 to +83
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ readability-identifier-naming ⚠️
invalid case style for function addRegulatoryElements

Suggested change
loader.addRegulatoryElements(laneletsWithRelation);
loader.addRegulatoryElements(areasWithRelation);
loader.add_regulatory_elements(laneletsWithRelation);
loader.add_regulatory_elements(areasWithRelation);

errors = std::move(loader.errors_);

return std::make_unique<LaneletMap>(
loader.lanelets_, loader.areas_, loader.regulatoryElements_, loader.polygons_,
loader.lineStrings_, loader.points_);
}

static std::unique_ptr<LaneletMap> loadMap(
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ readability-identifier-naming ⚠️
invalid case style for function loadMap

Suggested change
static std::unique_ptr<LaneletMap> loadMap(
static std::unique_ptr<LaneletMap> load_map(

const std::map<std::string, osm::File> & files_map, const Projector & projector,
ErrorMessages & errors)
{
MultiFileLoader loader;

std::for_each(files_map.begin(), files_map.end(), [&loader, &projector](const auto & file) {
loader.loadNodes(file.second.nodes, projector);
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ readability-identifier-naming ⚠️
invalid case style for function loadNodes

Suggested change
loader.loadNodes(file.second.nodes, projector);
loader.load_nodes(file.second.nodes, projector);

});

std::for_each(files_map.begin(), files_map.end(), [&loader](const auto & file) {
loader.loadWays(file.second.ways);
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ readability-identifier-naming ⚠️
invalid case style for function loadWays

Suggested change
loader.loadWays(file.second.ways);
loader.load_ways(file.second.ways);

});

LaneletsWithRegulatoryElements laneletsWithRelation;
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ readability-identifier-naming ⚠️
invalid case style for variable laneletsWithRelation

Suggested change
LaneletsWithRegulatoryElements laneletsWithRelation;
LaneletsWithRegulatoryElements lanelets_with_relation;

for (const auto & file : files_map) {
laneletsWithRelation = loader.loadLanelets(file.second.relations);
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ readability-identifier-naming ⚠️
invalid case style for variable laneletsWithRelation

Suggested change
laneletsWithRelation = loader.loadLanelets(file.second.relations);
lanelets_with_relation = loader.loadLanelets(file.second.relations);

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ readability-identifier-naming ⚠️
invalid case style for function loadLanelets

Suggested change
laneletsWithRelation = loader.loadLanelets(file.second.relations);
laneletsWithRelation = loader.load_lanelets(file.second.relations);

}

AreasWithRegulatoryElements areasWithRelation;
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ readability-identifier-naming ⚠️
invalid case style for variable areasWithRelation

Suggested change
AreasWithRegulatoryElements areasWithRelation;
AreasWithRegulatoryElements areas_with_relation;

for (const auto & file : files_map) {
areasWithRelation = loader.loadAreas(file.second.relations);
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ readability-identifier-naming ⚠️
invalid case style for variable areasWithRelation

Suggested change
areasWithRelation = loader.loadAreas(file.second.relations);
areas_with_relation = loader.loadAreas(file.second.relations);

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ readability-identifier-naming ⚠️
invalid case style for function loadAreas

Suggested change
areasWithRelation = loader.loadAreas(file.second.relations);
areasWithRelation = loader.load_areas(file.second.relations);

}

for (const auto & file : files_map) {
loader.loadRegulatoryElements(file.second.relations);
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ readability-identifier-naming ⚠️
invalid case style for function loadRegulatoryElements

Suggested change
loader.loadRegulatoryElements(file.second.relations);
loader.load_regulatory_elements(file.second.relations);

}
loader.addRegulatoryElements(laneletsWithRelation);
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ readability-identifier-naming ⚠️
invalid case style for variable laneletsWithRelation

Suggested change
loader.addRegulatoryElements(laneletsWithRelation);
loader.addRegulatoryElements(lanelets_with_relation);

loader.addRegulatoryElements(areasWithRelation);
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ readability-identifier-naming ⚠️
invalid case style for variable areasWithRelation

Suggested change
loader.addRegulatoryElements(areasWithRelation);
loader.addRegulatoryElements(areas_with_relation);

Comment on lines +118 to +119
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ readability-identifier-naming ⚠️
invalid case style for function addRegulatoryElements

Suggested change
loader.addRegulatoryElements(laneletsWithRelation);
loader.addRegulatoryElements(areasWithRelation);
loader.add_regulatory_elements(laneletsWithRelation);
loader.add_regulatory_elements(areasWithRelation);


errors = std::move(loader.errors_);
return std::make_unique<LaneletMap>(
loader.lanelets_, loader.areas_, loader.regulatoryElements_, loader.polygons_,
loader.lineStrings_, loader.points_);
}

private:
std::vector<std::string> errors_;
LaneletLayer::Map lanelets_;
AreaLayer::Map areas_;
RegulatoryElementLayer::Map regulatoryElements_;
PolygonLayer::Map polygons_;
LineStringLayer::Map lineStrings_;
PointLayer::Map points_;

public:
template <typename PrimT>
using PrimitiveWithRegulatoryElement = std::pair<PrimT, const osm::Relation *>;

template <typename PrimT>
using PrimitivesWithRegulatoryElement = std::vector<PrimitiveWithRegulatoryElement<PrimT>>;

using AreasWithRegulatoryElements = PrimitivesWithRegulatoryElement<Area>;
using LaneletsWithRegulatoryElements = PrimitivesWithRegulatoryElement<Lanelet>;

MultiFileLoader() = default;

void loadNodes(const lanelet::osm::Nodes & nodes, const Projector & projector);
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ clang-diagnostic-undefined-internal ⚠️
function lanelet::io_handlers::(anonymous namespace)::MultiFileLoader::loadNodes has internal linkage but is not defined

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ readability-identifier-naming ⚠️
invalid case style for function loadNodes

Suggested change
void loadNodes(const lanelet::osm::Nodes & nodes, const Projector & projector);
void load_nodes(const lanelet::osm::Nodes & nodes, const Projector & projector);


void loadWays(const lanelet::osm::Ways & ways);
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ clang-diagnostic-undefined-internal ⚠️
function lanelet::io_handlers::(anonymous namespace)::MultiFileLoader::loadWays has internal linkage but is not defined

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ readability-identifier-naming ⚠️
invalid case style for function loadWays

Suggested change
void loadWays(const lanelet::osm::Ways & ways);
void load_ways(const lanelet::osm::Ways & ways);


LaneletsWithRegulatoryElements loadLanelets(const lanelet::osm::Relations & relations);
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ clang-diagnostic-undefined-internal ⚠️
function lanelet::io_handlers::(anonymous namespace)::MultiFileLoader::loadLanelets has internal linkage but is not defined

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ readability-identifier-naming ⚠️
invalid case style for function loadLanelets

Suggested change
LaneletsWithRegulatoryElements loadLanelets(const lanelet::osm::Relations & relations);
LaneletsWithRegulatoryElements load_lanelets(const lanelet::osm::Relations & relations);


AreasWithRegulatoryElements loadAreas(const lanelet::osm::Relations & relations);
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ clang-diagnostic-undefined-internal ⚠️
function lanelet::io_handlers::(anonymous namespace)::MultiFileLoader::loadAreas has internal linkage but is not defined

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ readability-identifier-naming ⚠️
invalid case style for function loadAreas

Suggested change
AreasWithRegulatoryElements loadAreas(const lanelet::osm::Relations & relations);
AreasWithRegulatoryElements load_areas(const lanelet::osm::Relations & relations);


void loadRegulatoryElements(const osm::Relations & relations);
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ clang-diagnostic-undefined-internal ⚠️
function lanelet::io_handlers::(anonymous namespace)::MultiFileLoader::loadRegulatoryElements has internal linkage but is not defined

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ readability-identifier-naming ⚠️
invalid case style for function loadRegulatoryElements

Suggested change
void loadRegulatoryElements(const osm::Relations & relations);
void load_regulatory_elements(const osm::Relations & relations);


template <typename PrimT>
void addRegulatoryElements(std::vector<std::pair<PrimT, const osm::Relation *>> & addTos);
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ clang-diagnostic-undefined-internal ⚠️
function lanelet::io_handlers::(anonymous namespace)::MultiFileLoader::addRegulatoryElements<lanelet::Area> has internal linkage but is not defined

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ clang-diagnostic-undefined-internal ⚠️
function lanelet::io_handlers::(anonymous namespace)::MultiFileLoader::addRegulatoryElements<lanelet::Lanelet> has internal linkage but is not defined

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ readability-identifier-naming ⚠️
invalid case style for function addRegulatoryElements

Suggested change
void addRegulatoryElements(std::vector<std::pair<PrimT, const osm::Relation *>> & addTos);
void add_regulatory_elements(std::vector<std::pair<PrimT, const osm::Relation *>> & addTos);


template <const char * Type>
bool isType(const lanelet::osm::Relation & relation);
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ readability-identifier-naming ⚠️
invalid case style for function isType

Suggested change
bool isType(const lanelet::osm::Relation & relation);
bool is_type(const lanelet::osm::Relation & relation);


static lanelet::AttributeMap getAttributes(const lanelet::osm::Attributes & osmAttributes);
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ readability-identifier-naming ⚠️
invalid case style for function getAttributes

Suggested change
static lanelet::AttributeMap getAttributes(const lanelet::osm::Attributes & osmAttributes);
static lanelet::AttributeMap get_attributes(const lanelet::osm::Attributes & osmAttributes);


LineString3d getLaneletBorder(const osm::Relation & llElem, const std::string & role);
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ readability-identifier-naming ⚠️
invalid case style for function getLaneletBorder

Suggested change
LineString3d getLaneletBorder(const osm::Relation & llElem, const std::string & role);
LineString3d get_lanelet_border(const osm::Relation & llElem, const std::string & role);


LineStrings3d getLinestrings(const osm::Roles & roles, const std::string & roleName, Id refId);
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ readability-identifier-naming ⚠️
invalid case style for function getLinestrings

Suggested change
LineStrings3d getLinestrings(const osm::Roles & roles, const std::string & roleName, Id refId);
LineStrings3d get_linestrings(const osm::Roles & roles, const std::string & roleName, Id refId);


LineStrings3d getOuterRing(const osm::Relation & area);
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ readability-identifier-naming ⚠️
invalid case style for function getOuterRing

Suggested change
LineStrings3d getOuterRing(const osm::Relation & area);
LineStrings3d get_outer_ring(const osm::Relation & area);


std::vector<LineStrings3d> getInnerRing(const osm::Relation & area);
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ readability-identifier-naming ⚠️
invalid case style for function getInnerRing

Suggested change
std::vector<LineStrings3d> getInnerRing(const osm::Relation & area);
std::vector<LineStrings3d> get_inner_ring(const osm::Relation & area);


RuleParameterMap getRulesForRegulatoryElement(Id currElemId, const osm::Roles & roles);
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ readability-identifier-naming ⚠️
invalid case style for function getRulesForRegulatoryElement

Suggested change
RuleParameterMap getRulesForRegulatoryElement(Id currElemId, const osm::Roles & roles);
RuleParameterMap get_rules_for_regulatory_element(Id currElemId, const osm::Roles & roles);


std::vector<LineStrings3d> assembleBoundary(LineStrings3d lineStrings, Id id);
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ readability-identifier-naming ⚠️
invalid case style for function assembleBoundary

Suggested change
std::vector<LineStrings3d> assembleBoundary(LineStrings3d lineStrings, Id id);
std::vector<LineStrings3d> assemble_boundary(LineStrings3d lineStrings, Id id);


template <typename PrimT>
PrimT getOrGetDummy(
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ readability-identifier-naming ⚠️
invalid case style for function getOrGetDummy

Suggested change
PrimT getOrGetDummy(
PrimT get_or_get_dummy(

const typename std::unordered_map<Id, PrimT> & map, Id id, Id currentPrimitiveId);

void parserError(Id id, const std::string & what);
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ readability-identifier-naming ⚠️
invalid case style for function parserError

Suggested change
void parserError(Id id, const std::string & what);
void parser_error(Id id, const std::string & what);

};
} // namespace
} // namespace io_handlers
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ modernize-concat-nested-namespaces ⚠️
nested namespaces can be concatenated

Suggested change
} // namespace io_handlers

}; // namespace lanelet

#endif // LANELET2_EXTENSION__IO__AUTOWARE_MULTI_OSM_PARSER_HPP_
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,14 @@ namespace lanelet::utils::conversion
*/
void toBinMsg(const lanelet::LaneletMapPtr & map, autoware_map_msgs::msg::LaneletMapBin * msg);

/**
* [toBinMsg converts lanelet2 map to ROS message. Similar implementation to
* lanelet::io_handlers::BinHandler::write()]
* @param map [lanelet map data]
* @param msg [converted ROS message. Only "data" field is filled]
*/
void toBinMsg(const lanelet::LaneletMapPtr & map, autoware_map_msgs::msg::LaneletMapBin * msg);
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ readability-redundant-declaration ⚠️
redundant toBinMsg declaration

Suggested change
void toBinMsg(const lanelet::LaneletMapPtr & map, autoware_map_msgs::msg::LaneletMapBin * msg);


/**
* [fromBinMsg converts ROS message into lanelet2 data. Similar implementation
* to lanelet::io_handlers::BinHandler::parse()]
Expand Down
Loading
Loading