delet plugin

This commit is contained in:
kijongGil 2018-05-31 10:44:12 +09:00
parent 153f9f617d
commit a067a9c496
8 changed files with 0 additions and 359 deletions

View File

@ -1,31 +0,0 @@
################################################################################
# CMake
################################################################################
cmake_minimum_required(VERSION 2.8 FATAL_ERROR)
################################################################################
# Packages
################################################################################
find_package(gazebo REQUIRED)
################################################################################
# Build
################################################################################
link_directories(${GAZEBO_LIBRARY_DIRS})
include_directories(${GAZEBO_INCLUDE_DIRS})
list(APPEND CMAKE_CXX_FLAGS "${GAZEBO_CXX_FLAGS}")
add_library(obstacle_1 SHARED obstacle_1.cc)
target_link_libraries(obstacle_1 ${GAZEBO_LIBRARIES})
add_library(obstacle_2 SHARED obstacle_2.cc)
target_link_libraries(obstacle_2 ${GAZEBO_LIBRARIES})
################################################################################
# Install
################################################################################

View File

@ -1,121 +0,0 @@
/*
* Copyright (C) 2012 Open Source Robotics Foundation
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
#include <gazebo/gazebo.hh>
#include <ignition/math.hh>
#include <gazebo/physics/physics.hh>
#include <gazebo/common/common.hh>
#include <stdio.h>
namespace gazebo
{
class Obstacle_1 : 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("move_1", 260.0, true));
gazebo::common::PoseKeyFrame *key;
// set starting location of the box
key = anim->CreateKeyFrame(0);
key->Translation(ignition::math::Vector3d(2, 2, 0));
key->Rotation(ignition::math::Quaterniond(0, 0, 0));
key = anim->CreateKeyFrame(20);
key->Translation(ignition::math::Vector3d(1.5, 0.8, 0));
key->Rotation(ignition::math::Quaterniond(0, 0, 0));
key = anim->CreateKeyFrame(40);
key->Translation(ignition::math::Vector3d(0.5, 1.5, 0));
key->Rotation(ignition::math::Quaterniond(0, 0, 0));
key = anim->CreateKeyFrame(50);
key->Translation(ignition::math::Vector3d(-0.3, 1.3, 0));
key->Rotation(ignition::math::Quaterniond(0, 0, 0));
key = anim->CreateKeyFrame(60);
key->Translation(ignition::math::Vector3d(-1, 0.8, 0));
key->Rotation(ignition::math::Quaterniond(0, 0, 0));
key = anim->CreateKeyFrame(80);
key->Translation(ignition::math::Vector3d(-2, 1.5, 0));
key->Rotation(ignition::math::Quaterniond(0, 0, 0));
key = anim->CreateKeyFrame(90);
key->Translation(ignition::math::Vector3d(-2.2, 0.8, 0));
key->Rotation(ignition::math::Quaterniond(0, 0, 0));
key = anim->CreateKeyFrame(110);
key->Translation(ignition::math::Vector3d(-1.8, -0.3, 0));
key->Rotation(ignition::math::Quaterniond(0, 0, 0));
key = anim->CreateKeyFrame(120);
key->Translation(ignition::math::Vector3d(-1.5, -1, 0));
key->Rotation(ignition::math::Quaterniond(0, 0, 0));
key = anim->CreateKeyFrame(140);
key->Translation(ignition::math::Vector3d(-0.6, -0.3, 0));
key->Rotation(ignition::math::Quaterniond(0, 0, 0));
key = anim->CreateKeyFrame(160);
key->Translation(ignition::math::Vector3d(0.5, -1.4, 0));
key->Rotation(ignition::math::Quaterniond(0, 0, 0));
key = anim->CreateKeyFrame(170);
key->Translation(ignition::math::Vector3d(1.1, -2, 0));
key->Rotation(ignition::math::Quaterniond(0, 0, 0));
key = anim->CreateKeyFrame(190);
key->Translation(ignition::math::Vector3d(2, -1, 0));
key->Rotation(ignition::math::Quaterniond(0, 0, 0));
key = anim->CreateKeyFrame(210);
key->Translation(ignition::math::Vector3d(1.2, 0, 0));
key->Rotation(ignition::math::Quaterniond(0, 0, 0));
key = anim->CreateKeyFrame(230);
key->Translation(ignition::math::Vector3d(0.5, 0.5, 0));
key->Rotation(ignition::math::Quaterniond(0, 0, 0));
key = anim->CreateKeyFrame(250);
key->Translation(ignition::math::Vector3d(2.2, 1.3, 0));
key->Rotation(ignition::math::Quaterniond(0, 0, 0));
key = anim->CreateKeyFrame(260);
key->Translation(ignition::math::Vector3d(2, 2, 0));
key->Rotation(ignition::math::Quaterniond(0, 0, 0));
// set the animation
_parent->SetAnimation(anim);
}
// Pointer to the model
private: physics::ModelPtr model;
// Pointer to the update event connection
private: event::ConnectionPtr updateConnection;
};
// Register this plugin with the simulator
GZ_REGISTER_MODEL_PLUGIN(Obstacle_1)
}

View File

@ -1,105 +0,0 @@
/*
* Copyright (C) 2012 Open Source Robotics Foundation
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
#include <gazebo/gazebo.hh>
#include <ignition/math.hh>
#include <gazebo/physics/physics.hh>
#include <gazebo/common/common.hh>
#include <stdio.h>
namespace gazebo
{
class Obstacle_2 : 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("move_2", 260.0, true));
gazebo::common::PoseKeyFrame *key;
// set starting location of the Obstacle
key = anim->CreateKeyFrame(0);
key->Translation(ignition::math::Vector3d(-2, -2, 0));
key->Rotation(ignition::math::Quaterniond(0, 0, 0));
key = anim->CreateKeyFrame(10);
key->Translation(ignition::math::Vector3d(-1.3, -2.1, 0));
key->Rotation(ignition::math::Quaterniond(0, 0, 0));
key = anim->CreateKeyFrame(30);
key->Translation(ignition::math::Vector3d(-0.4, -1.2, 0));
key->Rotation(ignition::math::Quaterniond(0, 0, 0));
key = anim->CreateKeyFrame(50);
key->Translation(ignition::math::Vector3d(-1, -0.6, 0));
key->Rotation(ignition::math::Quaterniond(0, 0, 0));
key = anim->CreateKeyFrame(60);
key->Translation(ignition::math::Vector3d(-0.2, -0.7, 0));
key->Rotation(ignition::math::Quaterniond(0, 0, 0));
key = anim->CreateKeyFrame(90);
key->Translation(ignition::math::Vector3d(1.1, -2, 0));
key->Rotation(ignition::math::Quaterniond(0, 0, 0));
key = anim->CreateKeyFrame(110);
key->Translation(ignition::math::Vector3d(2, -1, 0));
key->Rotation(ignition::math::Quaterniond(0, 0, 0));
key = anim->CreateKeyFrame(130);
key->Translation(ignition::math::Vector3d(1.2, 0, 0));
key->Rotation(ignition::math::Quaterniond(0, 0, 0));
key = anim->CreateKeyFrame(160);
key->Translation(ignition::math::Vector3d(0.5, 2, 0));
key->Rotation(ignition::math::Quaterniond(0, 0, 0));
key = anim->CreateKeyFrame(190);
key->Translation(ignition::math::Vector3d(-2.1, 1.6, 0));
key->Rotation(ignition::math::Quaterniond(0, 0, 0));
key = anim->CreateKeyFrame(220);
key->Translation(ignition::math::Vector3d(-0.3, 0.2, 0));
key->Rotation(ignition::math::Quaterniond(0, 0, 0));
key = anim->CreateKeyFrame(240);
key->Translation(ignition::math::Vector3d(-0.9, -2.1, 0));
key->Rotation(ignition::math::Quaterniond(0, 0, 0));
key = anim->CreateKeyFrame(260);
key->Translation(ignition::math::Vector3d(-2, -2, 0));
key->Rotation(ignition::math::Quaterniond(0, 0, 0));
// set the animation
_parent->SetAnimation(anim);
}
// Pointer to the model
private: physics::ModelPtr model;
// Pointer to the update event connection
private: event::ConnectionPtr updateConnection;
};
// Register this plugin with the simulator
GZ_REGISTER_MODEL_PLUGIN(Obstacle_2)
}

View File

@ -1,26 +0,0 @@
################################################################################
# CMake
################################################################################
cmake_minimum_required(VERSION 2.8 FATAL_ERROR)
################################################################################
# Packages
################################################################################
find_package(gazebo REQUIRED)
################################################################################
# Build
################################################################################
include_directories(${GAZEBO_INCLUDE_DIRS})
link_directories(${GAZEBO_LIBRARY_DIRS})
list(APPEND CMAKE_CXX_FLAGS "${GAZEBO_CXX_FLAGS}")
add_library(rotation_obstacle SHARED rotation_obstacle.cc)
target_link_libraries(rotation_obstacle ${GAZEBO_LIBRARIES})
################################################################################
# Install
################################################################################

View File

@ -1,76 +0,0 @@
/*
* Copyright (C) 2012 Open Source Robotics Foundation
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
#include <gazebo/gazebo.hh>
#include <ignition/math.hh>
#include <gazebo/physics/physics.hh>
#include <gazebo/common/common.hh>
#include <stdio.h>
namespace gazebo
{
class RotataionObstacle : 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 "rotation",
// make it last 120 seconds,
// and set it on a repeat loop
new gazebo::common::PoseAnimation("rotation", 120.0, true));
gazebo::common::PoseKeyFrame *key;
// set starting location of the box
key = anim->CreateKeyFrame(0);
key->Translation(ignition::math::Vector3d(0, 0, 0));
key->Rotation(ignition::math::Quaterniond(0, 0, M_PI * 0));
key = anim->CreateKeyFrame(30);
key->Translation(ignition::math::Vector3d(0, 0, 0));
key->Rotation(ignition::math::Quaterniond(0, 0, M_PI/2));
key = anim->CreateKeyFrame(60);
key->Translation(ignition::math::Vector3d(0, 0, 0));
key->Rotation(ignition::math::Quaterniond(0, 0, M_PI));
key = anim->CreateKeyFrame(90);
key->Translation(ignition::math::Vector3d(0, 0, 0));
key->Rotation(ignition::math::Quaterniond(0, 0, M_PI*3/2));
key = anim->CreateKeyFrame(120);
key->Translation(ignition::math::Vector3d(0, 0, 0));
key->Rotation(ignition::math::Quaterniond(0, 0, M_PI*2));
// set the animation
_parent->SetAnimation(anim);
}
// Pointer to the model
private: physics::ModelPtr model;
// Pointer to the update event connection
private: event::ConnectionPtr updateConnection;
};
// Register this plugin with the simulator
GZ_REGISTER_MODEL_PLUGIN(RotataionObstacle)
}