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

do not check position/limit error when lower limit and upper limit is same #726

Merged
merged 1 commit into from
Jul 20, 2015
Merged
Changes from all commits
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
do not check position/limit error when lower limit and upper limit is…
… same
  • Loading branch information
k-okada committed Jul 20, 2015
commit ba8865ac37b3e1ae91594b8f7f2554c9481edd41
6 changes: 4 additions & 2 deletions rtc/SoftErrorLimiter/SoftErrorLimiter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,8 @@ RTC::ReturnCode_t SoftErrorLimiter::onExecute(RTC::UniqueId ec_id)
double qvel = (m_qRef.data[i] - prev_angle[i]) / dt;
double lvlimit = m_robot->joint(i)->lvlimit + 0.000175; // 0.01 deg / sec
double uvlimit = m_robot->joint(i)->uvlimit - 0.000175;
if ( servo_state[i] == 1 && ((lvlimit > qvel) || (uvlimit < qvel)) ) {
// fixed joint has ulimit = vlimit
if ( servo_state[i] == 1 && (uvlimit < uvlimit) && ((lvlimit > qvel) || (uvlimit < qvel)) ) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

こちらですが、
uvlimit < uvlimit
でなくて
lvlimit < uvlimit
ですね。
現状のものだとリミットがかかってない状態になりました。

if (loop % debug_print_freq == 0 || debug_print_velocity_first ) {
std::cerr << "velocity limit over " << m_robot->joint(i)->name << "(" << i << "), qvel=" << qvel
<< ", lvlimit =" << lvlimit
Expand Down Expand Up @@ -270,7 +271,8 @@ RTC::ReturnCode_t SoftErrorLimiter::onExecute(RTC::UniqueId ec_id)
llimit = it->second.getLlimit(m_qRef.data[it->second.getTargetJointId()]);
ulimit = it->second.getUlimit(m_qRef.data[it->second.getTargetJointId()]);
}
bool servo_limit_state = ((llimit > m_qRef.data[i]) || (ulimit < m_qRef.data[i]));
// fixed joint have vlimit = ulimit
bool servo_limit_state = (llimit < ulimit) && ((llimit > m_qRef.data[i]) || (ulimit < m_qRef.data[i]));
if ( servo_state[i] == 1 && servo_limit_state ) {
if (loop % debug_print_freq == 0 || debug_print_position_first) {
std::cerr << "position limit over " << m_robot->joint(i)->name << "(" << i << "), qRef=" << m_qRef.data[i]
Expand Down