Commits

John Hsu  committed 915c4da

remove compile warnings

  • Participants
  • Parent commits 7ac5837
  • Branches joint_effort_limit

Comments (0)

Files changed (8)

File gazebo/physics/Joint.cc

 //////////////////////////////////////////////////
 double Joint::GetEffortLimit(int _index)
 {
-  if (_index >= 0 && _index < this->GetAngleCount())
+  if (_index >= 0 && static_cast<unsigned int>(_index) < this->GetAngleCount())
     return this->effortLimit[_index];
 
   gzerr << "GetEffortLimit index[" << _index << "] out of range\n";
 //////////////////////////////////////////////////
 double Joint::GetVelocityLimit(int _index)
 {
-  if (_index >= 0 && _index < this->GetAngleCount())
+  if (_index >= 0 && static_cast<unsigned int>(_index) < this->GetAngleCount())
     return this->velocityLimit[_index];
 
   gzerr << "GetVelocityLimit index[" << _index << "] out of range\n";
 {
   // this bit of code actually doesn't do anything physical,
   // it simply records the forces commanded inside forceApplied.
-  if (_index >= 0 && _index < this->GetAngleCount())
+  if (_index >= 0 && static_cast<unsigned int>(_index) < this->GetAngleCount())
     this->forceApplied[_index] = _force;
   else
     gzerr << "Something's wrong, joint [" << this->GetName()
 //////////////////////////////////////////////////
 double Joint::GetForce(int _index)
 {
-  if (_index >= 0 && _index < this->GetAngleCount())
+  if (_index >= 0 && static_cast<unsigned int>(_index) < this->GetAngleCount())
   {
     return this->forceApplied[_index];
   }

File gazebo/physics/bullet/BulletHingeJoint.cc

 //////////////////////////////////////////////////
 void BulletHingeJoint::SetForce(int _index, double _torque)
 {
-  if (_index < 0 || _index >= this->GetAngleCount())
+  if (_index < 0 || static_cast<unsigned int>(_index) >= this->GetAngleCount())
   {
     gzerr << "Calling BulletHingeJoint::SetForce with an index ["
           << _index << "] out of range\n";

File gazebo/physics/bullet/BulletSliderJoint.cc

 //////////////////////////////////////////////////
 void BulletSliderJoint::SetForce(int _index, double _force)
 {
-  if (_index < 0 || _index >= this->GetAngleCount())
+  if (_index < 0 || static_cast<unsigned int>(_index) >= this->GetAngleCount())
   {
     gzerr << "Calling BulletSliderJoint::SetForce with an index ["
           << _index << "] out of range\n";

File gazebo/physics/ode/ODEHinge2Joint.cc

 //////////////////////////////////////////////////
 void ODEHinge2Joint::SetForce(int _index, double _torque)
 {
-  if (_index < 0 || _index >= this->GetAngleCount())
+  if (_index < 0 || static_cast<unsigned int>(_index) >= this->GetAngleCount())
   {
     gzerr << "Calling BulletHingeJoint::SetForce with an index ["
           << _index << "] out of range\n";

File gazebo/physics/ode/ODEHingeJoint.cc

 //////////////////////////////////////////////////
 void ODEHingeJoint::SetForce(int _index, double _torque)
 {
-  if (_index < 0 || _index >= this->GetAngleCount())
+  if (_index < 0 || static_cast<unsigned int>(_index) >= this->GetAngleCount())
   {
     gzerr << "Calling ODEHingeJoint::SetForce with an index ["
           << _index << "] out of range\n";

File gazebo/physics/ode/ODEScrewJoint.cc

 //////////////////////////////////////////////////
 void ODEScrewJoint::SetForce(int _index, double _force)
 {
-  if (_index < 0 || _index >= this->GetAngleCount())
+  if (_index < 0 || static_cast<unsigned int>(_index) >= this->GetAngleCount())
   {
     gzerr << "Calling ODEScrewJoint::SetForce with an index ["
           << _index << "] out of range\n";

File gazebo/physics/ode/ODESliderJoint.cc

 //////////////////////////////////////////////////
 void ODESliderJoint::SetForce(int _index, double _force)
 {
-  if (_index < 0 || _index >= this->GetAngleCount())
+  if (_index < 0 || static_cast<unsigned int>(_index) >= this->GetAngleCount())
   {
     gzerr << "Calling ODEScrewJoint::SetForce with an index ["
           << _index << "] out of range\n";

File gazebo/physics/ode/ODEUniversalJoint.cc

 //////////////////////////////////////////////////
 void ODEUniversalJoint::SetForce(int _index, double _torque)
 {
-  if (_index < 0 || _index >= this->GetAngleCount())
+  if (_index < 0 || static_cast<unsigned int>(_index) >= this->GetAngleCount())
   {
     gzerr << "Calling ODEUniversalJoint::SetForce with an index ["
           << _index << "] out of range\n";