diff --git a/ball_detector/launch/ball_detector_params_default.yaml b/ball_detector/launch/ball_detector_params_default.yaml index 439d4f1..4569b97 100644 --- a/ball_detector/launch/ball_detector_params_default.yaml +++ b/ball_detector/launch/ball_detector_params_default.yaml @@ -20,4 +20,4 @@ filter2_s_max: 40 filter2_v_min: 200 filter2_v_max: 255 ellipse_size: 1 -filter_debug: false \ No newline at end of file +filter_debug: false diff --git a/ball_detector/msg/BallDetectorParams.msg b/ball_detector/msg/BallDetectorParams.msg index e72a4ad..cd1c210 100644 --- a/ball_detector/msg/BallDetectorParams.msg +++ b/ball_detector/msg/BallDetectorParams.msg @@ -14,3 +14,4 @@ uint32 filter_s_min # 0 - 255 uint32 filter_s_max uint32 filter_v_min # 0 - 255 uint32 filter_v_max +uint32 ellipse_size # 1 - 9 diff --git a/ball_detector/src/ball_detector.cpp b/ball_detector/src/ball_detector.cpp index 945654b..a38c2b7 100644 --- a/ball_detector/src/ball_detector.cpp +++ b/ball_detector/src/ball_detector.cpp @@ -302,6 +302,7 @@ bool BallDetector::setParamCallback(ball_detector::SetParameters::Request &req, params_config_.filter_threshold.s_max = req.params.filter_s_max; params_config_.filter_threshold.v_min = req.params.filter_v_min; params_config_.filter_threshold.v_max = req.params.filter_v_max; + params_config_.ellipse_size = req.params.ellipse_size; saveConfig(); @@ -326,6 +327,7 @@ bool BallDetector:: getParamCallback(ball_detector::GetParameters::Request &req, res.returns.filter_s_max = params_config_.filter_threshold.s_max; res.returns.filter_v_min = params_config_.filter_threshold.v_min; res.returns.filter_v_max = params_config_.filter_threshold.v_max; + res.returns.ellipse_size = params_config_.ellipse_size; return true; } @@ -400,6 +402,7 @@ void BallDetector::publishParam() params.filter_s_max = params_config_.filter_threshold.s_max; params.filter_v_min = params_config_.filter_threshold.v_min; params.filter_v_max = params_config_.filter_threshold.v_max; + params.filter_v_max = params_config_.ellipse_size; param_pub_.publish(params); }