Home | Tutorials | Wiki | Issues
Ask Your Question

Revision history [back]

The motion is not smooth because there are 4 unnecessary key frames. You can do just this:

gazebo::common::PoseAnimationPtr anim(new gazebo::common::PoseAnimation("box::my_joint5", 10.0, 0));

gazebo::common::PoseKeyFrame *key = anim->CreateKeyFrame(0.0);
key = anim->CreateKeyFrame(0);
key->SetTranslation(math::Vector3(0, 0, 0));
key = anim->CreateKeyFrame(10.0);
key->SetTranslation(math::Vector3(0, 0, 0.5));

_parent->SetAnimation(anim);