Skip to content

Commit

Permalink
remove indent in namespace
Browse files Browse the repository at this point in the history
  • Loading branch information
GyuH13 committed Feb 5, 2025
1 parent 554c9b3 commit 3013cdc
Show file tree
Hide file tree
Showing 3 changed files with 142 additions and 146 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,70 +24,68 @@

namespace gazebo
{
class Obstacle1: public ModelPlugin
{
class Obstacle1: public ModelPlugin
{
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 "move_1",
// make it last 260 seconds,
// and set it on a repeat loop
new gazebo::common::PoseAnimation("move1", 160.0, true));
void Load(physics::ModelPtr _parent, sdf::ElementPtr /*_sdf*/)
{
// Store the pointer to the model
this->model = _parent;

gazebo::common::PoseKeyFrame * key;
// create the animation
gazebo::common::PoseAnimationPtr anim(
// name the animation "move_1",
// make it last 260 seconds,
// and set it on a repeat loop
new gazebo::common::PoseAnimation("move1", 160.0, true));

// set starting location of the box
key = anim->CreateKeyFrame(0);
key->Translation(ignition::math::Vector3d(0.0, 0.0, 0.0));
key->Rotation(ignition::math::Quaterniond(0, 0, 0));
gazebo::common::PoseKeyFrame * key;

key = anim->CreateKeyFrame(10);
key->Translation(ignition::math::Vector3d(-0.5, -1.0, 0.0));
key->Rotation(ignition::math::Quaterniond(0, 0, 0));
// set starting location of the box
key = anim->CreateKeyFrame(0);
key->Translation(ignition::math::Vector3d(0.0, 0.0, 0.0));
key->Rotation(ignition::math::Quaterniond(0, 0, 0));

key = anim->CreateKeyFrame(50);
key->Translation(ignition::math::Vector3d(-3.5, -1.0, 0.0));
key->Rotation(ignition::math::Quaterniond(0, 0, 0));
key = anim->CreateKeyFrame(10);
key->Translation(ignition::math::Vector3d(-0.5, -1.0, 0.0));
key->Rotation(ignition::math::Quaterniond(0, 0, 0));

key = anim->CreateKeyFrame(70);
key->Translation(ignition::math::Vector3d(-3.7, -3.0, 0.0));
key->Rotation(ignition::math::Quaterniond(0, 0, 0));
key = anim->CreateKeyFrame(50);
key->Translation(ignition::math::Vector3d(-3.5, -1.0, 0.0));
key->Rotation(ignition::math::Quaterniond(0, 0, 0));

key = anim->CreateKeyFrame(90);
key->Translation(ignition::math::Vector3d(-3.5, -1.0, 0.0));
key->Rotation(ignition::math::Quaterniond(0, 0, 0));
key = anim->CreateKeyFrame(70);
key->Translation(ignition::math::Vector3d(-3.7, -3.0, 0.0));
key->Rotation(ignition::math::Quaterniond(0, 0, 0));

key = anim->CreateKeyFrame(130);
key->Translation(ignition::math::Vector3d(-0.5, -1.0, 0.0));
key->Rotation(ignition::math::Quaterniond(0, 0, 0));
key = anim->CreateKeyFrame(90);
key->Translation(ignition::math::Vector3d(-3.5, -1.0, 0.0));
key->Rotation(ignition::math::Quaterniond(0, 0, 0));

key = anim->CreateKeyFrame(140);
key->Translation(ignition::math::Vector3d(0.0, 0.0, 0.0));
key->Rotation(ignition::math::Quaterniond(0, 0, 0));
key = anim->CreateKeyFrame(130);
key->Translation(ignition::math::Vector3d(-0.5, -1.0, 0.0));
key->Rotation(ignition::math::Quaterniond(0, 0, 0));

key = anim->CreateKeyFrame(160);
key->Translation(ignition::math::Vector3d(0.0, 0.0, 0.0));
key->Rotation(ignition::math::Quaterniond(0, 0, 0));
key = anim->CreateKeyFrame(140);
key->Translation(ignition::math::Vector3d(0.0, 0.0, 0.0));
key->Rotation(ignition::math::Quaterniond(0, 0, 0));

// set the animation
_parent->SetAnimation(anim);
}
key = anim->CreateKeyFrame(160);
key->Translation(ignition::math::Vector3d(0.0, 0.0, 0.0));
key->Rotation(ignition::math::Quaterniond(0, 0, 0));

// Pointer to the model
// set the animation
_parent->SetAnimation(anim);
}

// Pointer to the model
private:
physics::ModelPtr model;
physics::ModelPtr model;

// Pointer to the update event connection

private:
event::ConnectionPtr updateConnection;
};
// Register this plugin with the simulator
GZ_REGISTER_MODEL_PLUGIN(Obstacle1)
} // namespace gazebo
event::ConnectionPtr updateConnection;
};
// Register this plugin with the simulator
GZ_REGISTER_MODEL_PLUGIN(Obstacle1)
}// namespace gazebo
Original file line number Diff line number Diff line change
Expand Up @@ -24,85 +24,84 @@

