Skip to content

Commit 32eaedb

Browse files
committed
[RCSotController] Save log in destructor
instead of in method stopping. The ROS driver for UniversalRobot stops from time to time. When this happens, roscontrol process is stopped and restarted. Before this commit, saving the logs between stop and restart made the robot stop for a few seconds. This is undesirable.
1 parent 80ea973 commit 32eaedb

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/roscontrol-sot-controller.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,11 @@ RCSotController::RCSotController()
7878
}
7979

8080
RCSotController::~RCSotController() {
81+
std::string afilename("/tmp/sot.log");
82+
83+
RcSotLog_.record(DataOneIter_);
84+
RcSotLog_.save(afilename);
85+
8186
SotLoaderBasic::CleanUp();
8287
using namespace ::dynamicgraph;
8388
RealTimeLogger::destroy();
@@ -1125,11 +1130,6 @@ void RCSotController::starting(const ros::Time &) {
11251130
}
11261131

11271132
void RCSotController::stopping(const ros::Time &) {
1128-
std::string afilename("/tmp/sot.log");
1129-
1130-
RcSotLog_.record(DataOneIter_);
1131-
RcSotLog_.save(afilename);
1132-
11331133
}
11341134

11351135
PLUGINLIB_EXPORT_CLASS(sot_controller::RCSotController, lci::ControllerBase)

0 commit comments

Comments
 (0)