Skip to content

Commit

Permalink
style(pre-commit): autofix
Browse files Browse the repository at this point in the history
  • Loading branch information
pre-commit-ci[bot] committed Jul 24, 2024
1 parent 698732e commit 7bd282f
Show file tree
Hide file tree
Showing 35 changed files with 1,250 additions and 1,168 deletions.
6 changes: 3 additions & 3 deletions perception/autoware_detection_by_tracker/package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,7 @@
<buildtool_depend>eigen3_cmake_module</buildtool_depend>

<depend>autoware_euclidean_cluster</depend>
<<<<<<< HEAD
=======
<depend>autoware_shape_estimation</depend>
>>>>>>> original/main
<depend>autoware_universe_utils</depend>
<depend>eigen</depend>
<depend>object_recognition_utils</depend>
Expand All @@ -27,6 +24,9 @@
<depend>tf2_geometry_msgs</depend>
<depend>tf2_ros</depend>
<depend>tier4_perception_msgs</depend>
<<<<<<< HEAD
=======
>>>>>>> original/main

<test_depend>ament_lint_auto</test_depend>
<test_depend>autoware_lint_common</test_depend>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,13 +80,16 @@ PlaneBasis getPlaneBasis(const Eigen::Vector3d & plane_normal)
return basis;
}

<<<<<<<< HEAD:perception/ground_segmentation/src/ransac_ground_filter/node.cpp
using pointcloud_preprocessor::get_param;
========
using autoware::pointcloud_preprocessor::get_param;
>>>>>>>> original/main:perception/autoware_ground_segmentation/src/ransac_ground_filter/node.cpp

RANSACGroundFilterComponent::RANSACGroundFilterComponent(const rclcpp::NodeOptions & options)
< < < < < < < < HEAD : perception / ground_segmentation / src / ransac_ground_filter /
node.cpp using pointcloud_preprocessor::get_param;
== == == == using autoware::pointcloud_preprocessor::get_param;
>>>>>>>> original /
main
: perception /
autoware_ground_segmentation / src / ransac_ground_filter /
node.cpp

RANSACGroundFilterComponent::RANSACGroundFilterComponent(const rclcpp::NodeOptions & options)
: Filter("RANSACGroundFilter", options)
{
base_frame_ = declare_parameter<std::string>("base_frame", "base_link");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,13 +58,16 @@
#include <tf2_eigen/tf2_eigen.hpp>
#endif

<<<<<<<< HEAD:perception/ground_segmentation/src/ray_ground_filter/node.hpp
<<<<<<<<
HEAD : perception / ground_segmentation / src / ray_ground_filter / node.hpp
#include "gencolors.hpp"
#include "pointcloud_preprocessor/filter.hpp"
========
== == == ==
#include "autoware/pointcloud_preprocessor/filter.hpp"
#include "gencolors.hpp"
>>>>>>>> original/main:perception/autoware_ground_segmentation/src/ray_ground_filter/node.hpp
>>>>>>>> original /
main : perception / autoware_ground_segmentation / src / ray_ground_filter /
node.hpp

#include <opencv2/core.hpp>
#include <opencv2/imgproc.hpp>
Expand All @@ -80,7 +83,7 @@
#include <string>
#include <vector>

namespace bg = boost::geometry;
namespace bg = boost::geometry;
using Point = bg::model::d2::point_xy<double>;
using Polygon = bg::model::polygon<Point>;

Expand Down Expand Up @@ -189,31 +192,33 @@ class RayGroundFilterComponent : public autoware::pointcloud_preprocessor::Filte
* @param out_only_indices_cloud_ptr Resulting PointCloud with the indices kept
* @param out_removed_indices_cloud_ptr Resulting PointCloud with the indices removed
*/
void ExtractPointsIndices(
const PointCloud2::ConstSharedPtr in_cloud_ptr, const pcl::PointIndices & in_indices,
<<<<<<<< HEAD:perception/ground_segmentation/src/ray_ground_filter/node.hpp
PointCloud2::SharedPtr out_only_indices_cloud_ptr,
PointCloud2::SharedPtr out_removed_indices_cloud_ptr);
void ExtractPointsIndices(const PointCloud2::ConstSharedPtr in_cloud_ptr,
const pcl::PointIndices & in_indices, < < < < < < < < HEAD
: perception / ground_segmentation / src / ray_ground_filter /
node.hpp PointCloud2::SharedPtr out_only_indices_cloud_ptr,
PointCloud2::SharedPtr out_removed_indices_cloud_ptr);
========
PointCloud2::SharedPtr ground_cloud_msg_ptr, PointCloud2::SharedPtr no_ground_cloud_msg_ptr);
>>>>>>>> original/main:perception/autoware_ground_segmentation/src/ray_ground_filter/node.hpp
>>>>>>>> original / main : perception / autoware_ground_segmentation / src / ray_ground_filter /
node.hpp

