@@ -77,6 +77,12 @@ RCSotController::RCSotController()
77
77
RESETDEBUG4 ();
78
78
}
79
79
80
+ RCSotController::~RCSotController () {
81
+ SotLoaderBasic::CleanUp ();
82
+ using namespace ::dynamicgraph;
83
+ RealTimeLogger::destroy ();
84
+ }
85
+
80
86
void RCSotController::displayClaimedResources (
81
87
ClaimedResources &claimed_resources) {
82
88
#ifdef CONTROLLER_INTERFACE_KINETIC
@@ -127,6 +133,10 @@ void RCSotController::initLogs(ros::NodeHandle &robot_nh) {
127
133
profileLog_.length = length;
128
134
// / Initialize the data logger for 300s.
129
135
RcSotLog_.init (profileLog_);
136
+
137
+ using namespace ::dynamicgraph;
138
+ RealTimeLogger::instance ().addOutputStream (
139
+ LoggerStreamPtr_t (new LoggerROSStream ()));
130
140
}
131
141
132
142
bool RCSotController::initRequest (lhi::RobotHW *robot_hw,
@@ -944,7 +954,6 @@ void RCSotController::readControl(
944
954
void RCSotController::one_iteration () {
945
955
// Chrono start
946
956
RcSotLog_.start_it ();
947
-
948
957
// / Update the sensors.
949
958
fillSensors ();
950
959
@@ -959,6 +968,7 @@ void RCSotController::one_iteration() {
959
968
960
969
throw e;
961
970
}
971
+
962
972
try {
963
973
sotController_->getControl (controlValues_);
964
974
} catch (std::exception &e) {
@@ -1111,20 +1121,15 @@ void RCSotController::update(const ros::Time &, const ros::Duration &period) {
1111
1121
1112
1122
void RCSotController::starting (const ros::Time &) {
1113
1123
using namespace ::dynamicgraph;
1114
- RealTimeLogger::instance ().addOutputStream (
1115
- LoggerStreamPtr_t (new LoggerROSStream ()));
1116
-
1117
1124
fillSensors ();
1118
1125
}
1119
1126
1120
1127
void RCSotController::stopping (const ros::Time &) {
1121
1128
std::string afilename (" /tmp/sot.log" );
1122
- RcSotLog_.save (afilename);
1123
1129
1124
- SotLoaderBasic::CleanUp ();
1130
+ RcSotLog_.record (DataOneIter_);
1131
+ RcSotLog_.save (afilename);
1125
1132
1126
- using namespace ::dynamicgraph;
1127
- RealTimeLogger::destroy ();
1128
1133
}
1129
1134
1130
1135
PLUGINLIB_EXPORT_CLASS (sot_controller::RCSotController, lci::ControllerBase)
0 commit comments