Domain Randomization Plugin Interface. More...
#include <DRInterface.hh>
Public Member Functions | |
| DRInterface () | |
| Constructor. More... | |
| DRRequest | createRequest () |
| Creates a domain randomization request. More... | |
| void | publish (const DRRequest &msg) |
| Publishes request. More... | |
| void | publish (const gazebo::msgs::Visual &msg) |
| Publishes visual request. More... | |
| void | addGravity (DRRequest &msg, const ignition::math::Vector3d &gravity) |
| Updates physics engine gravity. More... | |
| void | addModelScale (DRRequest &msg, const std::string &model, const ignition::math::Vector3d &scale) |
| Updates model scale. More... | |
| void | addLinkMass (DRRequest &msg, const std::string &model, const std::string &link, double mass) |
| Updates link mass. More... | |
| void | addInertiaMatrix (DRRequest &msg, const std::string &model, const std::string &link, double ixx, double iyy, double izz, double ixy, double ixz, double iyz) |
| Updates link inertia matrix. More... | |
| void | addSurface (DRRequest &msg, const std::string &model, const std::string &link, const std::string &collision, const gazebo::msgs::Surface &surface) |
| Updates collision surface. More... | |
| void | addJoint (DRRequest &msg, const std::string &model, const std::string &joint, double limit_lower=INFINITY, double limit_upper=INFINITY, double limit_effort=INFINITY, double limit_velocity=INFINITY, double damping=INFINITY, double friction=INFINITY) |
| Updates joint. More... | |
| void | addModelCmd (DRRequest &msg, const std::string &model, const std::string &joint, int type, double p_gain=INFINITY, double i_gain=INFINITY, double d_gain=INFINITY) |
| Updates model controllers. More... | |
| void | addColors (gazebo::msgs::Visual &msg, const std::string &visual, const std::string &parent, const ignition::math::Color &ambient, const ignition::math::Color &diffuse, const ignition::math::Color &emissive, const ignition::math::Color &specular) |
| Updates visual color. 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 char | VISUAL_TOPIC [] = "~/visual" |
| Topic for outgoing visual requests. More... | |
| static const int | POSITION = 0 |
| Position controller type. More... | |
| static const int | VELOCITY = 1 |
| Velocity controller type. More... | |
Private Attributes | |
| gazebo::transport::NodePtr | node |
| Node used for transport. More... | |
| gazebo::transport::PublisherPtr | pub |
| Publisher to the request topic. More... | |
| gazebo::transport::PublisherPtr | pub_visual |
| Publisher to the visual topic. More... | |
Domain Randomization Plugin Interface.
| DRInterface | ( | ) |
Constructor.
| void addColors | ( | gazebo::msgs::Visual & | msg, |
| const std::string & | visual, | ||
| const std::string & | parent, | ||
| const ignition::math::Color & | ambient, | ||
| const ignition::math::Color & | diffuse, | ||
| const ignition::math::Color & | emissive, | ||
| const ignition::math::Color & | specular | ||
| ) |
Updates visual color.
| msg | Output visual message request |
| visual | The target visual name |
| visual | The target visual's parent name |
| ambient | The ambient color |
| diffuse | The diffuse color |
| emissive | The emissive color |
| specular | The specular color |
| void addGravity | ( | DRRequest & | msg, |
| const ignition::math::Vector3d & | gravity | ||
| ) |
Updates physics engine gravity.
| msg | Output domain randomization request |
| gravity | New gravity vector |
| void addInertiaMatrix | ( | DRRequest & | msg, |
| const std::string & | model, | ||
| const std::string & | link, | ||
| double | ixx, | ||
| double | iyy, | ||
| double | izz, | ||
| double | ixy, | ||
| double | ixz, | ||
| double | iyz | ||
| ) |
Updates link inertia matrix.
| msg | Output domain randomization request |
| model | The target model name |
| link | The target link name |
| ixx | The new Ixx |
| iyy | The new Iyy |
| izz | The new Izz |
| ixy | The new Ixy |
| ixz | The new Ixz |
| iyz | The new Iyz |
| void addJoint | ( | DRRequest & | msg, |
| const std::string & | model, | ||
| const std::string & | joint, | ||
| double | limit_lower = INFINITY, |
||
| double | limit_upper = INFINITY, |
||
| double | limit_effort = INFINITY, |
||
| double | limit_velocity = INFINITY, |
||
| double | damping = INFINITY, |
||
| double | friction = INFINITY |
||
| ) |
Updates joint.
| msg | Output domain randomization request |
| model | The target model name |
| joint | The target joint name |
| limit_lower | New joint lower limit |
| limit_upper | New joint upper limit |
| limit_effort | New joint effort limit |
| limit_velocity | New joint velocity limit |
| limit_lower | New joint damping coefficient (TODO) |
| limit_lower | New joint static friction |
| void addLinkMass | ( | DRRequest & | msg, |
| const std::string & | model, | ||
| const std::string & | link, | ||
| double | mass | ||
| ) |
Updates link mass.
| msg | Output domain randomization request |
| model | The target model name |
| link | The target link name |
| mass | The new link mass |
| void addModelCmd | ( | DRRequest & | msg, |
| const std::string & | model, | ||
| const std::string & | joint, | ||
| int | type, | ||
| double | p_gain = INFINITY, |
||
| double | i_gain = INFINITY, |
||
| double | d_gain = INFINITY |
||
| ) |
Updates model controllers.
| msg | Output domain randomization request |
| model | The target model name |
| joint | The target joint scoped name |
| type | Type of controllers (POSITION or VELOCITY) |
| p_gain | New P gain |
| i_gain | New I gain |
| d_gain | New D gain |
| void addModelScale | ( | DRRequest & | msg, |
| const std::string & | model, | ||
| const ignition::math::Vector3d & | scale | ||
| ) |
Updates model scale.
| msg | Output domain randomization request |
| model | The target model name |
| scale | The new model scale |
| void addSurface | ( | DRRequest & | msg, |
| const std::string & | model, | ||
| const std::string & | link, | ||
| const std::string & | collision, | ||
| const gazebo::msgs::Surface & | surface | ||
| ) |
Updates collision surface.
| msg | Output domain randomization request |
| model | The target model |
| link | The target link name |
| collision | The target collision name |
| surface | The new surface parameters |
| DRRequest createRequest | ( | ) |
Creates a domain randomization request.
| void publish | ( | const DRRequest & | msg | ) |
Publishes request.
| Domain | randomization request |
| void publish | ( | const gazebo::msgs::Visual & | msg | ) |
Publishes visual request.
| Visual | message request |
|
private |
Node used for transport.
|
static |
Position controller type.
|
private |
Publisher to the request topic.
|
private |
Publisher to the visual topic.
|
static |
Topic for DRPlugin requests.
|
static |
Topic for DRPlugin responses.
|
static |
Velocity controller type.
|
static |
Topic for outgoing visual requests.