superquadric-model
Public Member Functions | Protected Member Functions | Protected Attributes
SuperqModule Class Reference

The SuperqModule class handle the superquadric computation and visualization, the point cloud and superquadric filtering and the interaction with the user. More...

#include <superqModule.h>

Inheritance diagram for SuperqModule:
superquadricModel_IDL

Public Member Functions

double getPeriod ()
 Get period function of RF module. More...
 
bool updateModule ()
 updateModule function of RF module
 
bool configure (yarp::os::ResourceFinder &rf)
 configure function of RF module
 
bool interruptModule ()
 interrupt module function of RF module
 
bool close ()
 close function of RF module
 
bool configOnOff (yarp::os::ResourceFinder &rf)
 Configure all on/off options.
 
bool configFilter (yarp::os::ResourceFinder &rf)
 Configure point cloud filter options.
 
bool configFilterSuperq (yarp::os::ResourceFinder &rf)
 Configure superquadric filter options.
 
bool configServices (yarp::os::ResourceFinder &rf)
 Open ports for communication.
 
bool configSuperq (yarp::os::ResourceFinder &rf)
 Configure superquadric computation otpions.
 
bool configViewer (yarp::os::ResourceFinder &rf)
 Configure visualization options.
 
void saveSuperq ()
 Save computed superquadric.
 
bool set_save_points (const std::string &entry)
 Set if to save or not the used point cloud. More...
 
std::string get_save_points ()
 Get if the used point cloud is saved or not. More...
 
bool readPointCloud ()
 In offline mode, read the point cloud from a txt file.
 
virtual yarp::os::Property get_superq (const std::vector< yarp::sig::Vector > &point_cloud, const bool filtered_or_not, const bool reset_or_not)
 Get the parameters of the reconstructed superquadric. More...
 
virtual bool read (yarp::os::ConnectionReader &connection)
 
virtual std::vector< std::string > help (const std::string &functionName="--all")
 

Protected Member Functions

bool attach (yarp::os::RpcServer &source)
 
bool set_tag_file (const std::string &tag_file)
 Set a tag name for saving the superquadric. More...
 
std::string get_tag_file ()
 Get the tag name used for saving the superquadric. More...
 
std::string get_visualization ()
 Return if visualization is on or off. More...
 
bool set_visualization (const std::string &e)
 Set if visualization is on or off. More...
 
yarp::os::Property get_superq (const std::vector< yarp::sig::Vector > &blob)
 Return the computed superquadric, given the 2D blob of the object. More...
 
bool send_point_clouds (const std::vector< yarp::sig::Vector > &p)
 Get the point cloud for computing the superquadric. More...
 
bool reset_filter ()
 Reset median filter for improving superquadric estimation. More...
 
yarp::os::Property get_superq_filtered ()
 Return the filtered superquadric. More...
 
yarp::os::Property fillProperty (const yarp::sig::Vector &sol)
 Property fill the property with the superquadric solution. More...
 
bool set_points_filtering (const std::string &entry)
 Set if to filter or not the point cloud. More...
 
std::string get_points_filtering ()
 Get if the point cloud is filtered or not. More...
 
bool set_superq_filtering (const std::string &entry)
 Set if to filter or not the superquadric. More...
 
std::string get_superq_filtering ()
 Get if the superquadric is filtered or not. More...
 
yarp::os::Property get_options (const std::string &field)
 Get options of a given field: visualization, optimization, filtering. More...
 
bool set_options (const yarp::os::Property &newOptions, const std::string &field)
 Set options of specified field: visualization, optimization, filtering. More...
 
bool set_object_class (const std::string &objclass)
 Set object class for improving superquadric estimation. More...
 

Protected Attributes

int r
 Red value for visualization.
 
int g
 Green value for visualization.
 
int b
 Blue value for visualization.
 
int count
 Count variable.
 
int rate
 Computation thread rate.
 
int rate_vis
 Visualization thread rate.
 
std::string tag_file
 Tag name of files for saving 3D points.
 
std::string homeContextPath
 Path where code context is located.
 
