visual-tracking-control
Public Member Functions | Protected Member Functions | Protected Attributes | Private Attributes | List of all members
VisualSIS Class Reference

#include <VisualSIS.h>

Inheritance diagram for VisualSIS:
[legend]

Public Member Functions

 VisualSIS (const yarp::os::ConstString &cam_sel, const int img_width, const int img_height, const int num_particles, const double resample_ratio)
 
 ~VisualSIS () noexcept
 
virtual bool read (yarp::os::ConnectionReader &connection) override
 
virtual std::vector< std::string > help (const std::string &functionName="--all")
 

Protected Member Functions

void initialization () override
 
void filteringStep () override
 
void getResult () override
 
bool runCondition () override
 
bool attach (yarp::os::Port &source)
 
bool setCommandPort ()
 
bool run_filter () override
 Initialize and run the visual SIR particle filter. More...
 
bool reset_filter () override
 Reset the visual SIR particle filter. More...
 
bool stop_filter () override
 Stop and reset the SIR particle filter. More...
 
bool skip_step (const std::string &what_step, const bool status) override
 Enable/Disable skipping the filtering step specified in what_step. More...
 
bool use_analogs (const bool status) override
 Use/Don't use the analog values from the right hand to correct the finger poses. More...
 
std::vector< std::string > get_info () override
 Get information about recursive Bayesian filter, like it's status, the available methods, and the current one in use, to extract the state estimate from the particle set. More...
 
bool quit () override
 Gently close the application, deallocating resources. More...
 
bool set_estimates_extraction_method (const std::string &method) override
 Change the current method to extract the state estimates from the particle set. More...
 
bool set_mobile_average_window (const int16_t window) override
 Change the window size of mobile averages for estimates extraction. More...
 

Protected Attributes

yarp::os::ConstString cam_sel_
 
int img_width_
 
int img_height_
 
int num_particles_
 
unsigned int descriptor_length_
 
double resample_ratio_
 
const int block_size_ = 16
 
const int bin_number_ = 9
 
cv::Ptr< cv::cuda::HOG > cuda_hog_
 
yarp::os::BufferedPort< yarp::sig::Vector > port_estimates_out_
 
yarp::os::BufferedPort< yarp::sig::ImageOf< yarp::sig::PixelRgb > > port_image_in_
 
yarp::os::Port port_rpc_command_
 

Private Attributes

Eigen::MatrixXf pred_particle_
 
Eigen::VectorXf pred_weight_
 
Eigen::MatrixXf cor_particle_
 
Eigen::VectorXf cor_weight_
 
bfl::EstimatesExtraction estimate_extraction_
 
bool init_img_in_ = false
 
yarp::sig::ImageOf< yarp::sig::PixelRgb > img_in_
 

Detailed Description

Definition at line 26 of file VisualSIS.h.

Constructor & Destructor Documentation

◆ VisualSIS()

VisualSIS::VisualSIS ( const yarp::os::ConstString &  cam_sel,
const int  img_width,
const int  img_height,
const int  num_particles,
const double  resample_ratio 
)

Definition at line 32 of file VisualSIS.cpp.

References bin_number_, block_size_, cam_sel_, cuda_hog_, descriptor_length_, img_height_, img_in_, img_width_, port_estimates_out_, port_image_in_, and setCommandPort().

Here is the call graph for this function:

◆ ~VisualSIS()

VisualSIS::~VisualSIS ( )
noexcept

Definition at line 79 of file VisualSIS.cpp.

References port_estimates_out_, and port_image_in_.

Member Function Documentation

◆ attach()

bool VisualSIS::attach ( yarp::os::Port &  source)
protected

Definition at line 209 of file VisualSIS.cpp.

Referenced by setCommandPort().

◆ filteringStep()

void VisualSIS::filteringStep ( )
overrideprotected

◆ get_info()

std::vector< std::string > VisualSIS::get_info ( )
overrideprotectedvirtual

Get information about recursive Bayesian filter, like it's status, the available methods, and the current one in use, to extract the state estimate from the particle set.

