Skip to content

Commit 2154824

Browse files
committed
Removed repeated declaration of timeout parameter which lead to
connection crash
1 parent bcce79b commit 2154824

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

ur_robot_driver/src/dashboard_client_ros.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ namespace ur_robot_driver
3232
DashboardClientROS::DashboardClientROS(const rclcpp::Node::SharedPtr& node, const std::string& robot_ip)
3333
: node_(node), client_(robot_ip)
3434
{
35+
node_->declare_parameter<double>("receive_timeout", 1);
3536
connect();
3637

3738
// Service to release the brakes. If the robot is currently powered off, it will get powered on on the fly.
@@ -199,7 +200,9 @@ bool DashboardClientROS::connect()
199200
{
200201
timeval tv;
201202
// Timeout after which a call to the dashboard server will be considered failure if no answer has been received.
202-
tv.tv_sec = node_->declare_parameter<double>("receive_timeout", 1);
203+
double time_buffer;
204+
node_->get_parameter("receive_timeout", time_buffer);
205+
tv.tv_sec = time_buffer;
203206
tv.tv_usec = 0;
204207
client_.setReceiveTimeout(tv);
205208
return client_.connect();

0 commit comments

Comments
 (0)