yarp::os::ConstString pointCloudFileName
 Pointcloud name file in case the module runs offline.
 
std::string outputFileName
 Output file name saving the estimated superquadric.
 
std::vector< cv::Point > contour
 OpenCV variable for blob extraction.
 
std::deque< yarp::sig::Vector > points
 3D points used for reconstructing the superquadric
 
std::deque< yarp::sig::Vector > points_aux
 3D points auxiliary used for reconstructing the superquadric
 
std::deque< cv::Point > blob_points
 2D points of the segmented object
 
double radius
 Radius for spatial density filter.
 
int nnThreshold
 Density threshold for spatial density filter.
 
int numVertices
 
int median_order
 Median filder order.
 
int min_median_order
 Minimum median filder order allowed.
 
int max_median_order
 Maximum median filder order allowed.
 
int new_median_order
 New median filder order estimated.
 
bool filter_points
 Boolean variable for enabling point cloud filtering.
 
bool fixed_window
 Boolean variable for enabling the use of a fixed window during the median filter.
 
bool filter_superq
 Boolean variable for enabling superquadric filtering.
 
std::string what_to_plot
 String used for deciding what to plot: "points" or "superq".
 
double threshold_median
 Threshold for velocity estimation for median order.
 
double min_norm_vel
 Minimum norm of velocity for considering the object moving.
 
bool mode_online
 Boolean variable for enabling online or offline mode.
 
bool visualization_on
 Boolean variable for enabling visualization.
 
bool go_on
 Boolean variable for going to the next step of the state machine.
 
bool reset
 Boolean variable for resetting the median filter.
 
bool save_points
 Boolean variable for enabling point cloud saving.
 
double tol
 Tolerance of the optimization problem.
 
double sum
 
double max_cpu_time
 Max cpu time allowed for solving the optimization problem.
 
int acceptable_iter
 Acceptable iter of Ipopt algorithm.
 
int max_iter
 Maximum iteration allowed of Ipopt algorithm.
 
int optimizer_points
 Number of 3D points used for optimization.
 
std::string mu_strategy
 Mu strategy of the Ipopt algorithm.
 
std::string nlp_scaling_method
 NLP scaling method of the Ipopt algorithm.
 
yarp::sig::Vector x
 Estimated superquadric.
 
yarp::sig::Vector x_filtered
 Filtered superquadric.
 
double t_superq
 Time required for computing superquadric.
 
std::deque< double > times_superq
 Times used for computing several superquadrics.
 
double t_vis
 Time for visualization.
 
std::deque< double > times_vis
 Collections of times required for visualization.
 
yarp::os::BufferedPort< yarp::os::Property > portSuperq
 Port for streaming the computed superquadric.
 
yarp::os::RpcServer portRpc
 Rpc port for interaction.
 
int vis_points
 Number of points used for visualization.
 
int vis_step
 Number of visualization step.
 
std::string eye
 Eye camera selected.
 
yarp::sig::Matrix R
 
yarp::sig::Matrix H
 
yarp::sig::Matrix K
 
yarp::sig::Vector point
 
yarp::sig::Vector point1
 
yarp::sig::Vector point2D
 
std::deque< int > Color
 Color used for visualization.
 
yarp::dev::PolyDriver GazeCtrl
 Gaze Control driver for visualization.
 
yarp::dev::IGazeControl * igaze
 Gaze Control interface.
 
yarp::os::ResourceFinder * rf
 
double t
 
double t0
 
std::deque< std::string > advanced_params
 
yarp::os::Mutex mutex
 
yarp::os::Mutex mutex_shared
 
std::string object_class
 
SuperqComputationsuperqCom
 SuperqComputation class actually computes the superquadric.
 
SuperqVisualizationsuperqVis
 SuperqVisualization class shows the estimated superquadric.
 
yarp::os::Property filter_points_par
 Parameters of point cloud filter.
 
yarp::os::Property filter_superq_par
 Parameters of superquadric filter.
 
yarp::os::Property ipopt_par
 Parameters of the Ipopt optimization problem.
 

