Quantcast
Channel: Gazebo: Q&A Forum - RSS feed
Viewing all articles
Browse latest Browse all 7017

Animation - polaris ranger wheels won't straighten out

$
0
0
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); }

Viewing all articles
Browse latest Browse all 7017

Trending Articles