DRInterface Class Reference

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...
 

Detailed Description

Domain Randomization Plugin Interface.

Constructor & Destructor Documentation

Constructor.

Member Function Documentation

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.

Note
Does not update value if it is INFINITY
Parameters
msgOutput visual message request
visualThe target visual name
visualThe target visual's parent name
ambientThe ambient color
diffuseThe diffuse color
emissiveThe emissive color
specularThe specular color
void addGravity ( DRRequest msg,
const ignition::math::Vector3d &  gravity 
)

Updates physics engine gravity.

Parameters
msgOutput domain randomization request
gravityNew 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.

Parameters
msgOutput domain randomization request
modelThe target model name
linkThe target link name
ixxThe new Ixx
iyyThe new Iyy
izzThe new Izz
ixyThe new Ixy
ixzThe new Ixz
iyzThe 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.

Note
Does not update value if it is INFINITY
Parameters
msgOutput domain randomization request
modelThe target model name
jointThe target joint name
limit_lowerNew joint lower limit
limit_upperNew joint upper limit
limit_effortNew joint effort limit
limit_velocityNew joint velocity limit
limit_lowerNew joint damping coefficient (TODO)
limit_lowerNew joint static friction
void addLinkMass ( DRRequest msg,
const std::string &  model,
const std::string &  link,
double  mass 
)

Updates link mass.

Parameters
msgOutput domain randomization request
modelThe target model name
linkThe target link name
massThe 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.

Note
Does not update value if it is INFINITY
Parameters
msgOutput domain randomization request
modelThe target model name
jointThe target joint scoped name
typeType of controllers (POSITION or VELOCITY)
p_gainNew P gain
i_gainNew I gain
d_gainNew D gain
void addModelScale ( DRRequest msg,
const std::string &  model,
const ignition::math::Vector3d &  scale 
)

Updates model scale.

Parameters
msgOutput domain randomization request
modelThe target model name
scaleThe 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.

Parameters
msgOutput domain randomization request
modelThe target model
linkThe target link name
collisionThe target collision name
surfaceThe new surface parameters
DRRequest createRequest ( )

Creates a domain randomization request.

Returns
Empty request
void publish ( const DRRequest msg)

Publishes request.

Parameters
Domainrandomization request
void publish ( const gazebo::msgs::Visual &  msg)

Publishes visual request.

Parameters
Visualmessage request

Member Data Documentation

gazebo::transport::NodePtr node
private

Node used for transport.

const int POSITION = 0
static

Position controller type.

gazebo::transport::PublisherPtr pub
private

Publisher to the request topic.

gazebo::transport::PublisherPtr pub_visual
private

Publisher to the visual topic.

const char REQUEST_TOPIC = "~/dr"
static

Topic for DRPlugin requests.

const char RESPONSE_TOPIC = "~/dr/response"
static

Topic for DRPlugin responses.

const int VELOCITY = 1
static

Velocity controller type.

const char VISUAL_TOPIC = "~/visual"
static

Topic for outgoing visual requests.


The documentation for this class was generated from the following files: