Skip to content

Commit 6be4c0e

Browse files
Update to modifications in the Stack of Tasks
- the device now only gets a control vector as input and sends the corresponding commands to the robot via roscontrol. Integration is now performed by a specific entity.
1 parent 1b7214d commit 6be4c0e

File tree

4 files changed

+12
-25
lines changed

4 files changed

+12
-25
lines changed

src/roscontrol-sot-controller.cpp

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -171,20 +171,8 @@ bool RCSotController::initRequest(lhi::RobotHW *robot_hw,
171171
ROS_WARN("initRequest 4");
172172
/// Create SoT
173173
SotLoaderBasic::Initialization();
174+
sotController_->setControlSize((int)joints_name_.size());
174175
ROS_WARN("initRequest 5");
175-
/// Fill desired position during the phase where the robot is waiting.
176-
for (unsigned int idJoint = 0; idJoint < joints_.size(); idJoint++) {
177-
std::string joint_name = joints_name_[idJoint];
178-
std::map<std::string, ControlPDMotorControlData>::iterator search_ecpd =
179-
effort_mode_pd_motors_.find(joint_name);
180-
181-
if (search_ecpd != effort_mode_pd_motors_.end()) {
182-
/// If we are in effort mode then the device
183-
/// should not do any integration.
184-
sotController_->setNoIntegration();
185-
}
186-
}
187-
ROS_WARN("initRequest 6");
188176
return true;
189177
}
190178

tests/sot-test-controller.cpp

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,15 @@ void SoTTestController::getControl(
101101
}
102102
}
103103

104+
void SoTTestController::setControlSize(const int& size)
105+
{
106+
device_->setControlSize(size);
107+
}
108+
109+
void SoTTestController::initialize()
110+
{
111+
}
112+
104113
void SoTTestController::setNoIntegration(void) { device_->setNoIntegration(); }
105114

106115
void SoTTestController::setSecondOrderIntegration(void) {

tests/sot-test-controller.hh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,8 @@ class SoTTestController : public dgsot::AbstractSotExternalInterface {
4141
void getControl(std::map<std::string, dgsot::ControlValues> &anglesOut,
4242
const double &period);
4343

44+
void setControlSize(const int& size);
45+
void initialize();
4446
void setNoIntegration(void);
4547
void setSecondOrderIntegration(void);
4648

tests/sot-test-device.cpp

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -101,16 +101,6 @@ SoTTestDevice::SoTTestDevice(std::string RobotName)
101101

102102
using namespace dynamicgraph::command;
103103
std::string docstring;
104-
/* Command increment. */
105-
docstring =
106-
"\n"
107-
" Integrate dynamics for time step provided as input\n"
108-
"\n"
109-
" take one floating point number as input\n"
110-
"\n";
111-
addCommand("increment",
112-
makeCommandVoid1((Device &)*this, &Device::increment, docstring));
113-
114104
sotDEBUGOUT(25);
115105
}
116106

@@ -303,8 +293,6 @@ void SoTTestDevice::getControl(map<string, dgsot::ControlValues> &controlOut,
303293
vector<double> anglesOut;
304294
anglesOut.resize(state_.size());
305295

306-
// Integrate control
307-
increment(period);
308296
sotDEBUG(25) << "state = " << state_ << std::endl;
309297
sotDEBUG(25) << "diff = "
310298
<< ((previousState_.size() == state_.size())

0 commit comments

Comments
 (0)