Can i create a ROS nodelet which inherits from diagnostic_aggregator::Aggregator [closed]

asked 2016-02-16 09:58:51 -0600

juls gravatar image

updated 2016-02-16 09:59:33 -0600

Hello everyone,

i am new to ROS and i want to create a ROS nodelet which inherits from diagnostic_aggregator::Aggregator class. My problem is that i cannot define diagnostic_aggregator::Aggregator() constructor implicitly in the derived class constructor, i get the following type of error messages for all private members of diagnostic_aggregator::Aggregator class define diagnostic_aggregator::Aggregator members :

 /opt/ros/indigo/include/diagnostic_aggregator/aggregator.h:131: error: 'double diagnostic_aggregator::Aggregator::pub_rate_' is private
       double pub_rate_;
          ^

my code: in the class source file:

SafetyMaintainer::SafetyMaintainer(double pub_rate, diagnostic_aggregator::AnalyzerGroup* analyzer_group, diagnostic_aggregator::OtherAnalyzer* other_analyzer, std::string base_path)
    : job_action_client_("job", true),
      pub_rate_(pub_rate), analyzer_group_(analyzer_group), other_analyzer_(other_analyzer), base_path_(base_path)
    {}

in the header file:

   SafetyMaintainer(double, diagnostic_aggregator::AnalyzerGroup*, diagnostic_aggregator::OtherAnalyzer*, std::string)

What is the proper way of defining the diagnostic_aggregator::Aggregator constructor implicitly in the derived class constructor, or how can i inherit from diagnostic_aggregator::Aggregator class? Thank you in advance!

edit retag flag offensive reopen merge delete

Closed for the following reason question is not relevant or outdated by tfoote
close date 2017-12-05 16:49:00.475623