43 #include <gtest/gtest.h> 44 #include <sensor_msgs/PointCloud2.h> 45 #include <pcl_msgs/PointIndices.h> 71 #if ROS_VERSION_MINIMUM(1,14,0) // melodic 86 ROS_INFO(
"took %f sec to retrieve result", (end_time - start_time).toSec());
93 for (
size_t i = 0; i < 1000; i++) {
95 p.x = i; p.y = 0; p.z = 0;
110 ROS_INFO(
"even_cloud_ %d, odd_cloud_ %d, even_organized_cloud_ %d, odd_organized_cloud_ %d",
126 virtual void evenCallback(
const sensor_msgs::PointCloud2::ConstPtr& cloud_msg)
129 even_cloud_.reset(
new pcl::PointCloud<pcl::PointXYZ>);
133 virtual void oddCallback(
const sensor_msgs::PointCloud2::ConstPtr& cloud_msg)
136 odd_cloud_.reset(
new pcl::PointCloud<pcl::PointXYZ>);
168 for (
size_t i = 0; i <
even_cloud_->points.size(); i++) {
176 for (
size_t i = 0; i <
odd_cloud_->points.size(); i++) {
184 size_t non_nan_count = 0;
197 size_t non_nan_count = 0;
208 int main(
int argc,
char** argv)
210 ros::init(argc, argv,
"test_extract_indices");
211 #if ROS_VERSION_MINIMUM(1,14,0) // melodic 215 testing::InitGoogleTest(&argc, argv);
216 return RUN_ALL_TESTS();
void publish(const boost::shared_ptr< M > &message) const
Subscriber subscribe(const std::string &topic, uint32_t queue_size, void(T::*fp)(M), T *obj, const TransportHints &transport_hints=TransportHints())
ROSCPP_DECL void init(int &argc, char **argv, const std::string &name, uint32_t options=0)
void fromROSMsg(const sensor_msgs::PointCloud2 &cloud, pcl::PointCloud< T > &pcl_cloud)
#define EXPECT_FLOAT_EQ(a, b)
Publisher advertise(const std::string &topic, uint32_t queue_size, bool latch=false)
void toROSMsg(const pcl::PointCloud< T > &pcl_cloud, sensor_msgs::PointCloud2 &cloud)
boost::mutex mutex
global mutex.
ROSCPP_DECL void spinOnce()