Detailed Description

The SuperqModule class handle the superquadric computation and visualization, the point cloud and superquadric filtering and the interaction with the user.

It is used to set all the parameters (offline and online) and to launch all the thread for superquadric computation and visualization.

Definition at line 40 of file superqModule.h.

Member Function Documentation

◆ fillProperty()

Property SuperqModule::fillProperty ( const yarp::sig::Vector &  sol)
protected

Property fill the property with the superquadric solution.

Parameters
solis a Vector of the computed superquadric
Returns
a Property with the solution

Definition at line 187 of file superqModule.cpp.

188 {
189  Property superq;
190 
191  Bottle bottle;
192  Bottle &b1=bottle.addList();
193  b1.addDouble(sol[0]); b1.addDouble(sol[1]); b1.addDouble(sol[2]);
194  superq.put("dimensions", bottle.get(0));
195 
196  Bottle &b2=bottle.addList();
197  b2.addDouble(sol[3]); b2.addDouble(sol[4]);
198  superq.put("exponents", bottle.get(1));
199 
200  Bottle &b3=bottle.addList();
201  b3.addDouble(sol[5]); b3.addDouble(sol[6]); b3.addDouble(sol[7]);
202  superq.put("center", bottle.get(2));
203 
204  Bottle &b4=bottle.addList();
205  Vector orient=dcm2axis(euler2dcm(sol.subVector(8,10)));
206  b4.addDouble(orient[0]); b4.addDouble(orient[1]); b4.addDouble(orient[2]); b4.addDouble(orient[3]);
207  superq.put("orientation", bottle.get(3));
208  return superq;
209 }

◆ get_options()

Property SuperqModule::get_options ( const std::string &  field)
protectedvirtual

Get options of a given field: visualization, optimization, filtering.

Parameters
fieldis one of the field of options
Returns
property with the options of interested

Reimplemented from superquadricModel_IDL.

Definition at line 330 of file superqModule.cpp.

331 {
332  Property advOptions;
333  if (field=="points_filter")
334  advOptions=superqCom->getPointsFilterPar();
335  else if (field=="superq_filter")
336  advOptions=superqCom->getSuperqFilterPar();
337  else if (field=="optimization")
338  advOptions=superqCom->getIpoptPar();
339  else if (field=="visualization")
340  advOptions=superqVis->getPar();
341  else if (field=="statistics")
342  {
343  advOptions.put("average_computation_time", t_superq);
344  advOptions.put("average_visualization_time", t_vis);
345  }
346 
347  return advOptions;
348 }
yarp::os::Property getPointsFilterPar()
Get options used for filtering the point cloud.
yarp::os::Property getPar()
Get parameters for visualization.
SuperqComputation * superqCom
SuperqComputation class actually computes the superquadric.
Definition: superqModule.h:178
SuperqVisualization * superqVis
SuperqVisualization class shows the estimated superquadric.
Definition: superqModule.h:180
yarp::os::Property getSuperqFilterPar()
Get options used for filtering the superquadric.
double t_vis
Time for visualization.
Definition: superqModule.h:142
yarp::os::Property getIpoptPar()
Get options used for solving the optimization problem with Ipopt.
double t_superq
Time required for computing superquadric.
Definition: superqModule.h:138

◆ get_points_filtering()

string SuperqModule::get_points_filtering ( )
protectedvirtual

Get if the point cloud is filtered or not.

Returns
"on" or "off"

Reimplemented from superquadricModel_IDL.

Definition at line 242 of file superqModule.cpp.

243 {
244  if (filter_points)
245  {
246  return "on";
247  }
248  else
249  {
250  return "off";
251  }
252 }
bool filter_points
Boolean variable for enabling point cloud filtering.
Definition: superqModule.h:90

◆ get_save_points()

string SuperqModule::get_save_points ( )
virtual

Get if the used point cloud is saved or not.

Returns
"on" or "off"

Reimplemented from superquadricModel_IDL.

Definition at line 304 of file superqModule.cpp.

