Robowflex
v0.1
Making MoveIt Easy
|
Wrapper class for a dart::dynamics::Skeleton. More...
#include <structure.h>
Public Member Functions | |
Constructors | |
Structure (const std::string &name) | |
Create an empty structure. More... | |
Structure (const std::string &name, const SceneConstPtr &scene) | |
Copy a MoveIt (robowflex::Scene) into a structure. More... | |
virtual | ~Structure ()=default |
Destructor. More... | |
StructurePtr | cloneStructure (const std::string &newName) const |
Clones this structure with a new name. More... | |
Getters and Setters | |
const std::string & | getName () const |
Get the name of this structure. More... | |
ACMPtr | getACM () |
Get the ACM for the structure. More... | |
const ACMPtr & | getACMConst () const |
Get the ACM for the structure. More... | |
void | setSkeleton (const dart::dynamics::SkeletonPtr &skeleton) |
Set the skeleton for the structure. More... | |
dart::dynamics::SkeletonPtr & | getSkeleton () |
Get the underlying skeleton for the structure. More... | |
const dart::dynamics::SkeletonPtr & | getSkeletonConst () const |
Get the underlying skeleton for the structure. More... | |
void | dumpGraphViz (std::ostream &out, bool standalone=true) |
Dumps the structure of the skeleton to a GraphViz file. More... | |
Getting and Setting Configurations | |
void | setJoint (const std::string &name, double value) |
Set the value of a 1-DoF joint in the structure. More... | |
void | setJoint (const std::string &name, const Eigen::Ref< const Eigen::VectorXd > &value) |
Set the value of a n-DoF joint in the structure. More... | |
bool | solveIK () |
Solve the current whole-body IK problem imposed on the structure. More... | |
void | setDof (unsigned int index, double value) |
Set the DoF at index to value. More... | |
Modifying Frames | |
std::vector< std::string > | getJointNames () const |
Get the joint names for this structure. More... | |
dart::dynamics::Joint * | getJoint (const std::string &joint_name) const |
Get a reference to the joint in the structure. More... | |
dart::dynamics::BodyNode * | getFrame (const std::string &name="") const |
Get a body node within the structure. More... | |
dart::dynamics::BodyNode * | getRootFrame () const |
Get the root frame of this structure. More... | |
void | reparentFreeFrame (dart::dynamics::BodyNode *child, const std::string &parent="") |
Reparents the child node to the parent node. More... | |
void | setJointParentTransform (const std::string &name, const RobotPose &tf) |
Set the transform from a joint to its parent. More... | |
void | updateCollisionObject (const std::string &name, const GeometryPtr &geometry, const robowflex::RobotPose &pose) |
Update or add a collision object. More... | |
Constructing Frames | |
std::pair< dart::dynamics::RevoluteJoint *, dart::dynamics::BodyNode * > | addRevoluteFrame (const dart::dynamics::RevoluteJoint::Properties &properties, const dart::dynamics::ShapePtr &shape, dart::dynamics::BodyNode *parent=nullptr) |
Add a new frame attached to a revolute joint to this structure. More... | |
std::pair< dart::dynamics::PrismaticJoint *, dart::dynamics::BodyNode * > | addPrismaticFrame (const dart::dynamics::PrismaticJoint::Properties &properties, const dart::dynamics::ShapePtr &shape, dart::dynamics::BodyNode *parent=nullptr) |
Add a new frame attached to a prismatic joint to this structure. More... | |
std::pair< dart::dynamics::FreeJoint *, dart::dynamics::BodyNode * > | addFreeFrame (const dart::dynamics::FreeJoint::Properties &properties, const dart::dynamics::ShapePtr &shape, dart::dynamics::BodyNode *parent=nullptr) |
Add a new frame attached to a free joint to this structure. More... | |
std::pair< dart::dynamics::WeldJoint *, dart::dynamics::BodyNode * > | addWeldedFrame (const dart::dynamics::WeldJoint::Properties &properties, const dart::dynamics::ShapePtr &shape, dart::dynamics::BodyNode *parent=nullptr) |
Add a new frame attached to a fixed joint to this structure. More... | |
void | addGround (double z=0., double radius=10.) |
Add a ground plane. More... | |
Protected Member Functions | |
void | createShapeNode (dart::dynamics::BodyNode *body, const dart::dynamics::ShapePtr &shape) |
Create a shape node on a body. More... | |
Protected Attributes | |
const std::string | name_ {"robot"} |
Name of the structure. More... | |
dart::dynamics::SkeletonPtr | skeleton_ {nullptr} |
Underlying skeleton. More... | |
ACMPtr | acm_ |
ACM for structure. More... | |
Wrapper class for a dart::dynamics::Skeleton.
Definition at line 52 of file structure.h.
Structure::Structure | ( | const std::string & | name | ) |
Create an empty structure.
[in] | name | Name of the structure. |
Definition at line 26 of file structure.cpp.
Structure::Structure | ( | const std::string & | name, |
const SceneConstPtr & | scene | ||
) |
Copy a MoveIt (robowflex::Scene) into a structure.
[in] | name | Name of the structure. |
[in] | scene | Scene to copy. |
Definition at line 32 of file structure.cpp.
|
virtualdefault |
Destructor.
std::pair< dart::dynamics::FreeJoint *, dart::dynamics::BodyNode * > Structure::addFreeFrame | ( | const dart::dynamics::FreeJoint::Properties & | properties, |
const dart::dynamics::ShapePtr & | shape, | ||
dart::dynamics::BodyNode * | parent = nullptr |
||
) |
Add a new frame attached to a free joint to this structure.
[in] | properties | Joint properties to use for joint. |
[in] | shape | Shape to attach to frame. |
[in] | parent | Parent frame to attach new joint to. |
Definition at line 212 of file structure.cpp.
void Structure::addGround | ( | double | z = 0. , |
double | radius = 10. |
||
) |
Add a ground plane.
[in] | z | Z- height of the plane. |
[in] | radius | X- and Y- width of the plane. |
Definition at line 240 of file structure.cpp.
std::pair< dart::dynamics::PrismaticJoint *, dart::dynamics::BodyNode * > Structure::addPrismaticFrame | ( | const dart::dynamics::PrismaticJoint::Properties & | properties, |
const dart::dynamics::ShapePtr & | shape, | ||
dart::dynamics::BodyNode * | parent = nullptr |
||
) |
Add a new frame attached to a prismatic joint to this structure.
[in] | properties | Joint properties to use for joint. |
[in] | shape | Shape to attach to frame. |
[in] | parent | Parent frame to attach new joint to. |
Definition at line 196 of file structure.cpp.
std::pair< dart::dynamics::RevoluteJoint *, dart::dynamics::BodyNode * > Structure::addRevoluteFrame | ( | const dart::dynamics::RevoluteJoint::Properties & | properties, |
const dart::dynamics::ShapePtr & | shape, | ||
dart::dynamics::BodyNode * | parent = nullptr |
||
) |
Add a new frame attached to a revolute joint to this structure.
[in] | properties | Joint properties to use for joint. |
[in] | shape | Shape to attach to frame. |
[in] | parent | Parent frame to attach new joint to. |
Definition at line 180 of file structure.cpp.
std::pair< dart::dynamics::WeldJoint *, dart::dynamics::BodyNode * > Structure::addWeldedFrame | ( | const dart::dynamics::WeldJoint::Properties & | properties, |
const dart::dynamics::ShapePtr & | shape, | ||
dart::dynamics::BodyNode * | parent = nullptr |
||
) |
Add a new frame attached to a fixed joint to this structure.
[in] | properties | Joint properties to use for joint. |
[in] | shape | Shape to attach to frame. |
[in] | parent | Parent frame to attach new joint to. |
Definition at line 227 of file structure.cpp.
StructurePtr Structure::cloneStructure | ( | const std::string & | newName | ) | const |
Clones this structure with a new name.
[in] | newName | Name for clone of the structure. |
Definition at line 76 of file structure.cpp.
|
protected |
Create a shape node on a body.
[in,out] | body | Body to add shape node to. |
[in] | shape | Shape to add to body. |
Definition at line 150 of file structure.cpp.
void Structure::dumpGraphViz | ( | std::ostream & | out, |
bool | standalone = true |
||
) |
Dumps the structure of the skeleton to a GraphViz file.
[in] | out | Stream to output to. |
[in] | standalone | If false, does not include graph header. |
Definition at line 118 of file structure.cpp.
ACMPtr Structure::getACM | ( | ) |
const ACMPtr & Structure::getACMConst | ( | ) | const |
dart::dynamics::BodyNode * Structure::getFrame | ( | const std::string & | name = "" | ) | const |
Get a body node within the structure.
[in] | name | Name of the node to retrieve. |
Definition at line 292 of file structure.cpp.
dart::dynamics::Joint * Structure::getJoint | ( | const std::string & | joint_name | ) | const |
Get a reference to the joint in the structure.
[in] | joint_name | Name of the joint to retrieve. |
Definition at line 287 of file structure.cpp.
std::vector< std::string > Structure::getJointNames | ( | ) | const |
Get the joint names for this structure.
Definition at line 278 of file structure.cpp.
const std::string & Structure::getName | ( | ) | const |
Get the name of this structure.
Definition at line 87 of file structure.cpp.
dart::dynamics::BodyNode * Structure::getRootFrame | ( | ) | const |
Get the root frame of this structure.
Definition at line 343 of file structure.cpp.
dart::dynamics::SkeletonPtr & Structure::getSkeleton | ( | ) |
Get the underlying skeleton for the structure.
Definition at line 108 of file structure.cpp.
const dart::dynamics::SkeletonPtr & Structure::getSkeletonConst | ( | ) | const |
Get the underlying skeleton for the structure.
Definition at line 113 of file structure.cpp.
void Structure::reparentFreeFrame | ( | dart::dynamics::BodyNode * | child, |
const std::string & | parent = "" |
||
) |
Reparents the child node to the parent node.
[in] | child | Child to reparent. |
[in] | parent | Name of new parent for the child frame. |
Definition at line 297 of file structure.cpp.
void Structure::setDof | ( | unsigned int | index, |
double | value | ||
) |
Set the DoF at index to value.
[in] | index | Index of DoF to set. |
[in] | value | Value to set DoF. |
Definition at line 273 of file structure.cpp.
void Structure::setJoint | ( | const std::string & | name, |
const Eigen::Ref< const Eigen::VectorXd > & | value | ||
) |
Set the value of a n-DoF joint in the structure.
[in] | name | Name of joint. |
[in] | value | Value to set joint. |
Definition at line 259 of file structure.cpp.
void Structure::setJoint | ( | const std::string & | name, |
double | value | ||
) |
Set the value of a 1-DoF joint in the structure.
[in] | name | Name of joint. |
[in] | value | Value to set joint. |
Definition at line 254 of file structure.cpp.
void Structure::setJointParentTransform | ( | const std::string & | name, |
const RobotPose & | tf | ||
) |
Set the transform from a joint to its parent.
[in] | name | Name of joint to set transform of. |
[in] | tf | Transform to set. |
Definition at line 314 of file structure.cpp.
void Structure::setSkeleton | ( | const dart::dynamics::SkeletonPtr & | skeleton | ) |
Set the skeleton for the structure.
[in] | skeleton | The new skeleton. |
Definition at line 102 of file structure.cpp.
bool Structure::solveIK | ( | ) |
Solve the current whole-body IK problem imposed on the structure.
Definition at line 265 of file structure.cpp.
void Structure::updateCollisionObject | ( | const std::string & | name, |
const GeometryPtr & | geometry, | ||
const robowflex::RobotPose & | pose | ||
) |
Update or add a collision object.
[in] | name | Name of object to add. |
[in] | geometry | Geometry of object. |
[in] | pose | Pose of object to set. |
Definition at line 323 of file structure.cpp.
|
protected |
ACM for structure.
Definition at line 262 of file structure.h.
|
protected |
Name of the structure.
Definition at line 260 of file structure.h.
|
protected |
Underlying skeleton.
Definition at line 261 of file structure.h.