37 #include <boost/random.hpp> 42 const std::string& model_name,
43 pcl::PointCloud<PointT>& output,
46 output.points.clear();
47 if (model_name ==
"flat") {
48 flat(output, hole_rate);
50 else if (model_name ==
"stairs") {
53 else if (model_name ==
"hills") {
54 hills(output, hole_rate);
56 else if (model_name ==
"gaussian") {
59 else if (model_name ==
"flat_pole") {
66 boost::mt19937 gen( static_cast<unsigned long>(time(0)) );
67 boost::uniform_real<> dst( 0, 100 );
68 boost::variate_generator<
69 boost::mt19937&, boost::uniform_real<>
72 for (
double y = -4;
y < 4;
y =
y + 0.01) {
73 for (
double x = -4;
x < 4;
x =
x + 0.01) {
74 if (rand() >= hole_rate) {
78 output.points.push_back(p);
85 const Eigen::Vector3f& center,
89 double y0 = center[1] + width / 2.0;
90 double y1 = center[1] - width / 2.0;
91 double x0 = center[0] + width / 2.0;
92 double x1 = center[0] - width / 2.0;
93 for (
double x = x0;
x > x1;
x =
x - 0.01) {
94 for (
double z = 0;
z < height;
z =
z + 0.01) {
99 output.points.push_back(p);
102 for (
double y = y0;
y > y1;
y =
y - 0.01) {
103 for (
double z = 0;
z < height;
z =
z + 0.01) {
108 output.points.push_back(p);
111 for (
double x = x0;
x > x1;
x =
x - 0.01) {
112 for (
double z = 0;
z < height;
z =
z + 0.01) {
117 output.points.push_back(p);
120 for (
double y = y0;
y > y1;
y =
y - 0.01) {
121 for (
double z = 0;
z < height;
z =
z + 0.01) {
126 output.points.push_back(p);
133 boost::mt19937 gen( static_cast<unsigned long>(time(0)) );
134 boost::uniform_real<> dst( 0, 100 );
135 boost::variate_generator<
136 boost::mt19937&, boost::uniform_real<>
139 for (
double y = -4;
y < 4;
y =
y + 0.01) {
140 for (
double x = -4;
x < 4;
x =
x + 0.01) {
141 if (rand() >= hole_rate) {
145 output.points.push_back(p);
149 for (
double y = -4;
y < 4;
y =
y + 2.0) {
150 for (
double x = -4;
x < 4;
x =
x + 2.0) {
151 if (
x != 0.0 ||
y != 0.0) {
152 addPole(output, Eigen::Vector3f(
x,
y, 0), 0.2, 2.0);
160 boost::mt19937 gen( static_cast<unsigned long>(time(0)) );
161 boost::uniform_real<> dst( 0, 100 );
162 boost::variate_generator<
163 boost::mt19937&, boost::uniform_real<>
166 const double height = 0.1;
167 for (
double y = -4;
y < 4;
y =
y + 0.01) {
168 for (
double x = -4;
x < 4;
x =
x + 0.01) {
169 if (rand() >= hole_rate) {
173 p.z = height *
sin(
x * 2) *
sin(
y * 2);
174 output.points.push_back(p);
182 boost::mt19937 gen( static_cast<unsigned long>(time(0)) );
183 boost::uniform_real<> dst( 0, 100 );
184 boost::variate_generator<
185 boost::mt19937&, boost::uniform_real<>
187 const double height = 1.0;
188 const double sigma = 0.3;
189 for (
double y = -4;
y < 4;
y =
y + 0.01) {
190 for (
double x = -4;
x < 4;
x =
x + 0.01) {
191 if (rand() >= hole_rate) {
196 p.z = height *
exp(-
x*
x / (2 * sigma * 2)) *
exp(-
y*
y / (2 * sigma * 2));
197 output.points.push_back(p);
205 boost::mt19937 gen( static_cast<unsigned long>(time(0)) );
206 boost::uniform_real<> dst( 0, 100 );
207 boost::variate_generator<
208 boost::mt19937&, boost::uniform_real<>
211 for (
double y = -4;
y < 4;
y =
y + 0.01) {
221 for (
double x = -4;
x < 5;
x =
x + 0.01) {
222 if (rand() >= hole_rate) {
227 p.z = floor(
x * 3) * 0.1;
230 p.z = ceil(
x * 3) * 0.1;
232 output.points.push_back(p);
INLINE Rall1d< T, V, S > exp(const Rall1d< T, V, S > &arg)