305 {
306  if (save_points)
307  {
308  return "on";
309  }
310  else
311  {
312  return "off";
313  }
314 }
bool save_points
Boolean variable for enabling point cloud saving.
Definition: superqModule.h:112

◆ get_superq() [1/2]

virtual yarp::os::Property superquadricModel_IDL::get_superq ( const std::vector< yarp::sig::Vector > &  point_cloud,
const bool  filtered_or_not,
const bool  reset_or_not 
)
virtualinherited

Get the parameters of the reconstructed superquadric.

Parameters
point_cloudis the 3D point cloud of the object we want to model with the superquadric, for instance: ((100.0 102.0) (100.0 103.0) ... ).
filtered_or_notis a bool variable specifing if we want the superquadric to be filtered (true/1) or not (false/0).
reset_or_notis a bool variable specifing if we want to reset the superquadric filtered (if enabled) or not.
Returns
the 12 parameters (x0, .. x11) of the current superquadric. In particular, the parameters are grouped in a Property as follows: "dimensions" (x0, x1, x2) are the three semi-axes lenghts; "exponents" (x3 and x4) are the exponents, responsible for the superquadric shape; "center"(x5, x6, x7) contains the coordinate of the superquadric center; and "orientation" (x8, x9, 10, x11) is the axis-angle representation obtained from the Euler angles.

◆ get_superq() [2/2]

Property SuperqModule::get_superq ( const std::vector< yarp::sig::Vector > &  blob)
protected

Return the computed superquadric, given the 2D blob of the object.

Parameters
blobis the 2D blob of the object
Returns
a property with the estimated superquadric

Definition at line 99 of file superqModule.cpp.

100 {
101  Property superq;
102 
103  LockGuard lg(mutex);
104 
105  superqCom->setPar("object_class", object_class);
106 
107  superqCom->setPar("one_shot", "on");
108 
109  deque<Vector> p_aux;
110 
111  for (size_t i=0; i<p.size(); i++)
112  p_aux.push_back(p[i]);
113 
114  superqCom->sendPoints(p_aux);
115 
116  superqCom->run();
117 
118  Vector sol(11,0.0);
119  sol=superqCom->getSolution(0);
120 
121  superqCom->setPar("one_shot", "off");
122 
123  p_aux.clear();
124  superqCom->sendPoints(p_aux);
125 
126  superq=fillProperty(sol);
127 
128  return superq;
129 }
SuperqComputation * superqCom
SuperqComputation class actually computes the superquadric.
Definition: superqModule.h:178
void setPar(const std::string &par_name, const std::string &value)
Set a parameter equal to a value.
yarp::sig::Vector getSolution(bool filtered_or_not)
Return the computed superquadric.
virtual void run()
Run function of Thread class.
void sendPoints(const std::deque< yarp::sig::Vector > &p)
Get the point cloud for computing the superquadric.
yarp::os::Property fillProperty(const yarp::sig::Vector &sol)
Property fill the property with the superquadric solution.

◆ get_superq_filtered()

Property SuperqModule::get_superq_filtered ( )
protected

Return the filtered superquadric.

Returns
a property with the filtered superquadric

Definition at line 170 of file superqModule.cpp.

171 {
172  Property superq;
173  Vector sol(11,0.0);
174  sol=superqCom->getSolution(1);
175 
176  superqCom->setPar("one_shot", "off");
177  deque<Vector> p_aux;
178  p_aux.clear();
179  superqCom->sendPoints(p_aux);
180 
181  superq=fillProperty(sol);
182 
183  return superq;
184 }
SuperqComputation * superqCom
SuperqComputation class actually computes the superquadric.
Definition: superqModule.h:178
void setPar(const std::string &par_name, const std::string &value)
Set a parameter equal to a value.
yarp::sig::Vector getSolution(bool filtered_or_not)
Return the computed superquadric.
void sendPoints(const std::deque< yarp::sig::Vector > &p)
Get the point cloud for computing the superquadric.
yarp::os::Property fillProperty(const yarp::sig::Vector &sol)
Property fill the property with the superquadric solution.

