diff --git a/cfg/AdcJuryServer.cfg b/cfg/AdcJuryServer.cfg index e9aea1d1cee90fa07cc39949b4bd7beaf79becfe..2257b9186b1012e21c6882c7e1135238a140a461 100755 --- a/cfg/AdcJuryServer.cfg +++ b/cfg/AdcJuryServer.cfg @@ -39,5 +39,9 @@ gen = ParameterGenerator() # Name Type Reconf.level Description Default Min Max gen.add("rate", double_t, 0, "Main loop rate (Hz)", 10.0, 0.1, 1000.0) +gen.add("feedback_status_text", str_t, 0, "Feedback text", "feedback text example") +gen.add("finish_action_with_success", bool_t, 0, "End action with success", False) +gen.add("finish_action_with_failure", bool_t, 0, "End action with failure", False) -exit(gen.generate(PACKAGE, "AdcJuryServerAlgorithm", "AdcJuryServer")) \ No newline at end of file + +exit(gen.generate(PACKAGE, "AdcJuryServerAlgorithm", "AdcJuryServer")) diff --git a/src/adc_jury_server_alg_node.cpp b/src/adc_jury_server_alg_node.cpp index 60f19e1a3c8eaa553e1cbf39f26d4590e2c38e56..74bc90d0bda320665e001878f53ca76a509ac813 100644 --- a/src/adc_jury_server_alg_node.cpp +++ b/src/adc_jury_server_alg_node.cpp @@ -164,8 +164,9 @@ void AdcJuryServerAlgNode::adc_juryGetFeedbackCallback(iri_adc_msgs::adc_juryFee { this->alg_.lock(); //update feedback data to be sent to client - feedback->status = "test"; + feedback->status = this->config_.feedback_status_text; //ROS_INFO("feedback: %s", feedback->data.c_str()); + //ROS_INFO("AdcJuryServerAlgNode::adc_juryGetFeedbackCallback feedback.status='%s'", feedback->status.c_str()); this->alg_.unlock(); } @@ -177,6 +178,21 @@ void AdcJuryServerAlgNode::node_config_update(Config &config, uint32_t level) this->alg_.lock(); if(config.rate!=this->getRate()) this->setRate(config.rate); + + if(config.finish_action_with_success) + { + this->adc_jury_finished=true; + this->adc_jury_succeeded=true; + config.finish_action_with_success=false; + } + + if(config.finish_action_with_failure) + { + this->adc_jury_finished=true; + this->adc_jury_succeeded=false; + config.finish_action_with_failure=false; + } + this->config_=config; this->alg_.unlock(); }