Skip to content

Commit

Permalink
Merge pull request #1 from ToToSpl/rovermovement
Browse files Browse the repository at this point in the history
issue cam2-auto-drone#2 trial_1 rovers eliptic movement on a straight road
  • Loading branch information
ToToSpl authored Dec 28, 2021
2 parents d4e9a82 + 5dc12a5 commit 5ef07f4
Showing 1 changed file with 25 additions and 1 deletion.
26 changes: 25 additions & 1 deletion trial_1_setup/animated_box.cc
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ namespace gazebo
// name the animation "test",
// make it last 10 seconds,
// and set it on a repeat loop
new gazebo::common::PoseAnimation("test", 35, true));
new gazebo::common::PoseAnimation("test", 71, true));

gazebo::common::PoseKeyFrame *key;

Expand All @@ -52,6 +52,30 @@ namespace gazebo
key->Translation(ignition::math::Vector3d(8, 0, 0.05));
key->Rotation(ignition::math::Quaterniond(0, 0, 0));

key = anim->CreateKeyFrame(33.0);
key->Translation(ignition::math::Vector3d(9, 0.5, 0.05));
key->Rotation(ignition::math::Quaterniond(0, 0, 1.57));

key = anim->CreateKeyFrame(36.0);
key->Translation(ignition::math::Vector3d(8, 1, 0.05));
key->Rotation(ignition::math::Quaterniond(0, 0, 3.14));

key = anim->CreateKeyFrame(45.0);
key->Translation(ignition::math::Vector3d(0, 1, 0.05));
key->Rotation(ignition::math::Quaterniond(0, 0, 3.14));

key = anim->CreateKeyFrame(65.0);
key->Translation(ignition::math::Vector3d(-8, 1, 0.05));
key->Rotation(ignition::math::Quaterniond(0, 0, 3.14));

key = anim->CreateKeyFrame(68.0);
key->Translation(ignition::math::Vector3d(-9, 0.5, 0.05));
key->Rotation(ignition::math::Quaterniond(0, 0, 4.71));

key = anim->CreateKeyFrame(71);
key->Translation(ignition::math::Vector3d(-8, 0, 0.05));
key->Rotation(ignition::math::Quaterniond(0, 0, 6.28));

// set the animation
_parent->SetAnimation(anim);
}
Expand Down

0 comments on commit 5ef07f4

Please sign in to comment.