26 #ifndef _DOMAIN_RANDOMIZATION_PLUGIN_HH_ 27 #define _DOMAIN_RANDOMIZATION_PLUGIN_HH_ 30 #include "gazebo/common/Plugin.hh" 31 #include <gazebo/msgs/msgs.hh> 32 #include <gazebo/transport/transport.hh> 33 #include <gazebo/sensors/sensors.hh> 36 #include "dr_request.pb.h" 37 #include "model_cmd.pb.h" 51 typedef const boost::shared_ptr<const gap::msgs::DRRequest>
56 typedef const boost::shared_ptr<const gap::msgs::ModelCmd>
85 private: std::unique_ptr<DRPluginPrivate>
data_ptr;
90 private: physics::WorldPtr
world;
95 private: boost::shared_ptr<DRRequest const>
msg;
108 public:
virtual void Load(
109 physics::WorldPtr _world, sdf::ElementPtr _sdf);
132 physics::ModelPtr model,
133 const msgs::Joint & msg);
139 physics::ModelPtr model,
140 const msgs::Link & msg);
146 physics::LinkPtr link,
147 const msgs::Inertial & msg);
153 physics::CollisionPtr collision,
154 const msgs::Surface & msg);
159 const ModelCmdMsg & msg);
165 physics::ModelPtr model,
166 const msgs::JointCmd & msg);
175 physics::JointControllerPtr controller,
176 const std::string & joint,
177 const msgs::PID & msg);
const boost::shared_ptr< const gap::msgs::DRRequest > DRRequestPtr
Shared pointer declaration for request message type.
Definition: DRPlugin.hh:52
Multi-purpose domain randomization plugin.
Definition: DRPlugin.hh:71
static const char RESPONSE_TOPIC[]
Topic for DRPlugin responses.
Definition: DRPlugin.hh:76
virtual ~DRPlugin()
Destroys the object.
Definition: DRPlugin.cc:61
void processInertial(physics::LinkPtr link, const msgs::Inertial &msg)
Updates inertial.
Definition: DRPlugin.cc:240
static const int POSITION
Position controller type.
Definition: DRPlugin.hh:78
Definition: CameraUtils.cc:30
static const int VELOCITY
Velocity controller type.
Definition: DRPlugin.hh:80
void onRequest(DRRequestPtr &_msg)
Callback function for handling incoming requests.
Definition: DRPlugin.cc:111
void processJointCmd(physics::ModelPtr model, const msgs::JointCmd &msg)
Processes joint command message.
Definition: DRPlugin.cc:296
void processPhysics(const msgs::Physics &msg)
Processes physics message.
Definition: DRPlugin.cc:124
void processSurface(physics::CollisionPtr collision, const msgs::Surface &msg)
Updates surface.
Definition: DRPlugin.cc:268
std::unique_ptr< DRPluginPrivate > data_ptr
Class with private attributes.
Definition: DRPlugin.hh:85
boost::shared_ptr< DRRequest const > msg
Pending request.
Definition: DRPlugin.hh:95
physics::PhysicsEnginePtr physics_engine
Physics engine pointer.
Definition: DRPlugin.hh:92
physics::WorldPtr world
World to which the plugin is attached.
Definition: DRPlugin.hh:90
void processModelCmd(const ModelCmdMsg &msg)
Processes model command message.
Definition: DRPlugin.cc:279
gap::msgs::ModelCmd ModelCmdMsg
Declaration for model command message type.
Definition: DRPlugin.hh:54
void processJoint(physics::ModelPtr model, const msgs::Joint &msg)
Updates joint.
Definition: DRPlugin.cc:166
virtual void Load(physics::WorldPtr _world, sdf::ElementPtr _sdf)
Loads the plugin.
Definition: DRPlugin.cc:67
const boost::shared_ptr< const gap::msgs::ModelCmd > ModelCmdPtr
Shared pointer declaration for model command message type.
Definition: DRPlugin.hh:57
event::ConnectionPtr update_connection
Connection to world update event.
Definition: DRPlugin.hh:87
void onUpdate()
Called on World Update event.
Definition: DRPlugin.cc:87
Class for private Domain Randomization plugin data.
Definition: DRPlugin.cc:37
gap::msgs::DRRequest DRRequest
Declaration for request message type.
Definition: DRPlugin.hh:49
void processLink(physics::ModelPtr model, const msgs::Link &msg)
Updates link.
Definition: DRPlugin.cc:211
DRPlugin()
Constructs the object.
Definition: DRPlugin.cc:54
static const char REQUEST_TOPIC[]
Topic for DRPlugin requests.
Definition: DRPlugin.hh:74
void processModel(const msgs::Model &msg)
Processes model message.
Definition: DRPlugin.cc:136
void processPID(int type, physics::JointControllerPtr controller, const std::string &joint, const msgs::PID &msg)
Updates PID controller.
Definition: DRPlugin.cc:320