namespace gazebo
{
class Obstacle2: public ModelPlugin
{
class Obstacle2: public ModelPlugin
{
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 "move_2",
// make it last 260 seconds,
// and set it on a repeat loop
new gazebo::common::PoseAnimation("move2", 140.0, true));
void Load(physics::ModelPtr _parent, sdf::ElementPtr /*_sdf*/)
{
// Store the pointer to the model
this->model = _parent;

gazebo::common::PoseKeyFrame * key;
// create the animation
gazebo::common::PoseAnimationPtr anim(
// name the animation "move_2",
// make it last 260 seconds,
// and set it on a repeat loop
new gazebo::common::PoseAnimation("move2", 140.0, true));

// set starting location of the box
key = anim->CreateKeyFrame(0);
key->Translation(ignition::math::Vector3d(0.0, 0.0, 0.0));
key->Rotation(ignition::math::Quaterniond(0, 0, 0));
gazebo::common::PoseKeyFrame * key;

key = anim->CreateKeyFrame(10);
key->Translation(ignition::math::Vector3d(0.7, 0.2, 0.0));
key->Rotation(ignition::math::Quaterniond(0, 0, 0));
// set starting location of the box
key = anim->CreateKeyFrame(0);
key->Translation(ignition::math::Vector3d(0.0, 0.0, 0.0));
key->Rotation(ignition::math::Quaterniond(0, 0, 0));

key = anim->CreateKeyFrame(40);
key->Translation(ignition::math::Vector3d(2.5, 3.5, 0.0));
key->Rotation(ignition::math::Quaterniond(0, 0, 0));
key = anim->CreateKeyFrame(10);
key->Translation(ignition::math::Vector3d(0.7, 0.2, 0.0));
key->Rotation(ignition::math::Quaterniond(0, 0, 0));

key = anim->CreateKeyFrame(55);
key->Translation(ignition::math::Vector3d(0.3, 3.5, 0.0));
key->Rotation(ignition::math::Quaterniond(0, 0, 0));
key = anim->CreateKeyFrame(40);
key->Translation(ignition::math::Vector3d(2.5, 3.5, 0.0));
key->Rotation(ignition::math::Quaterniond(0, 0, 0));

key = anim->CreateKeyFrame(85);
key->Translation(ignition::math::Vector3d(3.5, 1.8, 0.0));
key->Rotation(ignition::math::Quaterniond(0, 0, 0));
key = anim->CreateKeyFrame(55);
key->Translation(ignition::math::Vector3d(0.3, 3.5, 0.0));
key->Rotation(ignition::math::Quaterniond(0, 0, 0));

key = anim->CreateKeyFrame(100);
key->Translation(ignition::math::Vector3d(3.5, 0.0, 0.0));
key->Rotation(ignition::math::Quaterniond(0, 0, 0));
key = anim->CreateKeyFrame(85);
key->Translation(ignition::math::Vector3d(3.5, 1.8, 0.0));
key->Rotation(ignition::math::Quaterniond(0, 0, 0));

key = anim->CreateKeyFrame(110);
key->Translation(ignition::math::Vector3d(2.0, 0.5, 0.0));
key->Rotation(ignition::math::Quaterniond(0, 0, 0));
key = anim->CreateKeyFrame(100);
key->Translation(ignition::math::Vector3d(3.5, 0.0, 0.0));
key->Rotation(ignition::math::Quaterniond(0, 0, 0));

key = anim->CreateKeyFrame(115);
key->Translation(ignition::math::Vector3d(1.5, 1.0, 0.0));
key->Rotation(ignition::math::Quaterniond(0, 0, 0));
key = anim->CreateKeyFrame(110);
key->Translation(ignition::math::Vector3d(2.0, 0.5, 0.0));
key->Rotation(ignition::math::Quaterniond(0, 0, 0));

key = anim->CreateKeyFrame(120);
key->Translation(ignition::math::Vector3d(1.0, 0.5, 0.0));
key->Rotation(ignition::math::Quaterniond(0, 0, 0));
key = anim->CreateKeyFrame(115);
key->Translation(ignition::math::Vector3d(1.5, 1.0, 0.0));
key->Rotation(ignition::math::Quaterniond(0, 0, 0));

key = anim->CreateKeyFrame(125);
key->Translation(ignition::math::Vector3d(0.5, 0.1, 0.0));
key->Rotation(ignition::math::Quaterniond(0, 0, 0));
key = anim->CreateKeyFrame(120);
key->Translation(ignition::math::Vector3d(1.0, 0.5, 0.0));
key->Rotation(ignition::math::Quaterniond(0, 0, 0));

key = anim->CreateKeyFrame(130);
key->Translation(ignition::math::Vector3d(0.0, 0.0, 0.0));
key->Rotation(ignition::math::Quaterniond(0, 0, 0));
key = anim->CreateKeyFrame(125);
key->Translation(ignition::math::Vector3d(0.5, 0.1, 0.0));
key->Rotation(ignition::math::Quaterniond(0, 0, 0));

key = anim->CreateKeyFrame(140);
key->Translation(ignition::math::Vector3d(0.0, 0.0, 0.0));
key->Rotation(ignition::math::Quaterniond(0, 0, 0));
key = anim->CreateKeyFrame(130);
key->Translation(ignition::math::Vector3d(0.0, 0.0, 0.0));
key->Rotation(ignition::math::Quaterniond(0, 0, 0));

// set the animation
_parent->SetAnimation(anim);
}
key = anim->CreateKeyFrame(140);
key->Translation(ignition::math::Vector3d(0.0, 0.0, 0.0));
key->Rotation(ignition::math::Quaterniond(0, 0, 0));

// Pointer to the model
// set the animation
_parent->SetAnimation(anim);
}

// Pointer to the model
private:
physics::ModelPtr model;
// Pointer to the update event connection
physics::ModelPtr model;

// Pointer to the update event connection
private:
event::ConnectionPtr updateConnection;
};
// Register this plugin with the simulator
GZ_REGISTER_MODEL_PLUGIN(Obstacle2)
} // namespace gazebo
event::ConnectionPtr updateConnection;
};
// Register this plugin with the simulator
GZ_REGISTER_MODEL_PLUGIN(Obstacle2)
}// namespace gazebo
Original file line number Diff line number Diff line change
Expand Up @@ -26,49 +26,48 @@

