##

ActuatorPlugin.hh
Go to the documentation of this file.
/*
* Copyright (C) 2015 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.
*
*/
#ifndef GAZEBO_PLUGINS_ACTUATORPLUGIN_
#define GAZEBO_PLUGINS_ACTUATORPLUGIN_
#include <functional>
#include <vector>
#include <string>
#include <gazebo/common/Events.hh>
#include <gazebo/physics/physics.hh>
#include <gazebo/gazebo.hh>
namespace gazebo
{
class ActuatorProperties
{
public: std::string name;
public: int jointIndex;
public: float power;
public: float maximumVelocity;
public: float maximumTorque;
public: std::function<float (float, float, const ActuatorProperties&)>
modelFunction;
};
class GAZEBO_VISIBLE ActuatorPlugin : public ModelPlugin
{
public: void Load(physics::ModelPtr _parent, sdf::ElementPtr _sdf);
private: void WorldUpdateCallback();
private: std::vector<physics::JointPtr> joints;
private: std::vector<ActuatorProperties> actuators;
private: std::vector<event::ConnectionPtr> connections;
};
// Register this plugin with the simulator
GZ_REGISTER_MODEL_PLUGIN(ActuatorPlugin)
}
#endif
Events.hh
gazebo
Forward declarations for the common classes.
Definition: Animation.hh:26
gazebo::ActuatorProperties::name
std::string name
An identifier for the actuator.
Definition: ActuatorPlugin.hh:61
gazebo::physics::ModelPtr
boost::shared_ptr< Model > ModelPtr
Definition: PhysicsTypes.hh:93
GZ_REGISTER_MODEL_PLUGIN
#define GZ_REGISTER_MODEL_PLUGIN(classname)
Plugin registration function for model plugin.
Definition: Plugin.hh:419
gazebo::ActuatorProperties
Properties for a model of a rotational actuator.
Definition: ActuatorPlugin.hh:58
gazebo.hh
gazebo::ActuatorProperties::maximumVelocity
float maximumVelocity
Maximum velocity of the actuator (radians per second)
Definition: ActuatorPlugin.hh:70
gazebo::ActuatorPlugin
Plugin for simulating a torque-speed curve for actuators.
Definition: ActuatorPlugin.hh:85
gazebo::ActuatorProperties::power
float power
Mechanical power output of the actuator (Watts)
Definition: ActuatorPlugin.hh:67
gazebo::ActuatorProperties::maximumTorque
float maximumTorque
Maximum torque of the actuator (Newton-meters)
Definition: ActuatorPlugin.hh:73
gazebo::ModelPlugin
A plugin with access to physics::Model.
Definition: Plugin.hh:303
gazebo::ActuatorProperties::modelFunction
std::function< float(float, float, const ActuatorProperties &)> modelFunction
Function used to calculate motor output.
Definition: ActuatorPlugin.hh:81
GAZEBO_VISIBLE
#define GAZEBO_VISIBLE
Definition: system.hh:59
gazebo::ActuatorProperties::jointIndex
int jointIndex
Which joint index is actuated by this actuator.
Definition: ActuatorPlugin.hh:64