◆ get_superq_filtering()

string SuperqModule::get_superq_filtering ( )
protectedvirtual

Get if the superquadric is filtered or not.

Returns
"on" or "off"

Reimplemented from superquadricModel_IDL.

Definition at line 291 of file superqModule.cpp.

292 {
293  if (filter_superq)
294  {
295  return "on";
296  }
297  else
298  {
299  return "off";
300  }
301 }
bool filter_superq
Boolean variable for enabling superquadric filtering.
Definition: superqModule.h:94

◆ get_tag_file()

string SuperqModule::get_tag_file ( )
protectedvirtual

Get the tag name used for saving the superquadric.

Returns
the currect name of the file used for saving

Reimplemented from superquadricModel_IDL.

Definition at line 57 of file superqModule.cpp.

58 {
59  return tag_file;
60 }
std::string tag_file
Tag name of files for saving 3D points.
Definition: superqModule.h:58

◆ get_visualization()

string SuperqModule::get_visualization ( )
protectedvirtual

Return if visualization is on or off.

Returns
"on" or "off"

Reimplemented from superquadricModel_IDL.

Definition at line 63 of file superqModule.cpp.

64 {
65  if (visualization_on)
66  return "on";
67  else
68  return "off";
69 }
bool visualization_on
Boolean variable for enabling visualization.
Definition: superqModule.h:106

◆ getPeriod()

double SuperqModule::getPeriod ( )

Get period function of RF module.

Returns
the period

Definition at line 376 of file superqModule.cpp.

377 {
378  return 0.0;
379 }

◆ reset_filter()

bool SuperqModule::reset_filter ( )
protected

Reset median filter for improving superquadric estimation.

Returns
true

Definition at line 162 of file superqModule.cpp.

163 {
165 
166  return true;
167 }
SuperqComputation * superqCom
SuperqComputation class actually computes the superquadric.
Definition: superqModule.h:178
void resetMedianFilter()
Reset median filter.

◆ send_point_clouds()

bool SuperqModule::send_point_clouds ( const std::vector< yarp::sig::Vector > &  p)
protected

Get the point cloud for computing the superquadric.

Parameters
pis the point cloud to be acquired
Returns
true

Definition at line 132 of file superqModule.cpp.

133 {
134  double t, t_fin;
135 
136  t=Time::now();
137 
138  superqCom->setPar("object_class", object_class);
139 
140  yDebug()<<"Time operations after set par 1"<<Time::now() - t;
141 
142  superqCom->setPar("one_shot", "on");
143 
144  yDebug()<<"Time operations after set par 2"<<Time::now() - t;
145 
146  deque<Vector> p_aux;
147 
148  for (size_t i=0; i<p.size(); i++)
149  p_aux.push_back(p[i]);
150 
151  superqCom->sendPoints(p_aux);
152  yDebug()<<"Time operations send points "<<Time::now() - t;
153 
154  t_fin= Time::now() - t;
155 
156  yDebug()<<"Time operations final"<<t_fin;
157 
158  return true;
159 }
SuperqComputation * superqCom
SuperqComputation class actually computes the superquadric.
Definition: superqModule.h:178
void setPar(const std::string &par_name, const std::string &value)
Set a parameter equal to a value.
void sendPoints(const std::deque< yarp::sig::Vector > &p)
Get the point cloud for computing the superquadric.

◆ set_object_class()

bool SuperqModule::set_object_class ( const std::string &  objclass)
protected

Set object class for improving superquadric estimation.

Parameters
objclassis the object class (according to the shape)
Returns
true/false on success/failure

Definition at line 368 of file superqModule.cpp.

369 {
370  object_class=objclass;
371 
372  return true;
373 }

◆ set_options()

bool SuperqModule::set_options ( const yarp::os::Property &  newOptions,
const std::string &  field 
)
protectedvirtual

Set options of specified field: visualization, optimization, filtering.

Parameters
newOptionsis a property with the options to be set
fieldis the field of the options to be set
Returns
true/false on success/failure

