1. OpenSourceRoboticsFoundation
  2. Simulation
  3. gazebo

Commits

John Hsu  committed 6f04a82 Merge

Merged in fix_velocity_limit (pull request #328)

Fix joint velocity limits and JointDamping test

  • Participants
  • Parent commits 74781a6, 6492ec3
  • Branches default
  • Tags gazebo-prerelease_1.4.8

Comments (0)

Files changed (1)

File gazebo/physics/Joint.cc

View file
   this->AddType(Base::JOINT);
   this->forceApplied[0] = 0;
   this->forceApplied[1] = 0;
+  this->effortLimit[0] = -1;
+  this->effortLimit[1] = -1;
+  this->velocityLimit[0] = -1;
+  this->velocityLimit[1] = -1;
 }
 
 //////////////////////////////////////////////////
       this->SetHighStop(0, limitElem->GetValueDouble("upper"));
       this->SetLowStop(0, limitElem->GetValueDouble("lower"));
       this->SetHighStop(0, limitElem->GetValueDouble("upper"));
-      if (limitElem->HasElement("effort"))
-        this->effortLimit[0] = limitElem->GetValueDouble("effort");
-      if (limitElem->HasElement("velocity"))
-        this->velocityLimit[0] = limitElem->GetValueDouble("velocity");
+      this->effortLimit[0] = limitElem->GetValueDouble("effort");
+      this->velocityLimit[0] = limitElem->GetValueDouble("velocity");
     }
   }
 
       this->SetHighStop(1, limitElem->GetValueDouble("upper"));
       this->SetLowStop(1, limitElem->GetValueDouble("lower"));
       this->SetHighStop(1, limitElem->GetValueDouble("upper"));
-      if (limitElem->HasElement("effort"))
-        this->effortLimit[1] = limitElem->GetValueDouble("effort");
-      if (limitElem->HasElement("velocity"))
-        this->velocityLimit[1] = limitElem->GetValueDouble("velocity");
+      this->effortLimit[1] = limitElem->GetValueDouble("effort");
+      this->velocityLimit[1] = limitElem->GetValueDouble("velocity");
     }
   }