Grip-Reloaded
Grip version visualizaiton interface for DART (DynamicAnimationandRoboticsToolkits)
|
Class which inherits osg::Group. More...
#include <SkeletonNode.h>
Public Member Functions | |
SkeletonNode (const dart::dynamics::Skeleton &skeleton, bool debug=false) | |
Constructor for SkeletonNode. | |
~SkeletonNode () | |
Destructor for SkeletonNode. | |
void | update () |
Update SkeletonNode MatrixTransforms based on the dart::Skeleton BodyNode world transforms. This is done recursively by traversing through the Skeleton bodyNodes and their children. | |
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 | setBodyNodeCoMVisible (bool makeVisible=false) |
Shows or hides the individual link center of masses, represented by a sphere. Currently not implemented. | |
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 | setSkeletonRenderMode (renderMode_t renderMode) |
Set the render mode of the Skeleton. | |
void | setBodyNodeTransparency (const dart::dynamics::BodyNode &node, float transparencyValue) |
Sets the transparency value of the specified BodyNode. | |
const dart::dynamics::BodyNode & | getRootBodyNode () |
Get root body node. | |
Protected Member Functions | |
void | _createSkeleton () |
Create the osg skeleton from the root BodyNode by traversing its children and creating osg::Nodes for each physical BodyNode and putting them inside a osg::MatrixTransform with it transform set to the BodyNode's world transform. | |
void | _addSkeletonVisuals () |
Add visual elements of skeleton that can be toggled on or off, such as the center of mass. | |
void | _addSkeletonObjectsRecursivley (const dart::dynamics::BodyNode &bodyNode) |
Recursively build osg skeleton starting with a BodyNode and recursively creating its children. An osg::MatrixTransform get created whose transform corresponds to the BodyNode's world transform and then an osg::Group node gets created from the BodyNode's shape information and get put inside the osg::MatrixTransform. Finally the osg::MatrixTransform gets added as a child to the root node of the SkeletonNode and it will recursively add osg::MatrixTransforms and Geode for all the children. | |
osg::Group * | _makeBodyNodeGroup (const dart::dynamics::BodyNode &node) |
Create osg::Group* object from a dart::dynamics::BodyNode passed in by reference. It generates the shape information in an OpenSceneGraph format, looping through the BodyNode's visualization shapes and converting them from aiScene objects to osg::Node objects and adding them as children to the BodyNode osg::Group. | |
osg::Group * | _makeBodyNodeCollisionMeshGroup (const dart::dynamics::BodyNode &node) |
Create osg::Group* object from a dart::dynamics::BodyNode passed in by reference. It generates the shape information in an OpenSceneGraph format, looping through the BodyNode's collision shapes and converting them from aiScene objects to osg::Node objects and adding them as children to the BodyNode osg::Group. | |
osgDart::BodyNodeVisuals * | _makeBodyNodeVisuals (const dart::dynamics::BodyNode &node) |
Create an osgDart::BodyNodeVisuals* object from a dart::dynamics::BodyNode passed in by reference. It generates the BodyNode specific visuals such as link frame and joint axis for the passed-in BodyNode. | |
void | _addVisualizationShapesFromBodyNode (const dart::dynamics::BodyNode &node) |
Convert BodyNode visualization shapes to osg shapes. | |
void | _addCollisionShapesFromBodyNode (const dart::dynamics::BodyNode &node) |
Convert BodyNode collision shapes to osg shapes. | |
void | _updateRecursively (const dart::dynamics::BodyNode &bodyNode) |
Update SkeletonNode recursively based on Skeleton transforms. This traverses through each BodyNode and its child BodyNodes and updates corresponding osg::MatrixTransform based on their current world transform. | |
void | _updateSkeletonVisuals () |
Updates the skeleton visuals. | |
Protected Attributes | |
const dart::dynamics::BodyNode & | _rootBodyNode |
Root BodyNode. | |
std::vector< osg::ref_ptr < osg::Group > > | _bodyNodeGroups |
Array of osg::Group pointers for the dart::dynamics::BodyNode visualization objects. | |
std::vector< osg::ref_ptr < osgDart::BodyNodeVisuals > > | _bodyNodeVisuals |
Array of osgDart::BodyNodeVisuals ref pointers for showing/hiding them. | |
osg::ref_ptr < osgDart::SkeletonVisuals > | _skeletonVisuals |
osgDart::SkeletonVisuals ref pointer for showing/hiding them | |
std::vector< osg::ref_ptr < osg::Group > > | _bodyNodeCollisionMeshGroups |
Array of osg::Group ref pointers for showing/hiding them. | |
BodyNodeMatrixMap | _bodyNodeMatrixMap |
Map from dart::dynamics::Joint* to osg::MatrixTransform*. | |
BodyNodeGroupMap | _bodyNodeGroupMap |
Map from dart::dynamics::BodyNode* to osg::Group* for the visualization shapes. | |
BodyNodeGroupMap | _bodyNodeCollsionMeshGroupMap |
Map from dart::dynamics::BodyNode* to osg::Group* for the collision shapes. | |
BodyNodeVisualsMap | _bodyNodeVisualsMap |
Map from dart::dynamics::BodyNode* to osgDart::BodyNodeVisuals for BodyNode visual shapes. | |
const bool | _debug |
Debug variable for whether or not to print debug output. |
Class which inherits osg::Group.
SkeletonNode::SkeletonNode | ( | const dart::dynamics::Skeleton & | skeleton, |
bool | debug = false |
||
) |
Constructor for SkeletonNode.
skeleton | A dart::dynamics::Skeleton pointer from which to create the osg skeleton |
axisLength | Length of the joint axes (meters) |
debug | Debug flag for printing debug statements to standard error |
void SkeletonNode::_addCollisionShapesFromBodyNode | ( | const dart::dynamics::BodyNode & | node | ) | [protected] |
Convert BodyNode collision shapes to osg shapes.
node | BodyNode to get the collision shapes from |
void SkeletonNode::_addSkeletonObjectsRecursivley | ( | const dart::dynamics::BodyNode & | bodyNode | ) | [protected] |
Recursively build osg skeleton starting with a BodyNode and recursively creating its children. An osg::MatrixTransform get created whose transform corresponds to the BodyNode's world transform and then an osg::Group node gets created from the BodyNode's shape information and get put inside the osg::MatrixTransform. Finally the osg::MatrixTransform gets added as a child to the root node of the SkeletonNode and it will recursively add osg::MatrixTransforms and Geode for all the children.
bodyNode | The BodyNode to add to the osg skeleton along with its children |
void SkeletonNode::_addSkeletonVisuals | ( | ) | [protected] |
Add visual elements of skeleton that can be toggled on or off, such as the center of mass.
void SkeletonNode::_addVisualizationShapesFromBodyNode | ( | const dart::dynamics::BodyNode & | node | ) | [protected] |
Convert BodyNode visualization shapes to osg shapes.
node | BodyNode to get shapes from |
void SkeletonNode::_createSkeleton | ( | ) | [protected] |
Create the osg skeleton from the root BodyNode by traversing its children and creating osg::Nodes for each physical BodyNode and putting them inside a osg::MatrixTransform with it transform set to the BodyNode's world transform.
rootBodyNode | The root of the skeleton |
osg::Group * SkeletonNode::_makeBodyNodeCollisionMeshGroup | ( | const dart::dynamics::BodyNode & | node | ) | [protected] |
Create osg::Group* object from a dart::dynamics::BodyNode passed in by reference. It generates the shape information in an OpenSceneGraph format, looping through the BodyNode's collision shapes and converting them from aiScene objects to osg::Node objects and adding them as children to the BodyNode osg::Group.
node | const dart::dynamics::BodyNode reference of which to make an osg::Group* |
osg::Group * SkeletonNode::_makeBodyNodeGroup | ( | const dart::dynamics::BodyNode & | node | ) | [protected] |
Create osg::Group* object from a dart::dynamics::BodyNode passed in by reference. It generates the shape information in an OpenSceneGraph format, looping through the BodyNode's visualization shapes and converting them from aiScene objects to osg::Node objects and adding them as children to the BodyNode osg::Group.
node | dart::dynamics::BodyNode of which to make an osg::Group* |
osgDart::BodyNodeVisuals * SkeletonNode::_makeBodyNodeVisuals | ( | const dart::dynamics::BodyNode & | node | ) | [protected] |
Create an osgDart::BodyNodeVisuals* object from a dart::dynamics::BodyNode passed in by reference. It generates the BodyNode specific visuals such as link frame and joint axis for the passed-in BodyNode.
node | const dart::dynamics::BodyNode reference for which to create visuals. |
void SkeletonNode::_updateRecursively | ( | const dart::dynamics::BodyNode & | bodyNode | ) | [protected] |
Update SkeletonNode recursively based on Skeleton transforms. This traverses through each BodyNode and its child BodyNodes and updates corresponding osg::MatrixTransform based on their current world transform.
bodyNode | BodyNode used to update the osg::MatrixTransform and its children |
void SkeletonNode::_updateSkeletonVisuals | ( | ) | [protected] |
Updates the skeleton visuals.
const dart::dynamics::BodyNode & SkeletonNode::getRootBodyNode | ( | ) |
Get root body node.
void SkeletonNode::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 osgDart::SkeletonNode::setBodyNodeCoMVisible | ( | bool | makeVisible = false | ) |
Shows or hides the individual link center of masses, represented by a sphere. Currently not implemented.
makeVisible | Whether or not to visualize link center of masses |
void SkeletonNode::setBodyNodeTransparency | ( | const dart::dynamics::BodyNode & | node, |
float | transparencyValue | ||
) |
Sets the transparency value of the specified BodyNode.
node | dart::dynamics::BodyNode of which to set the transparency |
transparencyValue | New transparency value for the node |
void SkeletonNode::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 SkeletonNode::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 SkeletonNode::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 SkeletonNode::setSkeletonRenderMode | ( | renderMode_t | renderMode | ) |
Set the render mode of the Skeleton.
renderMode | The render mode specified by the enumeration, renderMode_t |
void SkeletonNode::update | ( | ) |
Update SkeletonNode MatrixTransforms based on the dart::Skeleton BodyNode world transforms. This is done recursively by traversing through the Skeleton bodyNodes and their children.