ActuatorPlugin.hh
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2015 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_ACTUATORPLUGIN_
19 #define GAZEBO_PLUGINS_ACTUATORPLUGIN_
20 
21 #include <functional>
22 #include <vector>
23 #include <string>
24 #include <gazebo/common/Events.hh>
25 #include <gazebo/physics/physics.hh>
26 #include <gazebo/gazebo.hh>
27 
54 
55 namespace gazebo
56 {
59  {
61  public: std::string name;
62 
64  public: int jointIndex;
65 
67  public: float power;
68 
70  public: float maximumVelocity;
71 
73  public: float maximumTorque;
74 
80  public: std::function<float (float, float, const ActuatorProperties&)>
82  };
83 
86  {
88  public: void Load(physics::ModelPtr _parent, sdf::ElementPtr _sdf);
89 
91  private: void WorldUpdateCallback();
92 
94  private: std::vector<physics::JointPtr> joints;
95 
97  private: std::vector<ActuatorProperties> actuators;
98 
100  private: std::vector<event::ConnectionPtr> connections;
101  };
102 
103  // Register this plugin with the simulator
105 }
106 
107 #endif
Forward declarations for the common classes.
Definition: Animation.hh:26
Plugin for simulating a torque-speed curve for actuators.
Definition: ActuatorPlugin.hh:85
#define GZ_REGISTER_MODEL_PLUGIN(classname)
Plugin registration function for model plugin.
Definition: Plugin.hh:421
std::function< float(float, float, const ActuatorProperties &)> modelFunction
Function used to calculate motor output.
Definition: ActuatorPlugin.hh:81
float power
Mechanical power output of the actuator (Watts)
Definition: ActuatorPlugin.hh:67
float maximumTorque
Maximum torque of the actuator (Newton-meters)
Definition: ActuatorPlugin.hh:73
Properties for a model of a rotational actuator.
Definition: ActuatorPlugin.hh:58
std::string name
An identifier for the actuator.
Definition: ActuatorPlugin.hh:61
int jointIndex
Which joint index is actuated by this actuator.
Definition: ActuatorPlugin.hh:64
float maximumVelocity
Maximum velocity of the actuator (radians per second)
Definition: ActuatorPlugin.hh:70
boost::shared_ptr< Model > ModelPtr
Definition: PhysicsTypes.hh:93
A plugin with access to physics::Model.
Definition: Plugin.hh:305
#define GAZEBO_VISIBLE
Use to represent "symbol visible" if supported.
Definition: system.hh:59