Make ament_cpplint pass (#298)
Collection of hand-made changes to make ament_cpplint pass consisting of: - whitespace between comments - line length - header ordering - include guard formats - remove a couple `using namespace std;` - using c++ casts instead of c-style casts Signed-off-by: Sean Kelly <sean@seankelly.dev>
This commit is contained in:
@@ -44,16 +44,17 @@ Cloud Data) format.
|
||||
|
||||
**/
|
||||
|
||||
#include <sstream>
|
||||
#include <boost/filesystem.hpp>
|
||||
#include <rosbag/bag.h>
|
||||
#include <rosbag/view.h>
|
||||
#include <pcl/io/io.h>
|
||||
#include <pcl/io/pcd_io.h>
|
||||
#include <pcl_conversions/pcl_conversions.h>
|
||||
#include "pcl_ros/transforms.hpp"
|
||||
#include <tf/transform_listener.h>
|
||||
#include <tf/transform_broadcaster.h>
|
||||
#include <boost/filesystem.hpp>
|
||||
#include <sstream>
|
||||
#include <string>
|
||||
#include "pcl_ros/transforms.hpp"
|
||||
|
||||
typedef sensor_msgs::PointCloud2 PointCloud;
|
||||
typedef PointCloud::Ptr PointCloudPtr;
|
||||
|
||||
@@ -53,6 +53,7 @@
|
||||
#include <pcl/io/pcd_io.h>
|
||||
#include <pcl/point_types.h>
|
||||
#include <pcl_conversions/pcl_conversions.h>
|
||||
#include <string>
|
||||
|
||||
/* ---[ */
|
||||
int
|
||||
@@ -72,12 +73,12 @@ main(int argc, char ** argv)
|
||||
pcl::io::loadPCDFile(std::string(argv[1]), cloud);
|
||||
|
||||
try {
|
||||
pcl::toROSMsg(cloud, image); //convert the cloud
|
||||
pcl::toROSMsg(cloud, image); // convert the cloud
|
||||
} catch (std::runtime_error & e) {
|
||||
ROS_ERROR_STREAM(
|
||||
"Error in converting cloud to image message: " <<
|
||||
e.what());
|
||||
return 1; //fail!
|
||||
return 1; // fail!
|
||||
}
|
||||
ros::Rate loop_rate(5);
|
||||
while (nh.ok()) {
|
||||
|
||||
@@ -40,14 +40,14 @@
|
||||
**/
|
||||
// ROS core
|
||||
#include <ros/ros.h>
|
||||
//Image message
|
||||
// Image message
|
||||
#include <sensor_msgs/Image.h>
|
||||
#include <sensor_msgs/PointCloud2.h>
|
||||
//pcl::toROSMsg
|
||||
// pcl::toROSMsg
|
||||
#include <pcl/io/pcd_io.h>
|
||||
//conversions from PCL custom types
|
||||
// conversions from PCL custom types
|
||||
#include <pcl_conversions/pcl_conversions.h>
|
||||
//stl stuff
|
||||
// stl stuff
|
||||
#include <string>
|
||||
|
||||
class PointCloudToImage
|
||||
@@ -61,9 +61,9 @@ public:
|
||||
return;
|
||||
}
|
||||
try {
|
||||
pcl::toROSMsg(*cloud, image_); //convert the cloud
|
||||
pcl::toROSMsg(*cloud, image_); // convert the cloud
|
||||
image_.header = cloud->header;
|
||||
image_pub_.publish(image_); //publish our cloud image
|
||||
image_pub_.publish(image_); // publish our cloud image
|
||||
} catch (std::runtime_error & e) {
|
||||
ROS_ERROR_STREAM(
|
||||
"Error in converting cloud to image message: " <<
|
||||
@@ -78,7 +78,7 @@ public:
|
||||
&PointCloudToImage::cloud_cb, this);
|
||||
image_pub_ = nh_.advertise<sensor_msgs::Image>(image_topic_, 30);
|
||||
|
||||
//print some info about the node
|
||||
// print some info about the node
|
||||
std::string r_ct = nh_.resolveName(cloud_topic_);
|
||||
std::string r_it = nh_.resolveName(image_topic_);
|
||||
ROS_INFO_STREAM("Listening for incoming data on topic " << r_ct);
|
||||
@@ -87,18 +87,18 @@ public:
|
||||
|
||||
private:
|
||||
ros::NodeHandle nh_;
|
||||
sensor_msgs::Image image_; //cache the image message
|
||||
std::string cloud_topic_; //default input
|
||||
std::string image_topic_; //default output
|
||||
ros::Subscriber sub_; //cloud subscriber
|
||||
ros::Publisher image_pub_; //image message publisher
|
||||
sensor_msgs::Image image_; // cache the image message
|
||||
std::string cloud_topic_; // default input
|
||||
std::string image_topic_; // default output
|
||||
ros::Subscriber sub_; // cloud subscriber
|
||||
ros::Publisher image_pub_; // image message publisher
|
||||
};
|
||||
|
||||
int
|
||||
main(int argc, char ** argv)
|
||||
{
|
||||
ros::init(argc, argv, "convert_pointcloud_to_image");
|
||||
PointCloudToImage pci; //this loads up the node
|
||||
ros::spin(); //where she stops nobody knows
|
||||
PointCloudToImage pci; // this loads up the node
|
||||
ros::spin(); // where she stops nobody knows
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -43,10 +43,6 @@
|
||||
|
||||
**/
|
||||
|
||||
// STL
|
||||
#include <chrono>
|
||||
#include <thread>
|
||||
|
||||
// ROS core
|
||||
#include <ros/ros.h>
|
||||
#include <pcl/io/io.h>
|
||||
@@ -54,14 +50,17 @@
|
||||
#include <pcl/point_types.h>
|
||||
#include <pcl_conversions/pcl_conversions.h>
|
||||
|
||||
#include "pcl_ros/publisher.hpp"
|
||||
// STL
|
||||
#include <chrono>
|
||||
#include <string>
|
||||
#include <thread>
|
||||
|
||||
using namespace std;
|
||||
#include "pcl_ros/publisher.hpp"
|
||||
|
||||
class PCDGenerator
|
||||
{
|
||||
protected:
|
||||
string tf_frame_;
|
||||
std::string tf_frame_;
|
||||
ros::NodeHandle nh_;
|
||||
ros::NodeHandle private_nh_;
|
||||
|
||||
@@ -69,7 +68,7 @@ public:
|
||||
// ROS messages
|
||||
sensor_msgs::PointCloud2 cloud_;
|
||||
|
||||
string file_name_, cloud_topic_;
|
||||
std::string file_name_, cloud_topic_;
|
||||
double wait_;
|
||||
|
||||
pcl_ros::Publisher<sensor_msgs::PointCloud2> pub_;
|
||||
@@ -105,7 +104,7 @@ public:
|
||||
bool spin()
|
||||
{
|
||||
int nr_points = cloud_.width * cloud_.height;
|
||||
string fields_list = pcl::getFieldsList(cloud_);
|
||||
std::string fields_list = pcl::getFieldsList(cloud_);
|
||||
double interval = wait_ * 1e+6;
|
||||
while (nh_.ok()) {
|
||||
ROS_DEBUG_ONCE(
|
||||
@@ -132,8 +131,6 @@ public:
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
};
|
||||
|
||||
/* ---[ */
|
||||
@@ -149,7 +146,7 @@ main(int argc, char ** argv)
|
||||
ros::init(argc, argv, "pcd_to_pointcloud");
|
||||
|
||||
PCDGenerator c;
|
||||
c.file_name_ = string(argv[1]);
|
||||
c.file_name_ = std::string(argv[1]);
|
||||
// check if publishing interval is given
|
||||
if (argc == 2) {
|
||||
c.wait_ = 0;
|
||||
|
||||
@@ -53,7 +53,8 @@
|
||||
|
||||
#include <Eigen/Geometry>
|
||||
|
||||
using namespace std;
|
||||
// STL
|
||||
#include <string>
|
||||
|
||||
/**
|
||||
\author Radu Bogdan Rusu
|
||||
@@ -76,7 +77,7 @@ private:
|
||||
tf2_ros::TransformListener tf_listener_;
|
||||
|
||||
public:
|
||||
string cloud_topic_;
|
||||
std::string cloud_topic_;
|
||||
|
||||
ros::Subscriber sub_;
|
||||
|
||||
@@ -131,7 +132,6 @@ public:
|
||||
} else {
|
||||
writer.writeASCII(ss.str(), *cloud, v, q, 8);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
Reference in New Issue
Block a user