21 #include <yarp/dev/all.h> 22 #include <yarp/os/all.h> 23 #include <yarp/sig/all.h> 25 #include <opencv2/opencv.hpp> 27 #include "superqComputation.h" 28 #include "superqVisualization.h" 30 #include "src/superquadricModel_IDL.h" 68 std::deque<yarp::sig::Vector>
points;
158 yarp::sig::Matrix R,H,K;
159 yarp::sig::Vector point,point1;
160 yarp::sig:: Vector point2D;
168 yarp::os::ResourceFinder *rf;
170 std::deque<std::string> advanced_params;
171 yarp::os::Mutex mutex;
172 yarp::os::Mutex mutex_shared;
174 std::string object_class;
191 bool attach(yarp::os::RpcServer &source);
224 yarp::os::Property
get_superq(
const std::vector<yarp::sig::Vector> &blob);
250 yarp::os::Property
fillProperty(
const yarp::sig::Vector &sol);
283 yarp::os::Property
get_options(
const std::string &field);
291 bool set_options(
const yarp::os::Property &newOptions,
const std::string &field);
313 bool configure(yarp::os::ResourceFinder &rf);
bool send_point_clouds(const std::vector< yarp::sig::Vector > &p)
Get the point cloud for computing the superquadric.
std::string homeContextPath
Path where code context is located.
int rate
Computation thread rate.
int min_median_order
Minimum median filder order allowed.
std::deque< yarp::sig::Vector > points
3D points used for reconstructing the superquadric
int r
Red value for visualization.
bool close()
close function of RF module
std::string tag_file
Tag name of files for saving 3D points.
yarp::sig::Vector x_filtered
Filtered superquadric.
double min_norm_vel
Minimum norm of velocity for considering the object moving.
bool set_tag_file(const std::string &tag_file)
Set a tag name for saving the superquadric.
int max_median_order
Maximum median filder order allowed.
bool set_points_filtering(const std::string &entry)
Set if to filter or not the point cloud.
double max_cpu_time
Max cpu time allowed for solving the optimization problem.
bool mode_online
Boolean variable for enabling online or offline mode.
std::deque< int > Color
Color used for visualization.
std::string get_superq_filtering()
Get if the superquadric is filtered or not.
bool updateModule()
updateModule function of RF module
yarp::os::ConstString pointCloudFileName
Pointcloud name file in case the module runs offline.
bool interruptModule()
interrupt module function of RF module
std::deque< cv::Point > blob_points
2D points of the segmented object
bool configServices(yarp::os::ResourceFinder &rf)
Open ports for communication.
This class shows the point cloud used for modeling or the estimated superquadric overlapped on the ca...
int vis_step
Number of visualization step.
bool configOnOff(yarp::os::ResourceFinder &rf)
Configure all on/off options.
std::string get_visualization()
Return if visualization is on or off.
std::string get_points_filtering()
Get if the point cloud is filtered or not.
void saveSuperq()
Save computed superquadric.
int optimizer_points
Number of 3D points used for optimization.
std::string what_to_plot
String used for deciding what to plot: "points" or "superq".
SuperqComputation * superqCom
SuperqComputation class actually computes the superquadric.
bool filter_points
Boolean variable for enabling point cloud filtering.
std::string outputFileName
Output file name saving the estimated superquadric.
SuperqVisualization * superqVis
SuperqVisualization class shows the estimated superquadric.
int b
Blue value for visualization.
int vis_points
Number of points used for visualization.
bool filter_superq
Boolean variable for enabling superquadric filtering.
std::string mu_strategy
Mu strategy of the Ipopt algorithm.
int g
Green value for visualization.
bool reset
Boolean variable for resetting the median filter.
yarp::dev::PolyDriver GazeCtrl
Gaze Control driver for visualization.
bool configFilter(yarp::os::ResourceFinder &rf)
Configure point cloud filter options.
bool configViewer(yarp::os::ResourceFinder &rf)
Configure visualization options.
yarp::dev::IGazeControl * igaze
Gaze Control interface.
bool visualization_on
Boolean variable for enabling visualization.
yarp::os::Property get_options(const std::string &field)
Get options of a given field: visualization, optimization, filtering.
std::vector< cv::Point > contour
OpenCV variable for blob extraction.
bool set_superq_filtering(const std::string &entry)
Set if to filter or not the superquadric.
bool configFilterSuperq(yarp::os::ResourceFinder &rf)
Configure superquadric filter options.
std::string eye
Eye camera selected.
bool fixed_window
Boolean variable for enabling the use of a fixed window during the median filter. ...
double tol
Tolerance of the optimization problem.
std::deque< double > times_vis
Collections of times required for visualization.
std::deque< yarp::sig::Vector > points_aux
3D points auxiliary used for reconstructing the superquadric
bool readPointCloud()
In offline mode, read the point cloud from a txt file.
yarp::os::BufferedPort< yarp::os::Property > portSuperq
Port for streaming the computed superquadric.
std::string get_save_points()
Get if the used point cloud is saved or not.
yarp::os::Property get_superq_filtered()
Return the filtered superquadric.
int acceptable_iter
Acceptable iter of Ipopt algorithm.
bool save_points
Boolean variable for enabling point cloud saving.
std::string nlp_scaling_method
NLP scaling method of the Ipopt algorithm.
This class provides a thread for computing in real time the superquadric, filtering the point cloud a...
std::deque< double > times_superq
Times used for computing several superquadrics.
double getPeriod()
Get period function of RF module.
bool configure(yarp::os::ResourceFinder &rf)
configure function of RF module
yarp::os::Property get_superq(const std::vector< yarp::sig::Vector > &blob)
Return the computed superquadric, given the 2D blob of the object.
bool set_options(const yarp::os::Property &newOptions, const std::string &field)
Set options of specified field: visualization, optimization, filtering.
bool reset_filter()
Reset median filter for improving superquadric estimation.
yarp::sig::Vector x
Estimated superquadric.
bool configSuperq(yarp::os::ResourceFinder &rf)
Configure superquadric computation otpions.
double threshold_median
Threshold for velocity estimation for median order.
The SuperqModule class handle the superquadric computation and visualization, the point cloud and sup...
bool go_on
Boolean variable for going to the next step of the state machine.
superquadricModel_IDL IDL Interface to superquadric-model services.
yarp::os::RpcServer portRpc
Rpc port for interaction.
std::string get_tag_file()
Get the tag name used for saving the superquadric.
bool set_visualization(const std::string &e)
Set if visualization is on or off.
int rate_vis
Visualization thread rate.
bool set_object_class(const std::string &objclass)
Set object class for improving superquadric estimation.
double t_vis
Time for visualization.
int new_median_order
New median filder order estimated.
bool set_save_points(const std::string &entry)
Set if to save or not the used point cloud.
yarp::os::Property filter_points_par
Parameters of point cloud filter.
double radius
Radius for spatial density filter.
int nnThreshold
Density threshold for spatial density filter.
double t_superq
Time required for computing superquadric.
yarp::os::Property filter_superq_par
Parameters of superquadric filter.
yarp::os::Property ipopt_par
Parameters of the Ipopt optimization problem.
int median_order
Median filder order.
yarp::os::Property fillProperty(const yarp::sig::Vector &sol)
Property fill the property with the superquadric solution.
int max_iter
Maximum iteration allowed of Ipopt algorithm.