-
Notifications
You must be signed in to change notification settings - Fork 33
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
(DO NOT MERGE)feat(lanelet2_map_preprocessor): port lanelet2_map_preprocessor from Autoware.Universe #3
Conversation
…Autoware.Universe Signed-off-by: mitsudome-r <[email protected]>
Welcome to Codecov 🎉Once merged to your default branch, Codecov will compare your coverage reports and display the results in this comment. Thanks for integrating Codecov - We've got you covered ☂️ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Clang-Tidy
found issue(s) with the introduced code (1/12)
#include <unordered_set> | ||
#include <vector> | ||
|
||
using lanelet::utils::getId; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
using decl getId
is unused
#include <vector> | ||
|
||
using lanelet::utils::getId; | ||
using lanelet::utils::to2D; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
using decl to2D
is unused
using lanelet::utils::getId; | ||
using lanelet::utils::to2D; | ||
|
||
bool loadLaneletMap( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
invalid case style for function loadLaneletMap
bool loadLaneletMap( | |
bool load_lanelet_map( |
lanelet::LaneletMapPtr llt_map_ptr(new lanelet::LaneletMap); | ||
lanelet::projection::MGRSProjector projector; | ||
|
||
if (!loadLaneletMap(llt_map_path, llt_map_ptr, projector)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
invalid case style for function loadLaneletMap
if (!loadLaneletMap(llt_map_path, llt_map_ptr, projector)) { | |
if (!load_lanelet_map(llt_map_path, llt_map_ptr, projector)) { |
|
||
bool exists(std::unordered_set<lanelet::Id> & set, lanelet::Id element) | ||
{ | ||
return std::find(set.begin(), set.end(), element) != set.end(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this STL algorithm call should be replaced with a container method
return std::find(set.begin(), set.end(), element) != set.end(); | |
return set.find(element) != set.end(); |
return std::find(set.begin(), set.end(), element) != set.end(); | ||
} | ||
|
||
lanelet::Lanelets convertToVector(lanelet::LaneletMapPtr & lanelet_map_ptr) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
invalid case style for function convertToVector
lanelet::Lanelets convertToVector(lanelet::LaneletMapPtr & lanelet_map_ptr) | |
lanelet::Lanelets convert_to_vector(lanelet::LaneletMapPtr & lanelet_map_ptr) |
} | ||
void fixTags(lanelet::LaneletMapPtr & lanelet_map_ptr) | ||
{ | ||
auto lanelets = convertToVector(lanelet_map_ptr); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
invalid case style for function convertToVector
auto lanelets = convertToVector(lanelet_map_ptr); | |
auto lanelets = convert_to_vector(lanelet_map_ptr); |
lanelet::Lanelets convertToVector(lanelet::LaneletMapPtr & lanelet_map_ptr) | ||
{ | ||
lanelet::Lanelets lanelets; | ||
for (lanelet::Lanelet lanelet : lanelet_map_ptr->laneletLayer) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
loop variable is copied but only used as const reference; consider making it a const reference
for (lanelet::Lanelet lanelet : lanelet_map_ptr->laneletLayer) { | |
for (const lanelet::Lanelet& lanelet : lanelet_map_ptr->laneletLayer) { |
} | ||
return lanelets; | ||
} | ||
void fixTags(lanelet::LaneletMapPtr & lanelet_map_ptr) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
invalid case style for function fixTags
void fixTags(lanelet::LaneletMapPtr & lanelet_map_ptr) | |
void fix_tags(lanelet::LaneletMapPtr & lanelet_map_ptr) |
return EXIT_FAILURE; | ||
} | ||
|
||
fixTags(llt_map_ptr); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
invalid case style for function fixTags
fixTags(llt_map_ptr); | |
fix_tags(llt_map_ptr); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Clang-Tidy
found issue(s) with the introduced code (2/12)
void fixTags(lanelet::LaneletMapPtr & lanelet_map_ptr) | ||
{ | ||
auto lanelets = convertToVector(lanelet_map_ptr); | ||
lanelet::traffic_rules::TrafficRulesPtr trafficRules = |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
invalid case style for variable trafficRules
lanelet::traffic_rules::TrafficRulesPtr trafficRules = | |
lanelet::traffic_rules::TrafficRulesPtr traffic_rules = |
lanelet::traffic_rules::TrafficRulesFactory::create( | ||
lanelet::Locations::Germany, lanelet::Participants::Vehicle); | ||
lanelet::routing::RoutingGraphUPtr routingGraph = | ||
lanelet::routing::RoutingGraph::build(*lanelet_map_ptr, *trafficRules); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
invalid case style for variable trafficRules
lanelet::routing::RoutingGraph::build(*lanelet_map_ptr, *trafficRules); | |
lanelet::routing::RoutingGraph::build(*lanelet_map_ptr, *traffic_rules); |
lanelet::traffic_rules::TrafficRulesPtr trafficRules = | ||
lanelet::traffic_rules::TrafficRulesFactory::create( | ||
lanelet::Locations::Germany, lanelet::Participants::Vehicle); | ||
lanelet::routing::RoutingGraphUPtr routingGraph = |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
invalid case style for variable routingGraph
lanelet::routing::RoutingGraphUPtr routingGraph = | |
lanelet::routing::RoutingGraphUPtr routing_graph = |
lanelet::routing::RoutingGraph::build(*lanelet_map_ptr, *trafficRules); | ||
|
||
for (auto & llt : lanelets) { | ||
if (!routingGraph->conflicting(llt).empty()) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
invalid case style for variable routingGraph
if (!routingGraph->conflicting(llt).empty()) { | |
if (!routing_graph->conflicting(llt).empty()) { |
continue; | ||
} | ||
llt.attributes().erase("turn_direction"); | ||
if (!!routingGraph->adjacentRight(llt)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
invalid case style for variable routingGraph
if (!!routingGraph->adjacentRight(llt)) { | |
if (!!routing_graph->adjacentRight(llt)) { |
if (!!routingGraph->adjacentRight(llt)) { | ||
llt.rightBound().attributes()["lane_change"] = "yes"; | ||
} | ||
if (!!routingGraph->adjacentLeft(llt)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
invalid case style for variable routingGraph
if (!!routingGraph->adjacentLeft(llt)) { | |
if (!!routing_graph->adjacentLeft(llt)) { |
#include <unordered_set> | ||
#include <vector> | ||
|
||
bool loadLaneletMap( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
invalid case style for function loadLaneletMap
bool loadLaneletMap( | |
bool load_lanelet_map( |
|
||
pcl::PointCloud<pcl::PointXYZ>::Ptr pcd_map_ptr(new pcl::PointCloud<pcl::PointXYZ>); | ||
|
||
if (!loadLaneletMap(llt_map_path, llt_map_ptr, projector)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
invalid case style for function loadLaneletMap
if (!loadLaneletMap(llt_map_path, llt_map_ptr, projector)) { | |
if (!load_lanelet_map(llt_map_path, llt_map_ptr, projector)) { |
return true; | ||
} | ||
|
||
bool loadPCDMap(const std::string & pcd_map_path, pcl::PointCloud<pcl::PointXYZ>::Ptr & pcd_map_ptr) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
invalid case style for function loadPCDMap
bool loadPCDMap(const std::string & pcd_map_path, pcl::PointCloud<pcl::PointXYZ>::Ptr & pcd_map_ptr) | |
bool load_pcd_map(const std::string & pcd_map_path, pcl::PointCloud<pcl::PointXYZ>::Ptr & pcd_map_ptr) |
if (!loadLaneletMap(llt_map_path, llt_map_ptr, projector)) { | ||
return EXIT_FAILURE; | ||
} | ||
if (!loadPCDMap(pcd_map_path, pcd_map_ptr)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
invalid case style for function loadPCDMap
if (!loadPCDMap(pcd_map_path, pcd_map_ptr)) { | |
if (!load_pcd_map(pcd_map_path, pcd_map_ptr)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Clang-Tidy
found issue(s) with the introduced code (3/12)
return true; | ||
} | ||
|
||
double getMinHeightAroundPoint( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
invalid case style for function getMinHeightAroundPoint
double getMinHeightAroundPoint( | |
double get_min_height_around_point( |
pcl_pt.y = pt.y(); | ||
pcl_pt.z = pt.z(); | ||
double min_height = | ||
getMinHeightAroundPoint(pcd_map_ptr, kdtree, pcl_pt, search_radius3d, search_radius2d); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
invalid case style for function getMinHeightAroundPoint
getMinHeightAroundPoint(pcd_map_ptr, kdtree, pcl_pt, search_radius3d, search_radius2d); | |
get_min_height_around_point(pcd_map_ptr, kdtree, pcl_pt, search_radius3d, search_radius2d); |
pcl_pt.y = pt.y(); | ||
pcl_pt.z = pt.z(); | ||
double min_height = | ||
getMinHeightAroundPoint(pcd_map_ptr, kdtree, pcl_pt, search_radius3d, search_radius2d); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
invalid case style for function getMinHeightAroundPoint
getMinHeightAroundPoint(pcd_map_ptr, kdtree, pcl_pt, search_radius3d, search_radius2d); | |
get_min_height_around_point(pcd_map_ptr, kdtree, pcl_pt, search_radius3d, search_radius2d); |
const pcl::KdTreeFLANN<pcl::PointXYZ> & kdtree, const pcl::PointXYZ & search_pt, | ||
const double search_radius3d, const double search_radius2d) | ||
{ | ||
std::vector<int> pointIdxRadiusSearch; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
invalid case style for variable pointIdxRadiusSearch
const double search_radius3d, const double search_radius2d) | ||
{ | ||
std::vector<int> pointIdxRadiusSearch; | ||
std::vector<float> pointRadiusSquaredDistance; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
invalid case style for variable pointRadiusSquaredDistance
std::vector<float> pointRadiusSquaredDistance; | |
std::vector<float> point_radius_squared_distance; |
std::vector<float> pointRadiusSquaredDistance; | ||
if ( | ||
kdtree.radiusSearch( | ||
search_pt, search_radius3d, pointIdxRadiusSearch, pointRadiusSquaredDistance) <= 0) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
invalid case style for variable pointRadiusSquaredDistance
search_pt, search_radius3d, pointIdxRadiusSearch, pointRadiusSquaredDistance) <= 0) { | |
search_pt, search_radius3d, pointIdxRadiusSearch, point_radius_squared_distance) <= 0) { |
kdtree.radiusSearch( | ||
search_pt, search_radius3d, pointIdxRadiusSearch, pointRadiusSquaredDistance) <= 0) { | ||
std::cout << "no points found within 3d radius " << search_radius3d << std::endl; | ||
return search_pt.z; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do not access members of unions; use (boost::)variant instead
for (std::size_t i = 0; i < pointIdxRadiusSearch.size(); i++) { | ||
std::size_t pt_idx = pointIdxRadiusSearch.at(i); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
use range-based for loop instead
for (std::size_t i = 0; i < pointIdxRadiusSearch.size(); i++) { | |
std::size_t pt_idx = pointIdxRadiusSearch.at(i); | |
for (unsigned long pt_idx : pointIdxRadiusSearch) { |
for (std::size_t i = 0; i < pointIdxRadiusSearch.size(); i++) { | ||
std::size_t pt_idx = pointIdxRadiusSearch.at(i); | ||
const auto pt = pcd_map_ptr->points.at(pt_idx); | ||
if (pt.z > min_height) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do not access members of unions; use (boost::)variant instead
if (pt.z > min_height) { | ||
continue; | ||
} | ||
double distance2d = std::hypot(pt.x - search_pt.x, pt.y - search_pt.y); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do not access members of unions; use (boost::)variant instead
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Clang-Tidy
found issue(s) with the introduced code (4/12)
if (pt.z > min_height) { | ||
continue; | ||
} | ||
double distance2d = std::hypot(pt.x - search_pt.x, pt.y - search_pt.y); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do not access members of unions; use (boost::)variant instead
if (pt.z > min_height) { | ||
continue; | ||
} | ||
double distance2d = std::hypot(pt.x - search_pt.x, pt.y - search_pt.y); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do not access members of unions; use (boost::)variant instead
if (pt.z > min_height) { | ||
continue; | ||
} | ||
double distance2d = std::hypot(pt.x - search_pt.x, pt.y - search_pt.y); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do not access members of unions; use (boost::)variant instead
double distance2d = std::hypot(pt.x - search_pt.x, pt.y - search_pt.y); | ||
if (distance2d < search_radius2d) { | ||
found = true; | ||
min_height = pt.z; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do not access members of unions; use (boost::)variant instead
} | ||
} | ||
if (!found) { | ||
min_height = search_pt.z; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do not access members of unions; use (boost::)variant instead
|
||
bool exists(std::unordered_set<lanelet::Id> & set, lanelet::Id element) | ||
{ | ||
return std::find(set.begin(), set.end(), element) != set.end(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this STL algorithm call should be replaced with a container method
return std::find(set.begin(), set.end(), element) != set.end(); | |
return set.find(element) != set.end(); |
return std::find(set.begin(), set.end(), element) != set.end(); | ||
} | ||
|
||
void adjustHeight( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
invalid case style for function adjustHeight
void adjustHeight( | |
void adjust_height( |
return EXIT_FAILURE; | ||
} | ||
|
||
adjustHeight(pcd_map_ptr, llt_map_ptr); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
invalid case style for function adjustHeight
adjustHeight(pcd_map_ptr, llt_map_ptr); | |
adjust_height(pcd_map_ptr, llt_map_ptr); |
continue; | ||
} | ||
pcl::PointXYZ pcl_pt; | ||
pcl_pt.x = pt.x(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do not access members of unions; use (boost::)variant instead
continue; | ||
} | ||
pcl::PointXYZ pcl_pt; | ||
pcl_pt.x = pt.x(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
narrowing conversion from double
to float
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Clang-Tidy
found issue(s) with the introduced code (5/12)
} | ||
pcl::PointXYZ pcl_pt; | ||
pcl_pt.x = pt.x(); | ||
pcl_pt.y = pt.y(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do not access members of unions; use (boost::)variant instead
} | ||
pcl::PointXYZ pcl_pt; | ||
pcl_pt.x = pt.x(); | ||
pcl_pt.y = pt.y(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
narrowing conversion from double
to float
pcl::PointXYZ pcl_pt; | ||
pcl_pt.x = pt.x(); | ||
pcl_pt.y = pt.y(); | ||
pcl_pt.z = pt.z(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do not access members of unions; use (boost::)variant instead
pcl::PointXYZ pcl_pt; | ||
pcl_pt.x = pt.x(); | ||
pcl_pt.y = pt.y(); | ||
pcl_pt.z = pt.z(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
narrowing conversion from double
to float
continue; | ||
} | ||
pcl::PointXYZ pcl_pt; | ||
pcl_pt.x = pt.x(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do not access members of unions; use (boost::)variant instead
continue; | ||
} | ||
pcl::PointXYZ pcl_pt; | ||
pcl_pt.x = pt.x(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
narrowing conversion from double
to float
} | ||
pcl::PointXYZ pcl_pt; | ||
pcl_pt.x = pt.x(); | ||
pcl_pt.y = pt.y(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do not access members of unions; use (boost::)variant instead
} | ||
pcl::PointXYZ pcl_pt; | ||
pcl_pt.x = pt.x(); | ||
pcl_pt.y = pt.y(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
narrowing conversion from double
to float
pcl::PointXYZ pcl_pt; | ||
pcl_pt.x = pt.x(); | ||
pcl_pt.y = pt.y(); | ||
pcl_pt.z = pt.z(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do not access members of unions; use (boost::)variant instead
pcl::PointXYZ pcl_pt; | ||
pcl_pt.x = pt.x(); | ||
pcl_pt.y = pt.y(); | ||
pcl_pt.z = pt.z(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
narrowing conversion from double
to float
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Clang-Tidy
found issue(s) with the introduced code (6/12)
#include <unordered_set> | ||
#include <vector> | ||
|
||
using lanelet::utils::getId; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
using decl getId
is unused
using lanelet::utils::getId; | ||
using lanelet::utils::to2D; | ||
|
||
bool loadLaneletMap( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
invalid case style for function loadLaneletMap
bool loadLaneletMap( | |
bool load_lanelet_map( |
lanelet::LaneletMapPtr llt_map_ptr(new lanelet::LaneletMap); | ||
lanelet::projection::MGRSProjector projector; | ||
|
||
if (!loadLaneletMap(llt_map_path, llt_map_ptr, projector)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
invalid case style for function loadLaneletMap
if (!loadLaneletMap(llt_map_path, llt_map_ptr, projector)) { | |
if (!load_lanelet_map(llt_map_path, llt_map_ptr, projector)) { |
|
||
bool exists(std::unordered_set<lanelet::Id> & set, lanelet::Id element) | ||
{ | ||
return std::find(set.begin(), set.end(), element) != set.end(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this STL algorithm call should be replaced with a container method
return std::find(set.begin(), set.end(), element) != set.end(); | |
return set.find(element) != set.end(); |
return std::find(set.begin(), set.end(), element) != set.end(); | ||
} | ||
|
||
lanelet::LineStrings3d convertLineLayerToLineStrings(lanelet::LaneletMapPtr & lanelet_map_ptr) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
invalid case style for function convertLineLayerToLineStrings
lanelet::LineStrings3d convertLineLayerToLineStrings(lanelet::LaneletMapPtr & lanelet_map_ptr) | |
lanelet::LineStrings3d convert_line_layer_to_line_strings(lanelet::LaneletMapPtr & lanelet_map_ptr) |
|
||
void mergeLines(lanelet::LaneletMapPtr & lanelet_map_ptr) | ||
{ | ||
auto lines = convertLineLayerToLineStrings(lanelet_map_ptr); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
invalid case style for function convertLineLayerToLineStrings
auto lines = convertLineLayerToLineStrings(lanelet_map_ptr); | |
auto lines = convert_line_layer_to_line_strings(lanelet_map_ptr); |
return lines; | ||
} | ||
|
||
lanelet::ConstPoint3d get3DPointFrom2DArcLength( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
invalid case style for function get3DPointFrom2DArcLength
lanelet::ConstPoint3d get3DPointFrom2DArcLength( | |
lanelet::ConstPoint3d get3_d_point_from2_d_arc_length( |
{ | ||
auto arc_coordinate = lanelet::geometry::toArcCoordinates(to2D(line), to2D(search_point)); | ||
std::cout << arc_coordinate.length << " " << arc_coordinate.distance << std::endl; | ||
return get3DPointFrom2DArcLength(line, arc_coordinate.length).basicPoint(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
invalid case style for function get3DPointFrom2DArcLength
return get3DPointFrom2DArcLength(line, arc_coordinate.length).basicPoint(); | |
return get3_d_point_from2_d_arc_length(line, arc_coordinate.length).basicPoint(); |
double ratio = (s - accumulated_distance2d) / distance2d; | ||
auto interpolated_pt = prev_pt.basicPoint() * (1 - ratio) + pt.basicPoint() * ratio; | ||
std::cout << interpolated_pt << std::endl; | ||
return lanelet::ConstPoint3d( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
avoid repeating the return type from the declaration; use a braced initializer list instead
prev_pt = pt; | ||
} | ||
RCLCPP_ERROR(rclcpp::get_logger("merge_close_lines"), "interpolation failed"); | ||
return lanelet::ConstPoint3d(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
avoid repeating the return type from the declaration; use a braced initializer list instead
return lanelet::ConstPoint3d(); | |
return {}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Clang-Tidy
found issue(s) with the introduced code (7/12)
return lanelet::ConstPoint3d(); | ||
} | ||
|
||
double getLineLength(const lanelet::ConstLineString3d & line) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
invalid case style for function getLineLength
double getLineLength(const lanelet::ConstLineString3d & line) | |
double get_line_length(const lanelet::ConstLineString3d & line) |
|
||
double getLineLength(const lanelet::ConstLineString3d & line) | ||
{ | ||
return boost::geometry::length(line.basicLineString()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
narrowing conversion from typename default_length_result<vector<Matrix<double, 3, 1, 0>>>::type
(aka long double
) to double
return boost::geometry::length(line.basicLineString()); | ||
} | ||
|
||
bool areLinesSame( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
invalid case style for function areLinesSame
bool areLinesSame( | |
bool are_lines_same( |
auto line_i = lines.at(i); | ||
for (size_t j = 0; j < i; j++) { | ||
auto line_j = lines.at(j); | ||
if (areLinesSame(line_i, line_j)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
invalid case style for function areLinesSame
if (areLinesSame(line_i, line_j)) { | |
if (are_lines_same(line_i, line_j)) { |
sum_distance += boost::geometry::distance(pt.basicPoint(), line1); | ||
} | ||
|
||
double avg_distance = sum_distance / (line1.size() + line2.size()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
narrowing conversion from unsigned long
to double
if (avg_distance < 1.0) { | ||
return true; | ||
} else { | ||
return false; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
redundant boolean literal in conditional return statement
if (avg_distance < 1.0) { | |
return true; | |
} else { | |
return false; | |
} | |
return avg_distance < 1.0; |
std::cout << line1 << " " << line2 << " " << avg_distance << std::endl; | ||
if (avg_distance < 1.0) { | ||
return true; | ||
} else { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do not use else
after return
} | ||
} | ||
|
||
lanelet::BasicPoint3d getClosestPointOnLine( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
invalid case style for function getClosestPointOnLine
lanelet::BasicPoint3d getClosestPointOnLine( | |
lanelet::BasicPoint3d get_closest_point_on_line( |
lanelet::Points3d new_points; | ||
for (const auto & p1 : line1) { | ||
lanelet::BasicPoint3d p1_basic_point = p1.basicPoint(); | ||
lanelet::BasicPoint3d p2_basic_point = getClosestPointOnLine(p1, line2); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
invalid case style for function getClosestPointOnLine
lanelet::BasicPoint3d p2_basic_point = getClosestPointOnLine(p1, line2); | |
lanelet::BasicPoint3d p2_basic_point = get_closest_point_on_line(p1, line2); |
return get3DPointFrom2DArcLength(line, arc_coordinate.length).basicPoint(); | ||
} | ||
|
||
lanelet::LineString3d mergeTwoLines( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
invalid case style for function mergeTwoLines
lanelet::LineString3d mergeTwoLines( | |
lanelet::LineString3d merge_two_lines( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Clang-Tidy
found issue(s) with the introduced code (8/12)
for (size_t j = 0; j < i; j++) { | ||
auto line_j = lines.at(j); | ||
if (areLinesSame(line_i, line_j)) { | ||
auto merged_line = mergeTwoLines(line_i, line_j); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
invalid case style for function mergeTwoLines
auto merged_line = mergeTwoLines(line_i, line_j); | |
auto merged_line = merge_two_lines(line_i, line_j); |
{ | ||
lanelet::Points3d new_points; | ||
for (const auto & p1 : line1) { | ||
lanelet::BasicPoint3d p1_basic_point = p1.basicPoint(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the variable p1_basic_point
is copy-constructed from a const reference but is only used as const reference; consider making it a const reference
lanelet::BasicPoint3d p1_basic_point = p1.basicPoint(); | |
const lanelet::BasicPoint3d& p1_basic_point = p1.basicPoint(); |
lanelet::Point3d new_point(lanelet::utils::getId(), new_basic_point); | ||
new_points.push_back(new_point); | ||
} | ||
return lanelet::LineString3d(lanelet::utils::getId(), new_points); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
avoid repeating the return type from the declaration; use a braced initializer list instead
return lanelet::LineString3d(lanelet::utils::getId(), new_points); | ||
} | ||
|
||
void copyData(lanelet::LineString3d & dst, lanelet::LineString3d & src) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
invalid case style for function copyData
void copyData(lanelet::LineString3d & dst, lanelet::LineString3d & src) | |
void copy_data(lanelet::LineString3d & dst, lanelet::LineString3d & src) |
copyData(line_i, merged_line); | ||
copyData(line_j, merged_line); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
invalid case style for function copyData
copyData(line_i, merged_line); | |
copyData(line_j, merged_line); | |
copy_data(line_i, merged_line); | |
copy_data(line_j, merged_line); |
} | ||
} | ||
|
||
void mergeLines(lanelet::LaneletMapPtr & lanelet_map_ptr) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
invalid case style for function mergeLines
void mergeLines(lanelet::LaneletMapPtr & lanelet_map_ptr) | |
void merge_lines(lanelet::LaneletMapPtr & lanelet_map_ptr) |
return EXIT_FAILURE; | ||
} | ||
|
||
mergeLines(llt_map_ptr); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
invalid case style for function mergeLines
mergeLines(llt_map_ptr); | |
merge_lines(llt_map_ptr); |
} | ||
} | ||
|
||
int main(int argc, char * argv[]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
an exception may be thrown in function main
which should not throw exceptions
#include <unordered_set> | ||
#include <vector> | ||
|
||
bool loadLaneletMap( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
invalid case style for function loadLaneletMap
bool loadLaneletMap( | |
bool load_lanelet_map( |
lanelet::LaneletMapPtr llt_map_ptr(new lanelet::LaneletMap); | ||
lanelet::projection::MGRSProjector projector; | ||
|
||
if (!loadLaneletMap(llt_map_path, llt_map_ptr, projector)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
invalid case style for function loadLaneletMap
if (!loadLaneletMap(llt_map_path, llt_map_ptr, projector)) { | |
if (!load_lanelet_map(llt_map_path, llt_map_ptr, projector)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Clang-Tidy
found issue(s) with the introduced code (9/12)
|
||
bool exists(std::unordered_set<lanelet::Id> & set, lanelet::Id element) | ||
{ | ||
return std::find(set.begin(), set.end(), element) != set.end(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this STL algorithm call should be replaced with a container method
return std::find(set.begin(), set.end(), element) != set.end(); | |
return set.find(element) != set.end(); |
return std::find(set.begin(), set.end(), element) != set.end(); | ||
} | ||
|
||
lanelet::Points3d convertPointsLayerToPoints(lanelet::LaneletMapPtr & lanelet_map_ptr) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
invalid case style for function convertPointsLayerToPoints
lanelet::Points3d convertPointsLayerToPoints(lanelet::LaneletMapPtr & lanelet_map_ptr) | |
lanelet::Points3d convert_points_layer_to_points(lanelet::LaneletMapPtr & lanelet_map_ptr) |
|
||
void mergePoints(lanelet::LaneletMapPtr & lanelet_map_ptr) | ||
{ | ||
const auto & points = convertPointsLayerToPoints(lanelet_map_ptr); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
invalid case style for function convertPointsLayerToPoints
const auto & points = convertPointsLayerToPoints(lanelet_map_ptr); | |
const auto & points = convert_points_layer_to_points(lanelet_map_ptr); |
// return lanelet::LineString3d(lanelet::utils::getId(), new_points); | ||
// } | ||
|
||
void mergePoints(lanelet::LaneletMapPtr & lanelet_map_ptr) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
invalid case style for function mergePoints
void mergePoints(lanelet::LaneletMapPtr & lanelet_map_ptr) | |
void merge_points(lanelet::LaneletMapPtr & lanelet_map_ptr) |
return EXIT_FAILURE; | ||
} | ||
|
||
mergePoints(llt_map_ptr); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
invalid case style for function mergePoints
mergePoints(llt_map_ptr); | |
merge_points(llt_map_ptr); |
} | ||
} | ||
|
||
int main(int argc, char * argv[]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
an exception may be thrown in function main
which should not throw exceptions
#include <unordered_set> | ||
#include <vector> | ||
|
||
bool loadLaneletMap( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
invalid case style for function loadLaneletMap
bool loadLaneletMap( | |
bool load_lanelet_map( |
lanelet::LaneletMapPtr llt_map_ptr(new lanelet::LaneletMap); | ||
lanelet::projection::MGRSProjector projector; | ||
|
||
if (!loadLaneletMap(llt_map_path, llt_map_ptr, projector)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
invalid case style for function loadLaneletMap
if (!loadLaneletMap(llt_map_path, llt_map_ptr, projector)) { | |
if (!load_lanelet_map(llt_map_path, llt_map_ptr, projector)) { |
|
||
bool exists(std::unordered_set<lanelet::Id> & set, lanelet::Id element) | ||
{ | ||
return std::find(set.begin(), set.end(), element) != set.end(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this STL algorithm call should be replaced with a container method
return std::find(set.begin(), set.end(), element) != set.end(); | |
return set.find(element) != set.end(); |
return std::find(set.begin(), set.end(), element) != set.end(); | ||
} | ||
|
||
lanelet::Points3d convertPointsLayerToPoints(lanelet::LaneletMapPtr & lanelet_map_ptr) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
invalid case style for function convertPointsLayerToPoints
lanelet::Points3d convertPointsLayerToPoints(lanelet::LaneletMapPtr & lanelet_map_ptr) | |
lanelet::Points3d convert_points_layer_to_points(lanelet::LaneletMapPtr & lanelet_map_ptr) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Clang-Tidy
found issue(s) with the introduced code (10/12)
return points; | ||
} | ||
|
||
lanelet::LineStrings3d convertLineLayerToLineStrings(lanelet::LaneletMapPtr & lanelet_map_ptr) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
invalid case style for function convertLineLayerToLineStrings
lanelet::LineStrings3d convertLineLayerToLineStrings(lanelet::LaneletMapPtr & lanelet_map_ptr) | |
lanelet::LineStrings3d convert_line_layer_to_line_strings(lanelet::LaneletMapPtr & lanelet_map_ptr) |
return lines; | ||
} | ||
|
||
void removeUnreferencedGeometry(lanelet::LaneletMapPtr & lanelet_map_ptr) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
invalid case style for function removeUnreferencedGeometry
void removeUnreferencedGeometry(lanelet::LaneletMapPtr & lanelet_map_ptr) | |
void remove_unreferenced_geometry(lanelet::LaneletMapPtr & lanelet_map_ptr) |
if (!loadLaneletMap(llt_map_path, llt_map_ptr, projector)) { | ||
return EXIT_FAILURE; | ||
} | ||
removeUnreferencedGeometry(llt_map_ptr); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
invalid case style for function removeUnreferencedGeometry
removeUnreferencedGeometry(llt_map_ptr); | |
remove_unreferenced_geometry(llt_map_ptr); |
void removeUnreferencedGeometry(lanelet::LaneletMapPtr & lanelet_map_ptr) | ||
{ | ||
lanelet::LaneletMapPtr new_map(new lanelet::LaneletMap); | ||
for (auto llt : lanelet_map_ptr->laneletLayer) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
loop variable is copied but only used as const reference; consider making it a const reference
for (auto llt : lanelet_map_ptr->laneletLayer) { | |
for (const auto& llt : lanelet_map_ptr->laneletLayer) { |
#include <unordered_set> | ||
#include <vector> | ||
|
||
bool loadLaneletMap( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
invalid case style for function loadLaneletMap
bool loadLaneletMap( | |
bool load_lanelet_map( |
|
||
pcl::PointCloud<pcl::PointXYZ>::Ptr pcd_map_ptr(new pcl::PointCloud<pcl::PointXYZ>); | ||
|
||
if (!loadLaneletMap(llt_map_path, llt_map_ptr, projector)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
invalid case style for function loadLaneletMap
if (!loadLaneletMap(llt_map_path, llt_map_ptr, projector)) { | |
if (!load_lanelet_map(llt_map_path, llt_map_ptr, projector)) { |
return true; | ||
} | ||
|
||
bool loadPCDMap(const std::string & pcd_map_path, pcl::PointCloud<pcl::PointXYZ>::Ptr & pcd_map_ptr) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
invalid case style for function loadPCDMap
bool loadPCDMap(const std::string & pcd_map_path, pcl::PointCloud<pcl::PointXYZ>::Ptr & pcd_map_ptr) | |
bool load_pcd_map(const std::string & pcd_map_path, pcl::PointCloud<pcl::PointXYZ>::Ptr & pcd_map_ptr) |
if (!loadLaneletMap(llt_map_path, llt_map_ptr, projector)) { | ||
return EXIT_FAILURE; | ||
} | ||
if (!loadPCDMap(pcd_map_path, pcd_map_ptr)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
invalid case style for function loadPCDMap
if (!loadPCDMap(pcd_map_path, pcd_map_ptr)) { | |
if (!load_pcd_map(pcd_map_path, pcd_map_ptr)) { |
return true; | ||
} | ||
|
||
void transformMaps( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
invalid case style for function transformMaps
void transformMaps( | |
void transform_maps( |
node->declare_parameter<std::string>("mgrs_grid", projector.getProjectedMGRSGrid()); | ||
std::cout << "using mgrs grid: " << mgrs_grid << std::endl; | ||
|
||
transformMaps(pcd_map_ptr, llt_map_ptr, affine); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
invalid case style for function transformMaps
transformMaps(pcd_map_ptr, llt_map_ptr, affine); | |
transform_maps(pcd_map_ptr, llt_map_ptr, affine); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Clang-Tidy
found issue(s) with the introduced code (11/12)
|
||
void transformMaps( | ||
pcl::PointCloud<pcl::PointXYZ>::Ptr & pcd_map_ptr, lanelet::LaneletMapPtr & lanelet_map_ptr, | ||
const Eigen::Affine3d affine) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the const qualified parameter affine
is copied for each invocation; consider making it a reference
const Eigen::Affine3d affine) | |
const Eigen::Affine3d& affine) |
|
||
{ | ||
for (auto & pt : pcd_map_ptr->points) { | ||
Eigen::Vector3d eigen_pt(pt.x, pt.y, pt.z); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do not access members of unions; use (boost::)variant instead
|
||
{ | ||
for (auto & pt : pcd_map_ptr->points) { | ||
Eigen::Vector3d eigen_pt(pt.x, pt.y, pt.z); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do not access members of unions; use (boost::)variant instead
|
||
{ | ||
for (auto & pt : pcd_map_ptr->points) { | ||
Eigen::Vector3d eigen_pt(pt.x, pt.y, pt.z); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do not access members of unions; use (boost::)variant instead
for (auto & pt : pcd_map_ptr->points) { | ||
Eigen::Vector3d eigen_pt(pt.x, pt.y, pt.z); | ||
auto transformed_pt = affine * eigen_pt; | ||
pt.x = transformed_pt.x(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do not access members of unions; use (boost::)variant instead
for (auto & pt : pcd_map_ptr->points) { | ||
Eigen::Vector3d eigen_pt(pt.x, pt.y, pt.z); | ||
auto transformed_pt = affine * eigen_pt; | ||
pt.x = transformed_pt.x(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
narrowing conversion from Eigen::DenseCoeffsBase<Eigen::Matrix<double, 3, 1, 0>, 1>::Scalar
(aka double
) to float
Eigen::Vector3d eigen_pt(pt.x, pt.y, pt.z); | ||
auto transformed_pt = affine * eigen_pt; | ||
pt.x = transformed_pt.x(); | ||
pt.y = transformed_pt.y(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do not access members of unions; use (boost::)variant instead
Eigen::Vector3d eigen_pt(pt.x, pt.y, pt.z); | ||
auto transformed_pt = affine * eigen_pt; | ||
pt.x = transformed_pt.x(); | ||
pt.y = transformed_pt.y(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
narrowing conversion from Eigen::DenseCoeffsBase<Eigen::Matrix<double, 3, 1, 0>, 1>::Scalar
(aka double
) to float
auto transformed_pt = affine * eigen_pt; | ||
pt.x = transformed_pt.x(); | ||
pt.y = transformed_pt.y(); | ||
pt.z = transformed_pt.z(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do not access members of unions; use (boost::)variant instead
auto transformed_pt = affine * eigen_pt; | ||
pt.x = transformed_pt.x(); | ||
pt.y = transformed_pt.y(); | ||
pt.z = transformed_pt.z(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
narrowing conversion from Eigen::DenseCoeffsBase<Eigen::Matrix<double, 3, 1, 0>, 1>::Scalar
(aka double
) to float
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Clang-Tidy
found issue(s) with the introduced code (12/12)
} | ||
} | ||
|
||
Eigen::Affine3d createAffineMatrixFromXYZRPY( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
invalid case style for function createAffineMatrixFromXYZRPY
Eigen::Affine3d createAffineMatrixFromXYZRPY( | |
Eigen::Affine3d create_affine_matrix_from_xyzrpy( |
if (!loadPCDMap(pcd_map_path, pcd_map_ptr)) { | ||
return EXIT_FAILURE; | ||
} | ||
Eigen::Affine3d affine = createAffineMatrixFromXYZRPY(x, y, z, roll, pitch, yaw); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
invalid case style for function createAffineMatrixFromXYZRPY
Eigen::Affine3d affine = createAffineMatrixFromXYZRPY(x, y, z, roll, pitch, yaw); | |
Eigen::Affine3d affine = create_affine_matrix_from_xyzrpy(x, y, z, roll, pitch, yaw); |
return trans * rot; | ||
} | ||
|
||
int main(int argc, char * argv[]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
an exception may be thrown in function main
which should not throw exceptions
THIS IF FOR TESTING UPDATED CI
DO NOT MERGE THIS PULL REQUEST!!!!