boost::optional<float> calcPointVehicleIntersection(const Point & point);
boost::optional<float>
calcPointVehicleIntersection(const Point & point);

void setVehicleFootprint(
const double min_x, const double max_x, const double min_y, const double max_y);
void initializePointCloud2(
const PointCloud2::ConstSharedPtr & in_cloud_ptr,
const PointCloud2::SharedPtr & out_cloud_msg_ptr);
/** \brief Parameter service callback result : needed to be hold */
OnSetParametersCallbackHandle::SharedPtr set_param_res_;
void setVehicleFootprint(
const double min_x, const double max_x, const double min_y, const double max_y);
void initializePointCloud2(
const PointCloud2::ConstSharedPtr & in_cloud_ptr,
const PointCloud2::SharedPtr & out_cloud_msg_ptr);
/** \brief Parameter service callback result : needed to be hold */
OnSetParametersCallbackHandle::SharedPtr set_param_res_;

/** \brief Parameter service callback */
rcl_interfaces::msg::SetParametersResult paramCallback(const std::vector<rclcpp::Parameter> & p);
/** \brief Parameter service callback */
rcl_interfaces::msg::SetParametersResult paramCallback(const std::vector<rclcpp::Parameter> & p);

public:
EIGEN_MAKE_ALIGNED_OPERATOR_NEW
explicit RayGroundFilterComponent(const rclcpp::NodeOptions & options);
EIGEN_MAKE_ALIGNED_OPERATOR_NEW
explicit RayGroundFilterComponent(const rclcpp::NodeOptions & options);
};
} // namespace autoware::ground_segmentation

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,11 @@ using autoware::universe_utils::normalizeDegree;
using autoware::universe_utils::normalizeRadian;
using autoware::vehicle_info_utils::VehicleInfoUtils;

