Gazebo | Ignition | Community
Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

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

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

click to hide/show revision 2
No.2 Revision

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

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");
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);
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