RobWorkProject  23.9.11-
Classes | Public Member Functions | Static Public Member Functions | List of all members
DynamicWorkCellBuilder Class Reference

Helper for building Dynamic Workcells. More...

#include <DynamicWorkCellBuilder.hpp>

Classes

struct  ColorScheme
 Color scheme specification. More...
 
struct  PaHColors
 Default color scheme. More...
 

Public Member Functions

 DynamicWorkCellBuilder (const ColorScheme &colors=PaHColors())
 Create new builder with given color scheme. More...
 
virtual ~DynamicWorkCellBuilder ()
 Destructor.
 
void addFloor (rw::core::Ptr< rwsim::dynamics::DynamicWorkCell > dwc, const std::string &name="Floor", bool trimesh=false) const
 Add a fixed floor. More...
 
void addPlane (rw::core::Ptr< rwsim::dynamics::DynamicWorkCell > dwc, const rw::math::Vector3D<> &n, double d, const std::string &name="Plane", bool trimesh=false) const
 Add a fixed plane. More...
 
void addBall (rw::core::Ptr< rwsim::dynamics::DynamicWorkCell > dwc, double radius, double density, const std::string &name="Ball", const std::string &parent="WORLD") const
 Add a dynamic ball. More...
 
void addBallFixed (rw::core::Ptr< rwsim::dynamics::DynamicWorkCell > dwc, double radius, const std::string &name="Ball", const std::string &parent="WORLD") const
 Add a fixed ball. More...
 
void addCylinder (rw::core::Ptr< rwsim::dynamics::DynamicWorkCell > dwc, double radius, double height, double density, const std::string &name="Cylinder", const std::string &parent="WORLD", bool trimesh=false) const
 Add a dynamic cylinder. More...
 
void addCylinderFixed (rw::core::Ptr< rwsim::dynamics::DynamicWorkCell > dwc, double radius, double height, const std::string &name="Cylinder", const std::string &parent="WORLD", bool trimesh=false) const
 Add a fixed cylinder. More...
 
void addTube (rw::core::Ptr< rwsim::dynamics::DynamicWorkCell > dwc, double radius, double thickness, double height, double density, const std::string &name="Tube", bool trimesh=false) const
 Add a dynamic tube. More...
 
void addBox (rw::core::Ptr< rwsim::dynamics::DynamicWorkCell > dwc, double x, double y, double z, double density, const std::string &name="Box", bool trimesh=false) const
 Add a dynamic box. More...
 
void addBoxKin (rw::core::Ptr< rwsim::dynamics::DynamicWorkCell > dwc, double x, double y, double z, const std::string &name="Box", bool trimesh=false) const
 Add a kinematic box. More...
 

Static Public Member Functions

static rwsim::dynamics::BodyInfo defaultInfo ()
 Construct default body info. More...
 
static void defaultInfo (rwsim::dynamics::BodyInfo &info)
 Insert default info into existing body info. More...
 
static void ballInfo (rwsim::dynamics::BodyInfo &info, double radius, double density)
 Add mass properties for a ball. More...
 
static void cylinderInfo (rwsim::dynamics::BodyInfo &info, double radius, double height, double density)
 Add mass properties for a cylinder. More...
 
static void tubeInfo (rwsim::dynamics::BodyInfo &info, double radius, double thickness, double height, double density)
 Add mass properties for a tube. More...
 
static void boxInfo (rwsim::dynamics::BodyInfo &info, double x, double y, double z, double density)
 Add mass properties for a box. More...
 
static void addMaterialData (rw::core::Ptr< rwsim::dynamics::DynamicWorkCell > dwc, double friction=0, double restitution=0)
 Add material data to the dynamic workcell. More...
 
static void contactsExclude (rw::core::Ptr< rwsim::dynamics::DynamicWorkCell > dwc, const std::string &bodyA, const std::string &bodyB)
 Exclude pairs of bodies from contact detection. More...
 

Detailed Description

Helper for building Dynamic Workcells.

Constructor & Destructor Documentation

◆ DynamicWorkCellBuilder()

DynamicWorkCellBuilder ( const ColorScheme colors = PaHColors())

Create new builder with given color scheme.

Parameters
colors[in] the colors to use.

Member Function Documentation

◆ addBall()

void addBall ( rw::core::Ptr< rwsim::dynamics::DynamicWorkCell dwc,
double  radius,
double  density,
const std::string &  name = "Ball",
const std::string &  parent = "WORLD" 
) const

Add a dynamic ball.

Parameters
dwc[in] the dynamic workcell to add new body to.
radius[in] radius of the ball.
density[in] the mass density.
name[in] (optional) the name of the body - default is Ball.
parent[in] (optional) the name of the parent frame - default is WORLD.

◆ addBallFixed()

void addBallFixed ( rw::core::Ptr< rwsim::dynamics::DynamicWorkCell dwc,
double  radius,
const std::string &  name = "Ball",
const std::string &  parent = "WORLD" 
) const

Add a fixed ball.

Parameters
dwc[in] the dynamic workcell to add new body to.
radius[in] radius of the ball.
name[in] (optional) the name of the body - default is Ball.
parent[in] (optional) the name of the parent frame - default is WORLD.

◆ addBox()

void addBox ( rw::core::Ptr< rwsim::dynamics::DynamicWorkCell dwc,
double  x,
double  y,
double  z,
double  density,
const std::string &  name = "Box",
bool  trimesh = false 
) const

Add a dynamic box.

Parameters
dwc[in] the dynamic workcell to add new body to.
x[in] side length.
y[in] side length.
z[in] side length.
density[in] the mass density.
name[in] (optional) the name of the body - default is Box.
trimesh[in] (optional) use a trimesh to represent the geometry.

◆ addBoxKin()

