Animation - polaris ranger wheels won't straighten out
I'm trying to do a simple animation with the polaris_ranger_ev where it just takes two 90 degree turns. For the first turn, the front wheels turn appropriately but then once it's done turning and is just moving forward, the wheels don't go back to normal, they're still turned. At the second turn (opposite direction), the wheels don't turn like they did for the first turn.
I followed the Animated Box tutorial, here is the code that I am using:
public: void Load(physics::ModelPtr _parent, sdf::ElementPtr /*_sdf*/)
{
// Store the pointer to the model
this->model = _parent;
// create the animation
gazebo::common::PoseAnimationPtr anim(
// name the animation "test",
// make it last 60 seconds,
// and set it not to repeat
new gazebo::common::PoseAnimation("test", 80.0, false));
gazebo::common::PoseKeyFrame *key;
// set starting location of the model
key = anim->CreateKeyFrame(0);
key->SetTranslation(math::Vector3(0, 0, 0));
key->SetRotation(math::Quaternion(0, 0, 0));
// set waypoint location after 10 seconds
key = anim->CreateKeyFrame(10.0);
key->SetTranslation(math::Vector3(0, 0, 0));
key->SetRotation(math::Quaternion(0, 0, 0));
key = anim->CreateKeyFrame(20.0);
key->SetTranslation(math::Vector3(1, 0, 0));
key->SetRotation(math::Quaternion(0, 0, 0));
key = anim->CreateKeyFrame(30.0);
key->SetTranslation(math::Vector3(2, 0, 0));
key->SetRotation(math::Quaternion(0, 0, 0));
key = anim->CreateKeyFrame(40.0);
key->SetTranslation(math::Vector3(3, 1, 0));
key->SetRotation(math::Quaternion(0, 0, 1.5707));
key = anim->CreateKeyFrame(50.0);
key->SetTranslation(math::Vector3(3, 2, 0));
key->SetRotation(math::Quaternion(0, 0, 1.5707));
key = anim->CreateKeyFrame(60.0);
key->SetTranslation(math::Vector3(3, 3, 0));
key->SetRotation(math::Quaternion(0, 0, 1.5707));
key = anim->CreateKeyFrame(70.0);
key->SetTranslation(math::Vector3(4, 4, 0));
key->SetRotation(math::Quaternion(0, 0, 0));
key = anim->CreateKeyFrame(80);
key->SetTranslation(math::Vector3(5, 4, 0));
key->SetRotation(math::Quaternion(0, 0, 0));
// set the animation
_parent->SetAnimation(anim);
}
Is this plugin attached to the polaris model, is physics enabled, and is the polaris model marked as static?
Yes, the plugin is attached to the polaris model, in the .world file I did <plugin name="push_animate" filename="libmy_animation.so"/> Physics is enabled in the plugin. The polaris model is not marked as static.