Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added emergency nortification for temperature and torque to ThermoLimiter #229

Merged
merged 15 commits into from
Oct 10, 2014
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Fixed default tauMax from model. climit -> climit*gearRatio*torqueConst
  • Loading branch information
orikuma committed Jul 8, 2014
commit 9898518732fd9a627ac21f36bfe6dc12a2f1d3ac
8 changes: 4 additions & 4 deletions rtc/ThermoLimiter/ThermoLimiter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -146,9 +146,9 @@ RTC::ReturnCode_t ThermoLimiter::onInitialize()
std::cerr << (*it).temperature << "," << (*it).currentCoeffs << "," << (*it).thermoCoeffs << ", ";
}
std::cerr << std::endl;
std::cerr << "default climit value:" << std::endl;
std::cerr << "default torque limit from model:" << std::endl;
for (int i = 0; i < m_robot->numJoints(); i++) {
std::cerr << m_robot->joint(i)->name << ":" << m_robot->joint(i)->climit << std::endl;
std::cerr << m_robot->joint(i)->name << ":" << m_robot->joint(i)->climit * m_robot->joint(i)->gearRatio * m_robot->joint(i)->torqueConst << std::endl;
}
}

Expand Down Expand Up @@ -237,7 +237,7 @@ RTC::ReturnCode_t ThermoLimiter::onExecute(RTC::UniqueId ec_id)
calcMaxTorqueFromTemperature(tauMax);
} else {
for (int i = 0; i < m_robot->numJoints(); i++) {
tauMax[i] = m_robot->joint(i)->climit; // default torque limit from model
tauMax[i] = m_robot->joint(i)->climit * m_robot->joint(i)->gearRatio * m_robot->joint(i)->torqueConst; // default torque limit from model
}
}

Expand Down Expand Up @@ -320,7 +320,7 @@ void ThermoLimiter::calcMaxTorqueFromTemperature(hrp::dvector &tauMax)
// determine tauMax
if (squareTauMax[i] < 0) {
std::cerr << "[WARN] tauMax ** 2 = " << squareTauMax[i] << " < 0 in Joint " << i << std::endl;
tauMax[i] = m_robot->joint(i)->climit; // default tauMax from model file
tauMax[i] = m_robot->joint(i)->climit * m_robot->joint(i)->gearRatio * m_robot->joint(i)->torqueConst; // default tauMax from model file
} else {
tauMax[i] = std::sqrt(squareTauMax[i]); // tauMax is absolute value
}
Expand Down