void addBoxKin ( rw::core::Ptr< rwsim::dynamics::DynamicWorkCell dwc,
double  x,
double  y,
double  z,
const std::string &  name = "Box",
bool  trimesh = false 
) const

Add a kinematic box.

Parameters
dwc[in] the dynamic workcell to add new body to.
x[in] side length.
y[in] side length.
z[in] side length.
name[in] (optional) the name of the body - default is Box.
trimesh[in] (optional) use a trimesh to represent the geometry.

◆ addCylinder()

void addCylinder ( rw::core::Ptr< rwsim::dynamics::DynamicWorkCell dwc,
double  radius,
double  height,
double  density,
const std::string &  name = "Cylinder",
const std::string &  parent = "WORLD",
bool  trimesh = false 
) const

Add a dynamic cylinder.

Parameters
dwc[in] the dynamic workcell to add new body to.
radius[in] radius of the cylinder.
height[in] the length of the cylinder.
density[in] the mass density.
name[in] (optional) the name of the body - default is Cylinder.
parent[in] (optional) the name of the parent frame - default is WORLD.
trimesh[in] (optional) use a trimesh to represent the geometry.

◆ addCylinderFixed()

void addCylinderFixed ( rw::core::Ptr< rwsim::dynamics::DynamicWorkCell dwc,
double  radius,
double  height,
const std::string &  name = "Cylinder",
const std::string &  parent = "WORLD",
bool  trimesh = false 
) const

Add a fixed cylinder.

Parameters
dwc[in] the dynamic workcell to add new body to.
radius[in] radius of the cylinder.
height[in] the length of the cylinder.
name[in] (optional) the name of the body - default is Cylinder.
parent[in] (optional) the name of the parent frame - default is WORLD.
trimesh[in] (optional) use a trimesh to represent the geometry.

◆ addFloor()

void addFloor ( rw::core::Ptr< rwsim::dynamics::DynamicWorkCell dwc,
const std::string &  name = "Floor",
bool  trimesh = false 
) const

Add a fixed floor.

Parameters
dwc[in] the dynamic workcell to add new body to.
name[in] (optional) the name of the body - default is Floor.
trimesh[in] (optional) use a trimesh to represent the geometry.

◆ addMaterialData()

static void addMaterialData ( rw::core::Ptr< rwsim::dynamics::DynamicWorkCell dwc,
double  friction = 0,
double  restitution = 0 
)
static

Add material data to the dynamic workcell.

Parameters
dwc[in] the dynamic workcell to add data to.
friction[in] (optional) the friction coefficient - default is 0.
restitution[in] (optional) the restitution coefficient - default is 0.

◆ addPlane()

void addPlane ( rw::core::Ptr< rwsim::dynamics::DynamicWorkCell dwc,
const rw::math::Vector3D<> &  n,
double  d,
const std::string &  name = "Plane",
bool  trimesh = false 
) const

Add a fixed plane.

Parameters
dwc[in] the dynamic workcell to add new body to.
n[in] the normal.
d[in] the distance.
name[in] (optional) the name of the body - default is Plane.
trimesh[in] (optional) use a trimesh to represent the geometry.

◆ addTube()

void addTube ( rw::core::Ptr< rwsim::dynamics::DynamicWorkCell dwc,
double  radius,
double  thickness,
double  height,
double  density,
const std::string &  name = "Tube",
bool  trimesh = false 
) const

Add a dynamic tube.

Parameters
dwc[in] the dynamic workcell to add new body to.
radius[in] radius of the tube.
thickness[in] the thickness of the tube.
height[in] the length of the tube.
density[in] the mass density.
name[in] (optional) the name of the body - default is Tube.
trimesh[in] (optional) use a trimesh to represent the geometry.

◆ ballInfo()

static void ballInfo ( rwsim::dynamics::BodyInfo info,
double  radius,
double  density 
)
static

Add mass properties for a ball.

Parameters
info[in/out] the body info to update.
radius[in] the radius of the ball.
density[in] the mass density.

◆ boxInfo()

static void boxInfo ( rwsim::dynamics::BodyInfo info,
double  x,
double  y,
double  z,
double  density 
)
static

Add mass properties for a box.

Parameters
info[in/out] the body info to update.
x[in] side length.
y[in] side length.
z[in] side length.
density[in] the mass density.

◆ contactsExclude()

static void contactsExclude ( rw::core::Ptr< rwsim::dynamics::DynamicWorkCell dwc,
const std::string &  bodyA,
const std::string &  bodyB 
)
static

Exclude pairs of bodies from contact detection.

Parameters
dwc[in] dynamic workcell to add information to.
bodyA[in] pattern of the first name.
bodyB[in] pattern of the second name.

◆ cylinderInfo()

static void cylinderInfo ( rwsim::dynamics::BodyInfo info,
double  radius,
double  height,
double  density 
)
static

Add mass properties for a cylinder.

Parameters
info[in/out] the body info to update.
radius[in] the radius.
height[in] the length of the cylinder.
density[in] the mass density.

◆ defaultInfo() [1/2]

static rwsim::dynamics::BodyInfo defaultInfo ( )
static

Construct default body info.

Returns
default body info.

◆ defaultInfo() [2/2]

static void defaultInfo ( rwsim::dynamics::BodyInfo info)
static

Insert default info into existing body info.

Parameters
info[in/out] the body info to update.

◆ tubeInfo()

static void tubeInfo ( rwsim::dynamics::BodyInfo info,
double  radius,
double  thickness,
double  height,
double  density 
)
static

Add mass properties for a tube.

Parameters
info[in/out] the body info to update.
radius[in] the radius.
thickness[in] the thickness of the tube.
height[in] the length of the tube.
density[in] the mass density.

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