Multi-purpose domain randomization plugin. More...
#include <DRPlugin.hh>
Public Member Functions | |
| DRPlugin () | |
| Constructs the object. More... | |
| virtual | ~DRPlugin () |
| Destroys the object. More... | |
| virtual void | Load (physics::WorldPtr _world, sdf::ElementPtr _sdf) |
| Loads the plugin. More... | |
| void | onUpdate () |
| Called on World Update event. More... | |
| void | onRequest (DRRequestPtr &_msg) |
| Callback function for handling incoming requests. More... | |
Static Public Attributes | |
| static const char | REQUEST_TOPIC [] = "~/dr" |
| Topic for DRPlugin requests. More... | |
| static const char | RESPONSE_TOPIC [] = "~/dr/response" |
| Topic for DRPlugin responses. More... | |
| static const int | POSITION = 0 |
| Position controller type. More... | |
| static const int | VELOCITY = 1 |
| Velocity controller type. More... | |
Private Member Functions | |
| void | processPhysics (const msgs::Physics &msg) |
| Processes physics message. More... | |
| void | processModel (const msgs::Model &msg) |
| Processes model message. More... | |
| void | processJoint (physics::ModelPtr model, const msgs::Joint &msg) |
| Updates joint. More... | |
| void | processLink (physics::ModelPtr model, const msgs::Link &msg) |
| Updates link. More... | |
| void | processInertial (physics::LinkPtr link, const msgs::Inertial &msg) |
| Updates inertial. More... | |
| void | processSurface (physics::CollisionPtr collision, const msgs::Surface &msg) |
| Updates surface. More... | |
| void | processModelCmd (const ModelCmdMsg &msg) |
| Processes model command message. More... | |
| void | processJointCmd (physics::ModelPtr model, const msgs::JointCmd &msg) |
| Processes joint command message. More... | |
| void | processPID (int type, physics::JointControllerPtr controller, const std::string &joint, const msgs::PID &msg) |
| Updates PID controller. More... | |
Private Attributes | |
| std::unique_ptr< DRPluginPrivate > | data_ptr |
| Class with private attributes. More... | |
| event::ConnectionPtr | update_connection |
| Connection to world update event. More... | |
| physics::WorldPtr | world |
| World to which the plugin is attached. More... | |
| physics::PhysicsEnginePtr | physics_engine |
| Physics engine pointer. More... | |
| boost::shared_ptr< DRRequest const > | msg |
| Pending request. More... | |
Multi-purpose domain randomization plugin.
See the example usage below:
See worlds/domain_randomization.world for a complete example.
| DRPlugin | ( | ) |
Constructs the object.
|
virtual |
Destroys the object.
|
virtual |
Loads the plugin.
| _world | The world pointer |
| _sdf | The sdf element pointer |
| void onRequest | ( | DRRequestPtr & | _msg | ) |
Callback function for handling incoming requests.
| _msg | The message |
| void onUpdate | ( | ) |
Called on World Update event.
|
private |
Updates inertial.
| link | Parent link pointer |
| msg | Inertial message |
|
private |
Updates joint.
| model | Parent model pointer |
| msg | Joint message |
|
private |
Processes joint command message.
| model | Parent model pointer |
| msg | Joint command message pointer |
|
private |
Updates link.
| model | Parent model pointer |
| msg | Link message |
|
private |
Processes model message.
| msg | Model message |
|
private |
Processes model command message.
| msg | Joint command message pointer |
|
private |
Processes physics message.
| msg | Physics message |
|
private |
Updates PID controller.
| type | PID controller type (POSITION or VELOCITY) |
| controller | Joint controller pointer |
| joint | Target joint name |
| msg | PID message pointer |
|
private |
Updates surface.
| collision | Parent collision pointer |
| msg | Surface message |
|
private |
Class with private attributes.
|
private |
Pending request.
|
private |
Physics engine pointer.
|
static |
Position controller type.
|
static |
Topic for DRPlugin requests.
|
static |
Topic for DRPlugin responses.
|
private |
Connection to world update event.
|
static |
Velocity controller type.
|
private |
World to which the plugin is attached.