namespace gazebo
{
class Obstacles: public ModelPlugin
{
class Obstacles: public ModelPlugin
{
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 "move",
// make it last 40 seconds,
// and set it on a repeat loop
new gazebo::common::PoseAnimation("move", 40.0, true));
void Load(physics::ModelPtr _parent, sdf::ElementPtr /*_sdf*/)
{
// Store the pointer to the model
this->model = _parent;

gazebo::common::PoseKeyFrame * key;
// create the animation
gazebo::common::PoseAnimationPtr anim(
// name the animation "move",
// make it last 40 seconds,
// and set it on a repeat loop
new gazebo::common::PoseAnimation("move", 40.0, true));

// set starting location of the box
key = anim->CreateKeyFrame(0);
key->Translation(ignition::math::Vector3d(0.0, 0.0, 0.0));
key->Rotation(ignition::math::Quaterniond(0, 0, 0));
gazebo::common::PoseKeyFrame * key;

key = anim->CreateKeyFrame(20);
key->Translation(ignition::math::Vector3d(0.0, 0.0, 0.0));
key->Rotation(ignition::math::Quaterniond(0, 0, PI));
// set starting location of the box
key = anim->CreateKeyFrame(0);
key->Translation(ignition::math::Vector3d(0.0, 0.0, 0.0));
key->Rotation(ignition::math::Quaterniond(0, 0, 0));

key = anim->CreateKeyFrame(40);
key->Translation(ignition::math::Vector3d(0.0, 0.0, 0.0));
key->Rotation(ignition::math::Quaterniond(0, 0, 2 * PI));
key = anim->CreateKeyFrame(20);
key->Translation(ignition::math::Vector3d(0.0, 0.0, 0.0));
key->Rotation(ignition::math::Quaterniond(0, 0, PI));

// set the animation
_parent->SetAnimation(anim);
}
key = anim->CreateKeyFrame(40);
key->Translation(ignition::math::Vector3d(0.0, 0.0, 0.0));
key->Rotation(ignition::math::Quaterniond(0, 0, 2 * PI));

// Pointer to the model
// set the animation
_parent->SetAnimation(anim);
}

// Pointer to the model
private:
physics::ModelPtr model;
// Pointer to the update event connection
physics::ModelPtr model;

// Pointer to the update event connection
private:
event::ConnectionPtr updateConnection;
};
event::ConnectionPtr updateConnection;
};
// Register this plugin with the simulator
GZ_REGISTER_MODEL_PLUGIN(Obstacles)
} // namespace gazebo
GZ_REGISTER_MODEL_PLUGIN(Obstacles)
}// namespace gazebo

0 comments on commit 3013cdc

Please sign in to comment.