Grip-Reloaded
Grip version visualizaiton interface for DART (DynamicAnimationandRoboticsToolkits)
|
Class that is a subclass of osg::Group, which is the main object for DART visualization in OpenSceneGraph. It can contain many SkeletonNodes as parts of a simulation world. In essence, a DartNode is the largest visualization object. More...
#include <DartNode.h>
Public Member Functions | |
DartNode (bool debug=false) | |
Constructor for DartNode. | |
void | _updateContactForces () |
Creates arrows for contact forces in the world during simulation. | |
void | setContactForcesVisible (bool makeVisible) |
Toggles contact forces visibility on/off. | |
dart::dynamics::Skeleton * | parseSkeletonUrdf (std::string urdfFile) |
Create a dart::dynamics::Skeleton pointer from a skeleton urdf file using DART's DartLoader. | |
dart::simulation::World * | parseWorldSdf (std::string sdfFile) |
Create a dart::simulation::World pointer from a world sdf file using DART's Sdf parser. | |
dart::simulation::World * | parseWorldUrdf (std::string urdfFile) |
Create a dart::simulation::World pointer from a world urdf file using DART's DartLoader. | |
int | addWorldFromUrdf (std::string urdfFile) |
Add a dart::simulation::World to the DartNode using the name of a world urdf file. | |
size_t | addWorldFromSdf (std::string sdfFile) |
Add a dart::simulation::World to the DartNode using the name of a world sdf file. | |
size_t | addWorld (std::string file) |
Add dart::simulation::World to the DartNode using the name of a world file. | |
size_t | addSkeleton (std::string urdfFile) |
Add a dart::dynamics::Skeleton to the DartNode using the name of a skeleton urdf file. | |
size_t | addSkeleton (dart::dynamics::Skeleton &skeleton) |
Add a skeleton to the DartNode. | |
size_t | addWorld (dart::simulation::World *world) |
Add a world to the DartNode. The world may consist of one or more objects or skeletons, all represented as Skeletons, each with a world transformation. | |
dart::dynamics::Skeleton * | getSkeleton (size_t skeletonIndex=0) |
Get skeleton via index (size_t) | |
int | removeSkeleton (const dart::dynamics::Skeleton *skeletonToRemove) |
Remove skeleton from DartNode by passing in the pointer to the dart::dynamics::Skeleton to be removed. | |
int | removeSkeleton (size_t skeletonIndex=0) |
Remove skeleton from DartNode by passing in the index of the skeleton to be removed. | |
void | reset () |
Clear the DartNode. This is used for when you want to start from scratch but don't want to delete and create a new DartNode. | |
dart::simulation::World * | getWorld () |
Get a pointer to the World object in the DartNode. | |
size_t | getNumSkeletons () |
Get number of skeletons in the DartNode. | |
void | printInfo () |
Print out meta information of the skeleton. | |
void | update () |
Updates the transforms of all the dart objects in the SkeletonNodes of the DartNode for the next culling and drawing events. | |
void | setSkeletonTransparency (const dart::dynamics::Skeleton &skel, float transparencyValue) |
Sets the transparency value of the SkeletonNode corresponding to the dart::dynamics::Skeleton passed in. | |
void | setBodyNodeTransparency (const dart::dynamics::BodyNode &node, float transparencyValue) |
Sets the transparency value of the osg::Group corresponding to the dart::dynamics::BodyNode passed in. | |
void | setJointAxesVisible (bool makeVisible=false) |
Shows or hides the individual joint axes. This applies to skeletons with more than one link. A single line with an arrow is displayed representing the axis of rotation of the joint. This currently only applies to revolute joints. | |
void | setBodyNodeAxesVisible (bool makeVisible=false) |
Shows or hides the individual link frames, represented by x,y,z axes using the color scheme red, green, blue, respectively. Currently this function doesn't account for different sized objects so axes may not be visible for larger objects. | |
void | setSkeletonCoMVisible (bool makeVisible=false) |
Shows or hides the skeleton's center of mass, represented by a sphere. | |
void | setSkeletonCoMProjectedVisible (bool makeVisible=false) |
Shows or hides the skeleton's projected center of mass, represented by a circle on the ground. | |
void | setSkeletonCollisionMeshOn (bool enable=true) |
Render the skeleton using the collision mesh instead of the visual mesh. | |
void | setSkeletonWireFrameOn (bool enable=true) |
Render the skeleton using wireframe instead of fill mode. | |
void | hideSkeleton (int i) |
Hide a skeleton. | |
Protected Member Functions | |
int | skeletonIndexIsValid (size_t skeletonIndex) |
Helper function to determine if the index the user passed in to specify a skeleton is valid. | |
Protected Attributes | |
dart::simulation::World * | _world |
Standard vector of pointers to Skeletons. | |
std::vector < dart::dynamics::Skeleton * > | _skeletons |
Standard vector of pointers to dart::dynamics::Skeleton objects. | |
std::vector< osg::ref_ptr < SkeletonNode > > | _skeletonNodes |
Standard vector of pointers to SkeletonNode objects. | |
SkeletonNodeMap | _skelNodeMap |
Map from dart::dynamics::Skeleton* to osg::SkeletonNode. | |
std::vector< osg::ref_ptr < osgDart::ContactForceVisual > > | _contactForceArrows |
Array of osg::MatrixTransforms representing contactForces in the world. | |
const bool | _debug |
Debug variable for whether or not to print debug output. | |
bool | _showContactForces |
Whether or not to show the contact forces in the visualization. |
Class that is a subclass of osg::Group, which is the main object for DART visualization in OpenSceneGraph. It can contain many SkeletonNodes as parts of a simulation world. In essence, a DartNode is the largest visualization object.
void DartNode::_updateContactForces | ( | ) |
Creates arrows for contact forces in the world during simulation.
size_t DartNode::addSkeleton | ( | std::string | urdfFile | ) |
Add a dart::dynamics::Skeleton to the DartNode using the name of a skeleton urdf file.
urdfFile | The name of the urdf file |
size_t DartNode::addSkeleton | ( | dart::dynamics::Skeleton & | skeleton | ) |
size_t DartNode::addWorld | ( | std::string | file | ) |
size_t DartNode::addWorld | ( | dart::simulation::World * | world | ) |
Add a world to the DartNode. The world may consist of one or more objects or skeletons, all represented as Skeletons, each with a world transformation.
world | The dart::simulation::World object passed in by reference that contains one or more dart::dynamics::Skeleton objects. |
size_t DartNode::addWorldFromSdf | ( | std::string | sdfFile | ) |
int osgDart::DartNode::addWorldFromUrdf | ( | std::string | urdfFile | ) |
Add a dart::simulation::World to the DartNode using the name of a world urdf file.
urdfFile | The name of the urdf file |
size_t DartNode::getNumSkeletons | ( | ) |
dart::dynamics::Skeleton * DartNode::getSkeleton | ( | size_t | skeletonIndex = 0 | ) |
Get skeleton via index (size_t)
skeletonIndex | Index of the skeleton you want |
dart::simulation::World * DartNode::getWorld | ( | ) |
Get a pointer to the World object in the DartNode.
void DartNode::hideSkeleton | ( | int | i | ) |
Hide a skeleton.
int | skeleton index |
dart::dynamics::Skeleton * DartNode::parseSkeletonUrdf | ( | std::string | urdfFile | ) |
Create a dart::dynamics::Skeleton pointer from a skeleton urdf file using DART's DartLoader.
urdfFile | The name of the urdf file |
dart::simulation::World * DartNode::parseWorldSdf | ( | std::string | sdfFile | ) |
Create a dart::simulation::World pointer from a world sdf file using DART's Sdf parser.
sdfFile | The name of the world sdf file |
dart::simulation::World * DartNode::parseWorldUrdf | ( | std::string | urdfFile | ) |
Create a dart::simulation::World pointer from a world urdf file using DART's DartLoader.
urdfFile | The name of the urdf file |
void DartNode::printInfo | ( | ) |
Print out meta information of the skeleton.
skeletonIndex | Index of the skeleton about which to print info |
int DartNode::removeSkeleton | ( | const dart::dynamics::Skeleton * | skeletonToRemove | ) |
int DartNode::removeSkeleton | ( | size_t | skeletonIndex = 0 | ) |
void DartNode::reset | ( | ) |
void DartNode::setBodyNodeAxesVisible | ( | bool | makeVisible = false | ) |
Shows or hides the individual link frames, represented by x,y,z axes using the color scheme red, green, blue, respectively. Currently this function doesn't account for different sized objects so axes may not be visible for larger objects.
makeVisible | Whether or not to visualize the link axes |
void DartNode::setBodyNodeTransparency | ( | const dart::dynamics::BodyNode & | node, |
float | transparencyValue | ||
) |
Sets the transparency value of the osg::Group corresponding to the dart::dynamics::BodyNode passed in.
node | BodyNode of which to change the transparency value of |
transparencyValue | New transparency value for the BodyNode |
void DartNode::setContactForcesVisible | ( | bool | makeVisible | ) |
Toggles contact forces visibility on/off.
makeVisible | Whether or not to make them visible |
void DartNode::setJointAxesVisible | ( | bool | makeVisible = false | ) |
Shows or hides the individual joint axes. This applies to skeletons with more than one link. A single line with an arrow is displayed representing the axis of rotation of the joint. This currently only applies to revolute joints.
makeVisible | Whether or not to visualize the joint axes |
void DartNode::setSkeletonCollisionMeshOn | ( | bool | enable = true | ) |
Render the skeleton using the collision mesh instead of the visual mesh.
enable | Whether or not to enable the collision mesh |
void DartNode::setSkeletonCoMProjectedVisible | ( | bool | makeVisible = false | ) |
Shows or hides the skeleton's projected center of mass, represented by a circle on the ground.
makeVisible | Whether or not to visualize the skeleton's projected center of mass |
void DartNode::setSkeletonCoMVisible | ( | bool | makeVisible = false | ) |
Shows or hides the skeleton's center of mass, represented by a sphere.
makeVisible | Whether or not to visualize the skeleton's center of mass |
void DartNode::setSkeletonTransparency | ( | const dart::dynamics::Skeleton & | skel, |
float | transparencyValue | ||
) |
Sets the transparency value of the SkeletonNode corresponding to the dart::dynamics::Skeleton passed in.
skel | Skeleton of which to change the transparency value of |
transparencyValue | New transparency value for the skeleton |
void DartNode::setSkeletonWireFrameOn | ( | bool | enable = true | ) |
Render the skeleton using wireframe instead of fill mode.
enable | Whether or not to enable the wireframe mode |
int DartNode::skeletonIndexIsValid | ( | size_t | skeletonIndex | ) | [protected] |
Helper function to determine if the index the user passed in to specify a skeleton is valid.
skeletonIndex | The index of the desired skeleton |
void DartNode::update | ( | ) |
Updates the transforms of all the dart objects in the SkeletonNodes of the DartNode for the next culling and drawing events.