Reimplemented from superquadricModel_IDL.

Definition at line 351 of file superqModule.cpp.

352 {
353  if (field=="points_filter")
354  superqCom->setPointsFilterPar(newOptions, false);
355  else if (field=="superq_filter")
356  superqCom->setSuperqFilterPar(newOptions, false);
357  else if (field=="optimization")
358  superqCom->setIpoptPar(newOptions, false);
359  else if (field=="visualization")
360  superqVis->setPar(newOptions, false);
361  else
362  return false;
363 
364  return true;
365 }
void setSuperqFilterPar(const yarp::os::Property &newOptions, bool first_time)
Set options for filtering the superquadric.
SuperqComputation * superqCom
SuperqComputation class actually computes the superquadric.
Definition: superqModule.h:178
SuperqVisualization * superqVis
SuperqVisualization class shows the estimated superquadric.
Definition: superqModule.h:180
void setPointsFilterPar(const yarp::os::Property &newOptions, bool first_time)
Set options for filtering the point cloud.
void setPar(const std::string &par_name, const std::string &value)
Set a given parameter equal to a string.
void setIpoptPar(const yarp::os::Property &newOptions, bool first_time)
Set options for the optimization problem solved by Ipopt.

◆ set_points_filtering()

bool SuperqModule::set_points_filtering ( const std::string &  entry)
protectedvirtual

Set if to filter or not the point cloud.

Parameters
entrecan be "on" or "off"
Returns
true/false on success/failure

Reimplemented from superquadricModel_IDL.

Definition at line 212 of file superqModule.cpp.

213 {
214  if ((entry=="on") || (entry=="off"))
215  {
216  LockGuard lg(mutex);
217  filter_points=(entry=="on");
218  if (filter_points)
219  {
220  Property options;
221  options.put("filter_radius", radius);
222  options.put("filter_nnThreshold", nnThreshold);
223  superqCom->setPointsFilterPar(options, false);
224  superqCom->setPar("filter_points", "on");
225  }
226  else
227  superqCom->setPar("filter_points", "off");
228 
229  yInfo()<<"[SuperqModule]: filter_points "<<filter_points;
230  yInfo()<<"[SuperqModule]: radius "<<radius;
231  yInfo()<<"[SuperqModule]: nn-thrshold "<<nnThreshold;
232 
233  return true;
234  }
235  else
236  {
237  return false;
238  }
239 }
SuperqComputation * superqCom
SuperqComputation class actually computes the superquadric.
Definition: superqModule.h:178
bool filter_points
Boolean variable for enabling point cloud filtering.
Definition: superqModule.h:90
void setPar(const std::string &par_name, const std::string &value)
Set a parameter equal to a value.
void setPointsFilterPar(const yarp::os::Property &newOptions, bool first_time)
Set options for filtering the point cloud.
double radius
Radius for spatial density filter.
Definition: superqModule.h:76
int nnThreshold
Density threshold for spatial density filter.
Definition: superqModule.h:78

◆ set_save_points()

bool SuperqModule::set_save_points ( const std::string &  entry)
virtual

Set if to save or not the used point cloud.

Parameters
entrycan be "on" or "off"

Reimplemented from superquadricModel_IDL.

Definition at line 317 of file superqModule.cpp.

318 {
319  if ((entry=="on") || (entry=="off"))
320  {
321  save_points=(entry=="on");
322  if (save_points)
323  superqCom->setPar("save_points", "on");
324  else
325  superqCom->setPar("save_points", "off");
326  }
327 }
SuperqComputation * superqCom
SuperqComputation class actually computes the superquadric.
Definition: superqModule.h:178
void setPar(const std::string &par_name, const std::string &value)
Set a parameter equal to a value.
bool save_points
Boolean variable for enabling point cloud saving.
Definition: superqModule.h:112

◆ set_superq_filtering()

bool SuperqModule::set_superq_filtering ( const std::string &  entry)
protectedvirtual

Set if to filter or not the superquadric.

Parameters
entrycan be "on" or "off"
Returns
true/false on success/failure

