ActorPlugin.hh
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2016 Open Source Robotics Foundation
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  *
16 */
17 
18 #ifndef GAZEBO_PLUGINS_ACTORPLUGIN_HH_
19 #define GAZEBO_PLUGINS_ACTORPLUGIN_HH_
20 
21 #include <string>
22 #include <vector>
23 
24 #include "gazebo/common/Plugin.hh"
25 #include "gazebo/physics/physics.hh"
26 #include "gazebo/util/system.hh"
27 
28 namespace gazebo
29 {
31  {
33  public: ActorPlugin();
34 
38  public: virtual void Load(physics::ModelPtr _model, sdf::ElementPtr _sdf);
39 
42  private: void OnUpdate(const common::UpdateInfo &_info);
43 
45  private: void ChooseNewTarget();
46 
51  private: void HandleObstacles(ignition::math::Vector3d &_pos);
52 
54  private: physics::ActorPtr actor;
55 
57  private: physics::WorldPtr world;
58 
60  private: ignition::math::Vector3d velocity;
61 
63  private: std::vector<event::ConnectionPtr> connections;
64 
66  private: ignition::math::Vector3d target;
67 
69  private: double targetWeight = 1.0;
70 
72  private: double obstacleWeight = 1.0;
73 
76  private: double animationFactor = 1.0;
77 
79  private: common::Time lastUpdate;
80 
82  private: std::vector<std::string> ignoreModels;
83 
85  private: physics::TrajectoryInfoPtr trajectoryInfo;
86  };
87 }
88 #endif
boost::shared_ptr< Actor > ActorPtr
Definition: PhysicsTypes.hh:97
boost::shared_ptr< World > WorldPtr
Definition: PhysicsTypes.hh:89
std::shared_ptr< TrajectoryInfo > TrajectoryInfoPtr
Definition: PhysicsTypes.hh:101
Information for use in an update event.
Definition: UpdateInfo.hh:30
Definition: ActorPlugin.hh:30
boost::shared_ptr< Model > ModelPtr
Definition: PhysicsTypes.hh:93
A plugin with access to physics::Model.
Definition: Plugin.hh:260
#define GAZEBO_VISIBLE
Use to represent "symbol visible" if supported.
Definition: system.hh:58
A Time class, can be used to hold wall- or sim-time.
Definition: Time.hh:44