#!/usr/bin/env python3
# Example config: https://github.com/ros/dynamic_reconfigure/blob/melodic-devel/cfg/Test.cfg

PACKAGE = "depth_yolact_ros"

from dynamic_reconfigure.parameter_generator_catkin import *

gen = ParameterGenerator()

# ROS node config

gen.add("image_topic", str_t, 1 << 0, "Image topic used for subscribing", "/camera/color/image_raw")
gen.add("depth_topic", str_t, 1 << 0, "depth topic used for subscribing", "/camera/depth/image_raw")
gen.add("camera_info_topic", str_t, 1 << 12, "depth camera info topic used for subscribing", "/camera/depth/camera_info")
gen.add("use_compressed_image", bool_t, 1 << 0, "Subscribe to compressed image topic", False)
gen.add("use_compressed_depth", bool_t, 1 << 0, "Subscribe to compressed depth topic", False)
gen.add("publish_visualization", bool_t, 1 << 1, "Publish images with detections",  True)
gen.add("publish_detections", bool_t, 1 << 2, "Publish detections as message",  True)

gen.add("initial_centroid", double_t, 1 << 3, "Clustering initial value for the background points' centroid",  5.0)

gen.add("publish_pointcloud", bool_t, 1 << 13, "Publish pointcloud of detected objects",  True)
gen.add("publish_bboxes", bool_t, 1 << 14, "Publish bounding boxes markers for detected objects",  True)
gen.add("use_kmeans", bool_t, 1 << 15, "Whether or not to use K-Means to cluster the masked depth",  True)

gen.add("use_bboxes_world_frame", bool_t, 1 << 16, "Whether or not to use world frame in the bboxes topic, if false the camera frame is used", True)
gen.add("world_frame", str_t, 1 << 17, "Name of the world frame", "world")

gen.add("use_gaussian", bool_t, 1 << 18, "Whether or not to fit a gaussian model for anomaly detection", True)
gen.add("std_multiplier", double_t, 1 << 19, "Multiplier for the gaussian standard deviation. The bigger the larger the area around mean that's considered inliers area", 1.0, 1.0, 5.0)


# Yolact internal config

gen.add("display_masks", bool_t, 1 << 4, "Whether or not to display masks over bounding boxes",  True)
gen.add("display_bboxes", bool_t, 1 << 5, "Whether or not to display bboxes around masks",  True)
gen.add("display_text", bool_t, 1 << 6, "Whether or not to display text (class [score])",  True)
gen.add("display_scores", bool_t, 1 << 7, "Whether or not to display scores in addition to classes",  True)
gen.add("display_fps", bool_t, 1 << 8, "When displaying video, draw the FPS on the frame", False)
gen.add("score_threshold", double_t, 1 << 9, "Detections with a score under this threshold will not be considered",  0.0, 0.0, 1.0)
gen.add("crop_masks", bool_t, 1 << 10, "If true, crop output masks with the predicted bounding box",  True)
gen.add("top_k", int_t, 1 << 11, "Further restrict the number of predictions to parse", 5, 0, 100)

exit(gen.generate(PACKAGE, "depth_yolact_ros", "Yolact"))