Returns
a string with all the available information, 'none' otherwise

Reimplemented from VisualSISParticleFilterIDL.

Definition at line 273 of file VisualSIS.cpp.

References cam_sel_, estimate_extraction_, and num_particles_.

◆ getResult()

void VisualSIS::getResult ( )
overrideprotected

Definition at line 206 of file VisualSIS.cpp.

◆ help()

virtual std::vector<std::string> VisualSISParticleFilterIDL::help ( const std::string &  functionName = "--all")
virtualinherited

◆ initialization()

void VisualSIS::initialization ( )
overrideprotected

◆ quit()

bool VisualSIS::quit ( )
overrideprotectedvirtual

Gently close the application, deallocating resources.

Reimplemented from VisualSISParticleFilterIDL.

Definition at line 355 of file VisualSIS.cpp.

◆ read()

virtual bool VisualSISParticleFilterIDL::read ( yarp::os::ConnectionReader &  connection)
overridevirtualinherited

◆ reset_filter()

bool VisualSIS::reset_filter ( )
overrideprotectedvirtual

Reset the visual SIR particle filter.

Returns upon successful or failure reset.

Returns
true/false on success/failure.

Reimplemented from VisualSISParticleFilterIDL.

Definition at line 242 of file VisualSIS.cpp.

◆ run_filter()

bool VisualSIS::run_filter ( )
overrideprotectedvirtual

Initialize and run the visual SIR particle filter.

Returns upon successful or failure setup.

Returns
true/false on success/failure.

Reimplemented from VisualSISParticleFilterIDL.

Definition at line 234 of file VisualSIS.cpp.

◆ runCondition()

bool VisualSIS::runCondition ( )
inlineoverrideprotected

Definition at line 44 of file VisualSIS.h.

References cam_sel_.

◆ set_estimates_extraction_method()

bool VisualSIS::set_estimates_extraction_method ( const std::string &  method)
overrideprotectedvirtual

Change the current method to extract the state estimates from the particle set.

Parameters
statusa string with the state estimate extraction method to use; the string shall be one of the available methods returned by the get_info() method.
Returns
true method changed successfully, false otherwise.

Reimplemented from VisualSISParticleFilterIDL.

Definition at line 291 of file VisualSIS.cpp.

References estimate_extraction_.

◆ set_mobile_average_window()

bool VisualSIS::set_mobile_average_window ( const int16_t  window)
overrideprotectedvirtual

Change the window size of mobile averages for estimates extraction.

Parameters
windowspecifies the mobile window size.
Returns
true window size changed successfully, false otherwise.
Note
The default value is 20. Minimum value is 2. Maximum value is 90.

Reimplemented from VisualSISParticleFilterIDL.

Definition at line 346 of file VisualSIS.cpp.

References estimate_extraction_.

◆ setCommandPort()

bool VisualSIS::setCommandPort ( )
protected

Definition at line 215 of file VisualSIS.cpp.

References attach(), cam_sel_, and port_rpc_command_.

Referenced by VisualSIS().

Here is the call graph for this function:

◆ skip_step()

bool VisualSIS::skip_step ( const std::string &  what_step,
const bool  status 
)
overrideprotectedvirtual

Enable/Disable skipping the filtering step specified in what_step.

what_step can be one of the following: 1) prediction: skips the whole prediction step 2) state: skips the prediction step related to the state transition 3) exogenous: skips the prediction step related exogenous inputs 4) correction: skips the whole correction step

Parameters
what_stepthe step to skipping
statusenable/disable skipping
Returns
true/false on success/failure.

Reimplemented from VisualSISParticleFilterIDL.

Definition at line 258 of file VisualSIS.cpp.

◆ stop_filter()

bool VisualSIS::stop_filter ( )
overrideprotectedvirtual

Stop and reset the SIR particle filter.

This method must be called when the SIR particle filter is no longer needed or a new filtering task need to be initialized.

Returns
true/false on success/failure.

Reimplemented from VisualSISParticleFilterIDL.

Definition at line 250 of file VisualSIS.cpp.

