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_ACTOR_PLUGIN_HH_
19 #define GAZEBO_PLUGINS_ACTOR_PLUGIN_HH_
20 
21 #include <string>
22 #include <vector>
23 
24 #include "gazebo/common/Plugin.hh"
25 #include "gazebo/physics/physics.hh"
26 #include "gazebo/transport/transport.hh"
27 #include "gazebo/util/system.hh"
28 
29 namespace gazebo
30 {
32  {
34  public: ActorPlugin();
35 
39  public: virtual void Load(physics::ModelPtr _model, sdf::ElementPtr _sdf);
40 
43  private: void OnUpdate(const common::UpdateInfo &_info);
44 
46  private: void ChooseNewTarget();
47 
52  private: void HandleObstacles(ignition::math::Vector3d &_pos);
53 
55  private: physics::ActorPtr actor;
56 
58  private: physics::WorldPtr world;
59 
61  private: ignition::math::Vector3d velocity;
62 
64  private: std::vector<event::ConnectionPtr> connections;
65 
67  private: ignition::math::Vector3d target;
68 
70  private: double targetWeight = 1.0;
71 
73  private: double obstacleWeight = 1.0;
74 
77  private: double animationFactor = 1.0;
78 
80  private: common::Time lastUpdate;
81 
83  private: std::vector<std::string> ignoreModels;
84 
86  private: physics::TrajectoryInfoPtr trajectoryInfo;
87  };
88 }
89 #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:31
boost::shared_ptr< Model > ModelPtr
Definition: PhysicsTypes.hh:93
A plugin with access to physics::Model.
Definition: Plugin.hh:245
#define GAZEBO_VISIBLE
Use to represent "symbol visible" if supported.
Definition: system.hh:59
A Time class, can be used to hold wall- or sim-time.
Definition: Time.hh:44