cube rotates with linear velocity
Hi, I am new to Gazebo and trying out the tutorials. When I run the second tutorial, in which a cube is created and a linear velocity is given to it, the cube translates for a while and then starts to topple about its edge. This toppling behavior continues from there on. If I increase the velocity I dont see this behavior. Can anyone explain that why is the linear velocity causing rotational motion.
Thanks.
The Plugin Code
include <boost bind.hpp="">
include <gazebo gazebo.hh="">
include <gazebo physics="" physics.hh="">
include <gazebo common="" common.hh="">
include <stdio.h>
namespace gazebo { class ModelPush : public ModelPlugin { public: void Load(physics::ModelPtr parent, sdf::ElementPtr /*sdf*/) { // Store the pointer to the model this->model = _parent;
// Listen to the update event. This event is broadcast every
// simulation iteration.
this->updateConnection = event::Events::ConnectWorldUpdateBegin(
boost::bind(&ModelPush::OnUpdate, this, _1));
}
// Called by the world update start event
public: void OnUpdate(const common::UpdateInfo & /*_info*/)
{
// Apply a small linear velocity to the model.
this->model->SetLinearVel(math::Vector3(.03, 0, 0));
}
// Pointer to the model
private: physics::ModelPtr model;
// Pointer to the update event connection
private: event::ConnectionPtr updateConnection;
};
// Register this plugin with the simulator GZREGISTERMODEL_PLUGIN(ModelPush) }
could you post your plugin?
is the model colliding with anything? or just floating around the world (with gravity disabled?)
No its not colliding with anything, I am using the exact same thing as given in this link --- http://gazebosim.org/wiki/Tutorials/2.2/plugins/ModelPush I guess the gravity is disabled, because its not specifically being set anywhere.