@@ -33,6 +33,11 @@ static bool ros_connection_logger(async_web_server_cpp::HttpServerRequestHandler
33
33
try
34
34
{
35
35
forward (request, connection, begin, end);
36
+ if (__verbose)
37
+ {
38
+ ROS_INFO_STREAM (" Request forwarded: " << request.uri );
39
+ }
40
+
36
41
return true ;
37
42
}
38
43
catch (std::exception &e)
@@ -64,6 +69,9 @@ WebVideoServer::WebVideoServer(ros::NodeHandle &nh, ros::NodeHandle &private_nh)
64
69
private_nh.param (" ros_threads" , ros_threads_, 2 );
65
70
private_nh.param (" publish_rate" , publish_rate_, -1.0 );
66
71
72
+ if (__verbose) {
73
+ ROS_INFO_STREAM (" Starting with args server threads: " << server_threads << " ros_threads: " << ros_threads_);
74
+ }
67
75
private_nh.param <std::string>(" default_stream_type" , __default_stream_type, " mjpeg" );
68
76
69
77
stream_types_[" mjpeg" ] = boost::shared_ptr<ImageStreamerType>(new MjpegStreamerType ());
@@ -101,7 +109,7 @@ WebVideoServer::~WebVideoServer()
101
109
void WebVideoServer::spin ()
102
110
{
103
111
server_->run ();
104
- ROS_INFO_STREAM (" Waiting For connections on " << address_ << " :" << port_);
112
+ ROS_INFO_STREAM (" Waiting For connections on " << address_ << " :" << port_);
105
113
106
114
ros::AsyncSpinner spinner (ros_threads_);
107
115
spinner.start ();
@@ -148,6 +156,9 @@ void WebVideoServer::cleanup_inactive_streams()
148
156
}
149
157
}
150
158
image_subscribers_.erase (new_end, image_subscribers_.end ());
159
+ if (__verbose) {
160
+ ROS_INFO_STREAM (" cleanup streams: " << " now serving " << image_subscribers_.size ());
161
+ }
151
162
}
152
163
}
153
164
@@ -184,6 +195,10 @@ bool WebVideoServer::handle_stream(const async_web_server_cpp::HttpRequest &requ
184
195
streamer->start ();
185
196
boost::mutex::scoped_lock lock (subscriber_mutex_);
186
197
image_subscribers_.push_back (streamer);
198
+ if (__verbose)
199
+ {
200
+ ROS_INFO_STREAM (" Serving " << image_subscribers_.size () << " streams" );
201
+ }
187
202
}
188
203
else
189
204
{
0 commit comments