◆ use_analogs()

bool VisualSIS::use_analogs ( const bool  status)
overrideprotectedvirtual

Use/Don't use the analog values from the right hand to correct the finger poses.

Parameters
statustrue/false to use/don't use analog values.
Returns
true activation/deactivation success, false otherwise.

Reimplemented from VisualSISParticleFilterIDL.

Definition at line 264 of file VisualSIS.cpp.

Member Data Documentation

◆ bin_number_

const int VisualSIS::bin_number_ = 9
protected

Definition at line 55 of file VisualSIS.h.

Referenced by VisualSIS().

◆ block_size_

const int VisualSIS::block_size_ = 16
protected

Definition at line 54 of file VisualSIS.h.

Referenced by VisualSIS().

◆ cam_sel_

yarp::os::ConstString VisualSIS::cam_sel_
protected

Definition at line 44 of file VisualSIS.h.

Referenced by get_info(), runCondition(), setCommandPort(), and VisualSIS().

◆ cor_particle_

Eigen::MatrixXf VisualSIS::cor_particle_
private

Definition at line 92 of file VisualSIS.h.

Referenced by filteringStep(), and initialization().

◆ cor_weight_

Eigen::VectorXf VisualSIS::cor_weight_
private

Definition at line 93 of file VisualSIS.h.

Referenced by filteringStep(), and initialization().

◆ cuda_hog_

cv::Ptr<cv::cuda::HOG> VisualSIS::cuda_hog_
protected

Definition at line 57 of file VisualSIS.h.

Referenced by filteringStep(), and VisualSIS().

◆ descriptor_length_

unsigned int VisualSIS::descriptor_length_
protected

Definition at line 51 of file VisualSIS.h.

Referenced by filteringStep(), and VisualSIS().

◆ estimate_extraction_

bfl::EstimatesExtraction VisualSIS::estimate_extraction_
private

◆ img_height_

int VisualSIS::img_height_
protected

Definition at line 49 of file VisualSIS.h.

Referenced by filteringStep(), and VisualSIS().

◆ img_in_

yarp::sig::ImageOf<yarp::sig::PixelRgb> VisualSIS::img_in_
private

Definition at line 100 of file VisualSIS.h.

Referenced by filteringStep(), and VisualSIS().

◆ img_width_

int VisualSIS::img_width_
protected

Definition at line 48 of file VisualSIS.h.

Referenced by filteringStep(), and VisualSIS().

◆ init_img_in_

bool VisualSIS::init_img_in_ = false
private

Definition at line 99 of file VisualSIS.h.

Referenced by filteringStep().

◆ num_particles_

int VisualSIS::num_particles_
protected

Definition at line 50 of file VisualSIS.h.

Referenced by filteringStep(), get_info(), and initialization().

◆ port_estimates_out_

yarp::os::BufferedPort<yarp::sig::Vector> VisualSIS::port_estimates_out_
protected

Definition at line 60 of file VisualSIS.h.

Referenced by filteringStep(), VisualSIS(), and ~VisualSIS().

◆ port_image_in_

yarp::os::BufferedPort<yarp::sig::ImageOf<yarp::sig::PixelRgb> > VisualSIS::port_image_in_
protected

Definition at line 61 of file VisualSIS.h.

Referenced by filteringStep(), VisualSIS(), and ~VisualSIS().

◆ port_rpc_command_

yarp::os::Port VisualSIS::port_rpc_command_
protected

Definition at line 64 of file VisualSIS.h.

Referenced by setCommandPort().

◆ pred_particle_

Eigen::MatrixXf VisualSIS::pred_particle_
private

Definition at line 89 of file VisualSIS.h.

Referenced by filteringStep(), and initialization().

◆ pred_weight_

Eigen::VectorXf VisualSIS::pred_weight_
private

Definition at line 90 of file VisualSIS.h.

Referenced by filteringStep(), and initialization().

◆ resample_ratio_

double VisualSIS::resample_ratio_
protected

Definition at line 52 of file VisualSIS.h.

Referenced by filteringStep().


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