39 #include <ar_track_alvar/kinect_filtering.h> 51 const float u =
static_cast<float>(rand())/RAND_MAX;
57 a::ARCloud::Ptr
generateCloud(
const double px,
const double py,
const double pz,
58 const double vx,
const double vy,
const double vz,
59 const double wx,
const double wy,
const double wz)
62 const double NOISE=0.01;
64 a::ARCloud::Ptr cloud(boost::make_shared<a::ARCloud>());
65 for (
double u=0; u<1+INC/2; u+=INC)
67 for (
double v=0; v<1+INC/2; v+=INC)
70 p.x = px+u*vx+v*wx+
randFloat(-NOISE, NOISE);
71 p.y = py+u*vy+v*wy+
randFloat(-NOISE, NOISE);
72 p.z = pz+u*vz+v*wz+
randFloat(-NOISE, NOISE);
73 cloud->points.push_back(p);
79 int main (
int argc,
char** argv)
87 f >> pt.x >> pt.y >> pt.z;
88 cloud->points.push_back(pt);
90 ROS_INFO(
"Cloud has %zu points such as (%.2f, %.2f, %.2f)",
91 cloud->points.size(), cloud->points[0].x, cloud->points[0].y,
105 ROS_INFO(
"Plane equation is %.3fx + %.3fy + %.3fz + %.3f = 0",
pcl::PointCloud< ARPoint > ARCloud
int main(int argc, char **argv)
int extractOrientation(const pcl::ModelCoefficients &coeffs, const ARPoint &p1, const ARPoint &p2, const ARPoint &p3, const ARPoint &p4, geometry_msgs::Quaternion &retQ)
ROSCPP_DECL void init(int &argc, char **argv, const std::string &name, uint32_t options=0)
float randFloat(float a, float b)
#define ROS_INFO_STREAM(args)
pcl::ModelCoefficients coeffs
a::ARCloud::Ptr generateCloud(const double px, const double py, const double pz, const double vx, const double vy, const double vz, const double wx, const double wy, const double wz)
PlaneFitResult fitPlane(ARCloud::ConstPtr cloud)