@@ -96,11 +96,13 @@ class RosServiceNode : public BT::ActionNodeBase
96
96
*/
97
97
static PortsList providedBasicPorts (PortsList addition)
98
98
{
99
- PortsList basic = {
100
- InputPort<std::string>(" service_name" , " __default__placeholder__" , " Service name" ),
101
- InputPort<int >(" server_timeout" , " Service server goal timeout (mSec)" ),
102
- InputPort<int >(" wait_for_server_timeout" , " Service server discovery timeout (mSec)" )
103
- };
99
+ PortsList basic = { InputPort<std::string>(" service_name" , " __default__placeholder__" ,
100
+ " Service name" ),
101
+ InputPort<int >(" server_timeout" , " Service server goal timeout "
102
+ " (mSec)" ),
103
+ InputPort<int >(" wait_for_server_timeout" , " Service server "
104
+ " discovery timeout "
105
+ " (mSec)" ) };
104
106
basic.insert (addition.begin (), addition.end ());
105
107
return basic;
106
108
}
@@ -236,12 +238,16 @@ inline RosServiceNode<T>::RosServiceNode(const std::string& instance_name,
236
238
{
237
239
int timeout = 0 ;
238
240
getInput (" server_timeout" , timeout);
239
- if (timeout > 0 ) {
241
+ if (timeout > 0 )
242
+ {
240
243
service_timeout_ = std::chrono::milliseconds (timeout);
241
244
}
242
- else {
243
- RCLCPP_WARN (node_->get_logger (), " %s: Port `server_timeout` is not greater than zero. "
244
- " Defaulting to %d mSec." , name ().c_str (), static_cast <int >(service_timeout_.count ()));
245
+ else
246
+ {
247
+ RCLCPP_WARN (logger (),
248
+ " %s: Port `server_timeout` is not greater than zero. "
249
+ " Defaulting to %d mSec." ,
250
+ name ().c_str (), static_cast <int >(service_timeout_.count ()));
245
251
}
246
252
}
247
253
// update wait_for_service_timeout_ if set throuh port and greater than 0
@@ -250,12 +256,16 @@ inline RosServiceNode<T>::RosServiceNode(const std::string& instance_name,
250
256
{
251
257
int timeout = 0 ;
252
258
getInput (" wait_for_server_timeout" , timeout);
253
- if (timeout > 0 ) {
259
+ if (timeout > 0 )
260
+ {
254
261
wait_for_service_timeout_ = std::chrono::milliseconds (timeout);
255
262
}
256
- else {
257
- RCLCPP_WARN (node_->get_logger (), " %s: Port `wait_for_server_timeout` is not greater than zero. "
258
- " Defaulting to %d mSec." , name ().c_str (), static_cast <int >(wait_for_service_timeout_.count ()));
263
+ else
264
+ {
265
+ RCLCPP_WARN (logger (),
266
+ " %s: Port `wait_for_server_timeout` is not greater than zero. "
267
+ " Defaulting to %d mSec." ,
268
+ name ().c_str (), static_cast <int >(wait_for_service_timeout_.count ()));
259
269
}
260
270
}
261
271
0 commit comments