Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add subscriber_queue_length parameter #61

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 5 additions & 1 deletion src/node_detectnet.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,8 @@ int main(int argc, char **argv)
float mean_pixel = 0.0f;
float threshold = DETECTNET_DEFAULT_THRESHOLD;

int subscriber_queue_length = 5;

ROS_DECLARE_PARAMETER("model_name", model_name);
ROS_DECLARE_PARAMETER("model_path", model_path);
ROS_DECLARE_PARAMETER("prototxt_path", prototxt_path);
Expand All @@ -191,6 +193,7 @@ int main(int argc, char **argv)
ROS_DECLARE_PARAMETER("overlay_flags", overlay_str);
ROS_DECLARE_PARAMETER("mean_pixel_value", mean_pixel);
ROS_DECLARE_PARAMETER("threshold", threshold);
ROS_DECLARE_PARAMETER("subscriber_queue_length", subscriber_queue_length);


/*
Expand All @@ -206,6 +209,7 @@ int main(int argc, char **argv)
ROS_GET_PARAMETER("overlay_flags", overlay_str);
ROS_GET_PARAMETER("mean_pixel_value", mean_pixel);
ROS_GET_PARAMETER("threshold", threshold);
ROS_GET_PARAMETER("subscriber_queue_length", subscriber_queue_length);

overlay_flags = detectNet::OverlayFlagsFromStr(overlay_str.c_str());

Expand Down Expand Up @@ -301,7 +305,7 @@ int main(int argc, char **argv)
/*
* subscribe to image topic
*/
auto img_sub = ROS_CREATE_SUBSCRIBER(sensor_msgs::Image, "image_in", 5, img_callback);
auto img_sub = ROS_CREATE_SUBSCRIBER(sensor_msgs::Image, "image_in", subscriber_queue_length, img_callback);


/*
Expand Down
6 changes: 5 additions & 1 deletion src/node_imagenet.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -159,12 +159,15 @@ int main(int argc, char **argv)
std::string input_blob = IMAGENET_DEFAULT_INPUT;
std::string output_blob = IMAGENET_DEFAULT_OUTPUT;

int subscriber_queue_length = 5;

ROS_DECLARE_PARAMETER("model_name", model_name);
ROS_DECLARE_PARAMETER("model_path", model_path);
ROS_DECLARE_PARAMETER("prototxt_path", prototxt_path);
ROS_DECLARE_PARAMETER("class_labels_path", class_labels_path);
ROS_DECLARE_PARAMETER("input_blob", input_blob);
ROS_DECLARE_PARAMETER("output_blob", output_blob);
ROS_DECLARE_PARAMETER("subscriber_queue_length", subscriber_queue_length);


/*
Expand All @@ -176,6 +179,7 @@ int main(int argc, char **argv)
ROS_GET_PARAMETER("class_labels_path", class_labels_path);
ROS_GET_PARAMETER("input_blob", input_blob);
ROS_GET_PARAMETER("output_blob", output_blob);
ROS_GET_PARAMETER("subscriber_queue_length", subscriber_queue_length);


/*
Expand Down Expand Up @@ -271,7 +275,7 @@ int main(int argc, char **argv)
/*
* subscribe to image topic
*/
auto img_sub = ROS_CREATE_SUBSCRIBER(sensor_msgs::Image, "image_in", 5, img_callback);
auto img_sub = ROS_CREATE_SUBSCRIBER(sensor_msgs::Image, "image_in", subscriber_queue_length, img_callback);


/*
Expand Down
6 changes: 5 additions & 1 deletion src/node_segnet.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,8 @@ int main(int argc, char **argv)

float overlay_alpha = 180.0f;

int subscriber_queue_length = 5;

ROS_DECLARE_PARAMETER("model_name", model_name);
ROS_DECLARE_PARAMETER("model_path", model_path);
ROS_DECLARE_PARAMETER("prototxt_path", prototxt_path);
Expand All @@ -197,6 +199,7 @@ int main(int argc, char **argv)
ROS_DECLARE_PARAMETER("mask_filter", mask_filter_str);
ROS_DECLARE_PARAMETER("overlay_filter", overlay_filter_str);
ROS_DECLARE_PARAMETER("overlay_alpha", overlay_alpha);
ROS_DECLARE_PARAMETER("subscriber_queue_length", subscriber_queue_length);

/*
* retrieve parameters
Expand All @@ -211,6 +214,7 @@ int main(int argc, char **argv)
ROS_GET_PARAMETER("mask_filter", mask_filter_str);
ROS_GET_PARAMETER("overlay_filter", overlay_filter_str);
ROS_GET_PARAMETER("overlay_alpha", overlay_alpha);
ROS_GET_PARAMETER("subscriber_queue_length", subscriber_queue_length);

overlay_filter = segNet::FilterModeFromStr(overlay_filter_str.c_str(), segNet::FILTER_LINEAR);
mask_filter = segNet::FilterModeFromStr(mask_filter_str.c_str(), segNet::FILTER_LINEAR);
Expand Down Expand Up @@ -318,7 +322,7 @@ int main(int argc, char **argv)
/*
* subscribe to image topic
*/
auto img_sub = ROS_CREATE_SUBSCRIBER(sensor_msgs::Image, "image_in", 5, img_callback);
auto img_sub = ROS_CREATE_SUBSCRIBER(sensor_msgs::Image, "image_in", subscriber_queue_length, img_callback);


/*
Expand Down