ScanGroundFilterComponent::ScanGroundFilterComponent(const rclcpp::NodeOptions & options)
<<<<<<<< HEAD:perception/ground_segmentation/src/scan_ground_filter/node.cpp
: pointcloud_preprocessor::Filter("ScanGroundFilter", options)
========
: autoware::pointcloud_preprocessor::Filter("ScanGroundFilter", options)
>>>>>>>> original/main:perception/autoware_ground_segmentation/src/scan_ground_filter/node.cpp
ScanGroundFilterComponent::ScanGroundFilterComponent(const rclcpp::NodeOptions & options)<<<<<<<<
HEAD : perception / ground_segmentation / src / scan_ground_filter /
node.cpp : pointcloud_preprocessor::Filter("ScanGroundFilter", options) ==
== == == : autoware::pointcloud_preprocessor::Filter("ScanGroundFilter", options)>>>>>>>> original
/ main : perception / autoware_ground_segmentation / src / scan_ground_filter / node.cpp
{
// set initial parameters
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,18 @@
#ifndef SCAN_GROUND_FILTER__NODE_HPP_
#define SCAN_GROUND_FILTER__NODE_HPP_

<<<<<<<< HEAD:perception/ground_segmentation/src/scan_ground_filter/node.hpp
<<<<<<<<
HEAD : perception / ground_segmentation / src / scan_ground_filter / node.hpp
#include "autoware_vehicle_info_utils/vehicle_info.hpp"
#include "pointcloud_preprocessor/filter.hpp"
#include "pointcloud_preprocessor/transform_info.hpp"
========
== == == ==
#include "autoware/pointcloud_preprocessor/filter.hpp"
#include "autoware/pointcloud_preprocessor/transform_info.hpp"
#include "autoware_vehicle_info_utils/vehicle_info.hpp"
>>>>>>>> original/main:perception/autoware_ground_segmentation/src/scan_ground_filter/node.hpp
>>>>>>>> original /
main : perception / autoware_ground_segmentation / src / scan_ground_filter /
node.hpp

#include <sensor_msgs/msg/point_cloud2.hpp>

Expand All @@ -44,7 +47,7 @@
#include <string>
#include <vector>

class ScanGroundFilterTest;
class ScanGroundFilterTest;

namespace autoware::ground_segmentation
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,10 @@ The node `segmentation_pointcloud_fusion` is a package for filtering pointcloud
<<<<<<< HEAD:perception/image_projection_based_fusion/docs/segmentation-pointcloud-fusion.md
{{ json_to_markdown("perception/image_projection_based_fusion/schema/segmentation_pointcloud_fusion.schema.json") }}
=======

{{ json_to_markdown("perception/autoware_image_projection_based_fusion/schema/segmentation_pointcloud_fusion.schema.json") }}
>>>>>>> original/main:perception/autoware_image_projection_based_fusion/docs/segmentation-pointcloud-fusion.md

> > > > > > > original/main:perception/autoware_image_projection_based_fusion/docs/segmentation-pointcloud-fusion.md
## Assumptions / Known limits

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,75 +17,80 @@

#include "autoware/image_projection_based_fusion/fusion_node.hpp"
#include "autoware/image_projection_based_fusion/pointpainting_fusion/pointpainting_trt.hpp"
<<<<<<<< HEAD:perception/image_projection_based_fusion/include/autoware/image_projection_based_fusion/pointpainting_fusion/node.hpp
<<<<<<<<
HEAD : perception / image_projection_based_fusion / include / autoware /
image_projection_based_fusion / pointpainting_fusion / node.hpp
#include "lidar_centerpoint/postprocess/non_maximum_suppression.hpp"

#include <autoware/image_projection_based_fusion/utils/geometry.hpp>
#include <autoware/image_projection_based_fusion/utils/utils.hpp>
#include <lidar_centerpoint/centerpoint_trt.hpp>
#include <lidar_centerpoint/detection_class_remapper.hpp>
========
== == == ==
#include "autoware/lidar_centerpoint/postprocess/non_maximum_suppression.hpp"

#include <autoware/image_projection_based_fusion/utils/geometry.hpp>
#include <autoware/image_projection_based_fusion/utils/utils.hpp>
#include <autoware/lidar_centerpoint/centerpoint_trt.hpp>
#include <autoware/lidar_centerpoint/detection_class_remapper.hpp>
>>>>>>>> original/main:perception/autoware_image_projection_based_fusion/include/autoware/image_projection_based_fusion/pointpainting_fusion/node.hpp
>>>>>>>> original /
main : perception / autoware_image_projection_based_fusion / include / autoware /
image_projection_based_fusion / pointpainting_fusion /
node.hpp

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

namespace autoware::image_projection_based_fusion
namespace autoware::image_projection_based_fusion
{
using Label = autoware_perception_msgs::msg::ObjectClassification;
using Label = autoware_perception_msgs::msg::ObjectClassification;

inline bool isInsideBbox(
float proj_x, float proj_y, sensor_msgs::msg::RegionOfInterest roi, float zc)
{
// z_c is scaling to normalize projection point
return proj_x >= roi.x_offset * zc && proj_x <= (roi.x_offset + roi.width) * zc &&
proj_y >= roi.y_offset * zc && proj_y <= (roi.y_offset + roi.height) * zc;
}
inline bool isInsideBbox(
float proj_x, float proj_y, sensor_msgs::msg::RegionOfInterest roi, float zc)
{
// z_c is scaling to normalize projection point
return proj_x >= roi.x_offset * zc && proj_x <= (roi.x_offset + roi.width) * zc &&
proj_y >= roi.y_offset * zc && proj_y <= (roi.y_offset + roi.height) * zc;
}

class PointPaintingFusionNode
: public FusionNode<sensor_msgs::msg::PointCloud2, DetectedObjects, DetectedObjectsWithFeature>
{
public:
explicit PointPaintingFusionNode(const rclcpp::NodeOptions & options);
class PointPaintingFusionNode
: public FusionNode<sensor_msgs::msg::PointCloud2, DetectedObjects, DetectedObjectsWithFeature>
{
public:
explicit PointPaintingFusionNode(const rclcpp::NodeOptions & options);

protected:
void preprocess(sensor_msgs::msg::PointCloud2 & pointcloud_msg) override;
protected:
void preprocess(sensor_msgs::msg::PointCloud2 & pointcloud_msg) override;

void fuseOnSingleImage(
const sensor_msgs::msg::PointCloud2 & input_pointcloud_msg, const std::size_t image_id,
const DetectedObjectsWithFeature & input_roi_msg,
const sensor_msgs::msg::CameraInfo & camera_info,
sensor_msgs::msg::PointCloud2 & painted_pointcloud_msg) override;
void fuseOnSingleImage(
const sensor_msgs::msg::PointCloud2 & input_pointcloud_msg, const std::size_t image_id,
const DetectedObjectsWithFeature & input_roi_msg,
const sensor_msgs::msg::CameraInfo & camera_info,
sensor_msgs::msg::PointCloud2 & painted_pointcloud_msg) override;

void postprocess(sensor_msgs::msg::PointCloud2 & painted_pointcloud_msg) override;
void postprocess(sensor_msgs::msg::PointCloud2 & painted_pointcloud_msg) override;

rclcpp::Publisher<DetectedObjects>::SharedPtr obj_pub_ptr_;
rclcpp::Publisher<DetectedObjects>::SharedPtr obj_pub_ptr_;

std::vector<double> tan_h_; // horizontal field of view
std::vector<double> tan_h_; // horizontal field of view

int omp_num_threads_{1};
float score_threshold_{0.0};
std::vector<std::string> class_names_;
std::map<std::string, float> class_index_;
std::map<std::string, std::function<bool(int)>> isClassTable_;
std::vector<double> pointcloud_range;
bool has_variance_{false};
bool has_twist_{false};
int omp_num_threads_{1};
float score_threshold_{0.0};
std::vector<std::string> class_names_;
std::map<std::string, float> class_index_;
std::map<std::string, std::function<bool(int)>> isClassTable_;
std::vector<double> pointcloud_range;
bool has_variance_{false};
bool has_twist_{false};

autoware::lidar_centerpoint::NonMaximumSuppression iou_bev_nms_;
autoware::lidar_centerpoint::DetectionClassRemapper detection_class_remapper_;
autoware::lidar_centerpoint::NonMaximumSuppression iou_bev_nms_;
autoware::lidar_centerpoint::DetectionClassRemapper detection_class_remapper_;

std::unique_ptr<image_projection_based_fusion::PointPaintingTRT> detector_ptr_{nullptr};
std::unique_ptr<image_projection_based_fusion::PointPaintingTRT> detector_ptr_{nullptr};

bool out_of_scope(const DetectedObjects & obj);
};
bool out_of_scope(const DetectedObjects & obj);
};
} // namespace autoware::image_projection_based_fusion
#endif // AUTOWARE__IMAGE_PROJECTION_BASED_FUSION__POINTPAINTING_FUSION__NODE_HPP_
Original file line number Diff line number Diff line change
Expand Up @@ -16,41 +16,46 @@
#define AUTOWARE__IMAGE_PROJECTION_BASED_FUSION__POINTPAINTING_FUSION__VOXEL_GENERATOR_HPP_

#include <autoware/image_projection_based_fusion/pointpainting_fusion/pointcloud_densification.hpp>
<<<<<<<< HEAD:perception/image_projection_based_fusion/include/autoware/image_projection_based_fusion/pointpainting_fusion/voxel_generator.hpp
<<<<<<<<
HEAD : perception / image_projection_based_fusion / include / autoware /
image_projection_based_fusion / pointpainting_fusion / voxel_generator.hpp
#include <lidar_centerpoint/preprocess/pointcloud_densification.hpp>
#include <lidar_centerpoint/preprocess/voxel_generator.hpp>
========
== == == ==
#include <autoware/lidar_centerpoint/preprocess/pointcloud_densification.hpp>
#include <autoware/lidar_centerpoint/preprocess/voxel_generator.hpp>
>>>>>>>> original/main:perception/autoware_image_projection_based_fusion/include/autoware/image_projection_based_fusion/pointpainting_fusion/voxel_generator.hpp
>>>>>>>> original /
main : perception / autoware_image_projection_based_fusion / include / autoware /
image_projection_based_fusion / pointpainting_fusion /
voxel_generator.hpp

#include <bitset>
#include <memory>
#include <vector>

namespace autoware::image_projection_based_fusion
namespace autoware::image_projection_based_fusion
{

class VoxelGenerator
{
public:
explicit VoxelGenerator(
const autoware::lidar_centerpoint::DensificationParam & param,
const autoware::lidar_centerpoint::CenterPointConfig & config);

bool enqueuePointCloud(
const sensor_msgs::msg::PointCloud2 & input_pointcloud_msg, const tf2_ros::Buffer & tf_buffer);

std::size_t generateSweepPoints(std::vector<float> & points);

protected:
std::unique_ptr<PointCloudDensification> pd_ptr_{nullptr};

autoware::lidar_centerpoint::CenterPointConfig config_;
std::array<float, 6> range_;
std::array<int, 3> grid_size_;
std::array<float, 3> recip_voxel_size_;
};
class VoxelGenerator
{
public:
explicit VoxelGenerator(
const autoware::lidar_centerpoint::DensificationParam & param,
const autoware::lidar_centerpoint::CenterPointConfig & config);

bool enqueuePointCloud(
const sensor_msgs::msg::PointCloud2 & input_pointcloud_msg,
const tf2_ros::Buffer & tf_buffer);

std::size_t generateSweepPoints(std::vector<float> & points);

protected:
std::unique_ptr<PointCloudDensification> pd_ptr_{nullptr};

autoware::lidar_centerpoint::CenterPointConfig config_;
std::array<float, 6> range_;
std::array<int, 3> grid_size_;
std::array<float, 3> recip_voxel_size_;
};
} // namespace autoware::image_projection_based_fusion

#endif // AUTOWARE__IMAGE_PROJECTION_BASED_FUSION__POINTPAINTING_FUSION__VOXEL_GENERATOR_HPP_
Loading

0 comments on commit 7bd282f

Please sign in to comment.