@@ -231,6 +231,10 @@ class RTDEClient
231231 comm::INotifier notifier_;
232232 std::unique_ptr<comm::Pipeline<RTDEPackage>> pipeline_;
233233 RTDEWriter writer_;
234+ std::atomic<bool > reconnecting_;
235+ std::atomic<bool > stop_reconnection_;
236+ std::mutex reconnect_mutex_;
237+ std::thread reconnecting_thread_;
234238
235239 VersionInformation urcontrol_version_;
236240
@@ -249,12 +253,13 @@ class RTDEClient
249253 // the robot is booted.
250254 std::vector<std::string> ensureTimestampIsPresent (const std::vector<std::string>& output_recipe) const ;
251255
252- void setupCommunication (const size_t max_num_tries = 0 ,
256+ bool setupCommunication (const size_t max_num_tries = 0 ,
253257 const std::chrono::milliseconds reconnection_time = std::chrono::seconds(10 ));
254- bool negotiateProtocolVersion (const uint16_t protocol_version);
255- void queryURControlVersion ();
256- void setupOutputs (const uint16_t protocol_version);
257- void setupInputs ();
258+ uint16_t negotiateProtocolVersion ();
259+ bool queryURControlVersion ();
260+ void setTargetFrequency ();
261+ bool setupOutputs (const uint16_t protocol_version);
262+ bool setupInputs ();
258263 void disconnect ();
259264
260265 /* !
@@ -288,6 +293,12 @@ class RTDEClient
288293 * \returns A vector of variable variable_names
289294 */
290295 std::vector<std::string> splitVariableTypes (const std::string& variable_types) const ;
296+
297+ /* !
298+ * \brief Reconnects to the RTDE interface and set the input and output recipes again.
299+ */
300+ void reconnect ();
301+ void reconnectCallback ();
291302};
292303
293304} // namespace rtde_interface
0 commit comments