My model is not moving even after giving it a SetForce(0,1.00)

asked 2013-12-26 02:51:23 -0600

Saras Arya gravatar image

updated 2015-01-15 18:29:01 -0600

SL Remy gravatar image

My model is a simple mobile Robot taught in the tutorial. I am trying to make it move via plugin giving it parameters as in update function like

public: void Update(const common::UpdateInfo &)
{          std::cout<<"In update function"<<std::endl;
               physics::JointPtr MyJoint = _model->GetJoint("left_wheel_hinge");
                      if(MyJoint==NULL)
                          std::cout<<"My Left leg not working"<<std::endl;
               MyJoint->SetForce(0,1.00);
               std:: cout << "Joint Force : " << MyJoint->GetForce(0) << std::endl;
               physics::JointPtr MyJoint2=_model->GetJoint("right_wheel_hinge");
               MyJoint2->SetForce(0,1.00);
   }
};

i am confused plzz help fastt... thanks so much

edit retag flag offensive close merge delete

Comments

please edit your code to be in good format. If it's not running, i think there are 3 possible reasons: 1. Your robot's mass is too heavy. Suppose it's 1000 kg => it seems not move with only 1 Nm of Torque as you set. 2. You set force to wrong joint.

TyNguyen gravatar imageTyNguyen ( 2014-05-28 10:39:12 -0600 )edit