Changing Tracking Color with Messages

From wikidb
Revision as of 22:00, 28 June 2012 by Edc (Talk | contribs)

Jump to: navigation, search

Instance variables: add color parameters.

class Demo
{
protected:
    ...  

    int min_hue_;
    int max_hue_;
    int min_saturation_;

Constructor: Add a subscriber for /hue_set messages. Constructor: Init the color parameters.

public:

Demo (ros::NodeHandle & nh):nh_ (nh), it_ (nh_)
{
    ...
    hue_set_sub_ = nh_.subscribe("/hue_set", 1000, 
				 &Demo::hueSetCallback, this);
    min_hue_        =  6;
    max_hue_        = 26;
    min_saturation_ = 96;
}