Reimplemented from superquadricModel_IDL.

Definition at line 255 of file superqModule.cpp.

256 {
257  if ((entry=="on") || (entry=="off"))
258  {
259  LockGuard lg(mutex);
260  filter_superq= (entry=="on");
261  if (filter_superq)
262  {
263  Property options;
264  options.put("median_order", median_order);
265  if (fixed_window)
266  options.put("fixed_window", "on");
267  else
268  options.put("fixed_window", "off");
269 
270  superqCom->setSuperqFilterPar(options, false);
271  superqCom->setPar("filter_superq", "on");
272  }
273  else
274  superqCom->setPar("filter_superq", "off");
275 
276  yInfo()<<"[SuperqModule]: filter_superq "<<filter_superq;
277  yInfo()<<"[SuperqModule]: fixed_window "<<fixed_window;
278  yInfo()<<"[SuperqModule]: median_order "<<median_order;
279  yInfo()<<"[SuperqModule]: min_median_order "<<min_median_order;
280  yInfo()<<"[SuperqModule]: max_median_order "<<max_median_order;
281 
282  return true;
283  }
284  else
285  {
286  return false;
287  }
288 }
int min_median_order
Minimum median filder order allowed.
Definition: superqModule.h:84
int max_median_order
Maximum median filder order allowed.
Definition: superqModule.h:86
void setSuperqFilterPar(const yarp::os::Property &newOptions, bool first_time)
Set options for filtering the superquadric.
SuperqComputation * superqCom
SuperqComputation class actually computes the superquadric.
Definition: superqModule.h:178
void setPar(const std::string &par_name, const std::string &value)
Set a parameter equal to a value.
bool filter_superq
Boolean variable for enabling superquadric filtering.
Definition: superqModule.h:94
bool fixed_window
Boolean variable for enabling the use of a fixed window during the median filter. ...
Definition: superqModule.h:92
int median_order
Median filder order.
Definition: superqModule.h:82

◆ set_tag_file()

bool SuperqModule::set_tag_file ( const std::string &  tag_file)
protectedvirtual

Set a tag name for saving the superquadric.

Parameters
tag_fileis the name of the file where to save the superquadric
Returns
true

Reimplemented from superquadricModel_IDL.

Definition at line 43 of file superqModule.cpp.

44 {
45  LockGuard lg(mutex);
46 
47  tag_file=tag;
49  yDebug()<<" [SuperqModule]: File output "<<outputFileName;
50 
51  superqCom->setPar("tag_file", tag_file);
52 
53  return true;
54 }
std::string homeContextPath
Path where code context is located.
Definition: superqModule.h:60
std::string tag_file
Tag name of files for saving 3D points.
Definition: superqModule.h:58
SuperqComputation * superqCom
SuperqComputation class actually computes the superquadric.
Definition: superqModule.h:178
std::string outputFileName
Output file name saving the estimated superquadric.
Definition: superqModule.h:64
void setPar(const std::string &par_name, const std::string &value)
Set a parameter equal to a value.

◆ set_visualization()

bool SuperqModule::set_visualization ( const std::string &  e)
protectedvirtual

Set if visualization is on or off.

Parameters
ecan be "on" or "off"
Returns
true/false on success/failure

Reimplemented from superquadricModel_IDL.

Definition at line 72 of file superqModule.cpp.

73 {
74  if ((e=="on") || (e=="off"))
75  {
76  LockGuard lg(mutex);
77 
78  if ((visualization_on==false) && (e=="on"))
79  {
80  superqVis->resume();
81 
82  visualization_on=true;
83 
84  }
85  else if ((visualization_on==true) && (e=="off"))
86  {
87  superqVis->suspend();
88  visualization_on=false;
89  }
90  return true;
91  }
92  else
93  {
94  return false;
95  }
96 }
SuperqVisualization * superqVis
SuperqVisualization class shows the estimated superquadric.
Definition: superqModule.h:180
bool visualization_on
Boolean variable for enabling visualization.
Definition: superqModule.h:106

The documentation for this class was generated from the following files: