[ros2] lint the pcl_ros code base to try and get a green build :) (#406)

* Lint!

* Fix flake8 errors

* Fix clang-tidy errors

* Remove [[maybe_unused]]
This commit is contained in:
Andrew Symington
2023-02-24 13:03:08 -08:00
committed by GitHub
parent 3966b71ad6
commit 1e544f132e
14 changed files with 110 additions and 105 deletions
+7 -4
View File
@@ -37,7 +37,6 @@
#ifndef PCL_ROS__IMPL__TRANSFORMS_HPP_
#define PCL_ROS__IMPL__TRANSFORMS_HPP_
#include "pcl_ros/transforms.hpp"
#include <pcl/common/transforms.h>
#include <pcl_conversions/pcl_conversions.h>
#include <tf2/convert.h>
@@ -45,14 +44,18 @@
#include <tf2/LinearMath/Transform.h>
#include <tf2/LinearMath/Quaternion.h>
#include <tf2/LinearMath/Vector3.h>
#include <tf2_geometry_msgs/tf2_geometry_msgs.hpp>
#include <tf2_ros/buffer.h>
#include <tf2_ros/transform_listener.h>
#include <Eigen/Dense>
#include <string>
#include <tf2_geometry_msgs/tf2_geometry_msgs.hpp>
#include <geometry_msgs/msg/transform_stamped.hpp>
#include <rclcpp/logging.hpp>
#include <rclcpp/time.hpp>
#include <Eigen/Dense>
#include <string>
#include "pcl_ros/transforms.hpp"
using pcl_conversions::fromPCL;
using pcl_conversions::toPCL;
+1 -1
View File
@@ -38,11 +38,11 @@
#ifndef PCL_ROS__IO__BAG_IO_HPP_
#define PCL_ROS__IO__BAG_IO_HPP_
#include <pcl_ros/pcl_nodelet.hpp>
#include <sensor_msgs/PointCloud2.h>
#include <rosbag/bag.h>
#include <rosbag/view.h>
#include <string>
#include <pcl_ros/pcl_nodelet.hpp>
namespace pcl_ros
{
+16 -17
View File
@@ -44,30 +44,25 @@
#ifndef PCL_ROS__PCL_NODE_HPP_
#define PCL_ROS__PCL_NODE_HPP_
#include <sensor_msgs/msg/point_cloud2.hpp>
// PCL includes
#include <pcl_msgs/msg/point_indices.hpp>
#include <pcl_msgs/msg/model_coefficients.hpp>
#include <pcl/pcl_base.h>
#include <pcl/point_types.h>
#include <pcl_conversions/pcl_conversions.h>
// ROS Nodelet includes
// #include <nodelet_topic_tools/nodelet_lazy.h> // TODO(daisukes): lazy subscription
#include <message_filters/subscriber.h>
#include <message_filters/synchronizer.h>
#include <message_filters/sync_policies/exact_time.h>
#include <message_filters/sync_policies/approximate_time.h>
// Include TF
#include <pcl/pcl_base.h>
#include <pcl/point_types.h>
#include <pcl_conversions/pcl_conversions.h>
#include <tf2_ros/transform_listener.h>
#include <tf2_ros/buffer.h>
// #include <nodelet_topic_tools/nodelet_lazy.h> // TODO(daisukes): lazy subscription
// STL
#include <memory>
#include <string>
#include <vector>
// ROS2 includes
#include <rclcpp/rclcpp.hpp>
#include <sensor_msgs/msg/point_cloud2.hpp>
#include <pcl_msgs/msg/point_indices.hpp>
#include <pcl_msgs/msg/model_coefficients.hpp>
// #include "pcl_ros/point_cloud.hpp"
@@ -199,9 +194,9 @@ protected:
bool approximate_sync_;
/** \brief TF listener object. */
tf2_ros::TransformListener tf_listener_;
tf2_ros::Buffer tf_buffer_;
tf2_ros::TransformListener tf_listener_;
/** \brief Test whether a given PointCloud message is "valid" (i.e., has points, and width and height are non-zero).
* \param cloud the point cloud to test
* \param topic_name an optional topic name (only used for printing, defaults to "input")
@@ -249,7 +244,9 @@ protected:
* \param topic_name an optional topic name (only used for printing, defaults to "indices")
*/
inline bool
isValid(const PointIndicesConstPtr & indices, const std::string & topic_name = "indices")
isValid(
const PointIndicesConstPtr & /*indices*/,
const std::string & /*topic_name*/ = "indices")
{
/*if (indices->indices.empty ())
{
@@ -269,7 +266,9 @@ protected:
* \param topic_name an optional topic name (only used for printing, defaults to "model")
*/
inline bool
isValid(const ModelCoefficientsConstPtr & model, const std::string & topic_name = "model")
isValid(
const ModelCoefficientsConstPtr & /*model*/,
const std::string & /*topic_name*/ = "model")
{
/*if (model->values.empty ())
{
+5 -5
View File
@@ -44,12 +44,12 @@
#include <ros/ros.h>
#include <pcl/point_cloud.h>
#include <pcl/pcl_config.h> // for PCL_VERSION_COMPARE
#include <pcl/pcl_config.h> // for PCL_VERSION_COMPARE
#if PCL_VERSION_COMPARE(>=, 1, 11, 0)
#include <pcl/type_traits.h>
#else
#include <pcl/point_traits.h>
#endif // PCL_VERSION_COMPARE(>=, 1, 11, 0)
#endif // PCL_VERSION_COMPARE(>=, 1, 11, 0)
#include <pcl/for_each_type.h>
#include <pcl/conversions.h>
#if ROS_POINTER_COMPATIBILITY_IMPLEMENTED
@@ -61,9 +61,6 @@
#endif
#include <pcl_conversions/pcl_conversions.h>
#include <sensor_msgs/PointCloud2.h>
#include <boost/foreach.hpp> // for BOOST_FOREACH
#include <boost/mpl/size.hpp>
#include <boost/ref.hpp>
#include <string>
#include <utility>
#include <vector>
@@ -71,6 +68,9 @@
#include <type_traits>
#include <memory>
#endif
#include <boost/foreach.hpp> // for BOOST_FOREACH
#include <boost/mpl/size.hpp>
#include <boost/ref.hpp>
namespace pcl
{
+2 -2
View File
@@ -41,11 +41,11 @@
#include <tf2/LinearMath/Transform.h>
#include <tf2_ros/buffer.h>
#include <tf2_ros/transform_listener.h>
#include <Eigen/Dense>
#include <string>
#include <rclcpp/time.hpp>
#include <sensor_msgs/msg/point_cloud2.hpp>
#include <geometry_msgs/msg/transform_stamped.hpp>
#include <Eigen/Dense>
#include <string>
namespace pcl_ros
{