SCL
1.0
Standard Control Library : Control, dynamics, physics, and simulation
|
#include <CGraphicsChai.hpp>
Public Member Functions | |
virtual sBool | initGraphics (const SGraphicsParsed *arg_gr_ds) |
virtual sBool | initGraphics (const SGraphicsParsed *arg_gr_ds, SGraphicsChai *arg_chai_ds) |
virtual sBool | addRobotToRender (const SRobotParsed *arg_rob_parsed, const SRobotIO *arg_rob_io) |
virtual sBool | removeRobotFromRender (const std::string &arg_robot) |
sBool | addRobotLink (SGraphicsChaiRigidBody *arg_robot_link) |
virtual sBool | addMeshToRender (const std::string &arg_mesh_name, const std::string &arg_mesh_file, const Eigen::Vector3d &arg_pos, const Eigen::Matrix3d &arg_rot) |
virtual sBool | addMeshToParentInRender (const std::string &arg_mesh_name, const std::string &arg_parent_name, const std::string &arg_mesh_file, const Eigen::Vector3d &arg_pos, const Eigen::Matrix3d &arg_rot) |
virtual sBool | removeMeshFromRender (const std::string &arg_mesh_name) |
sBool | scaleMesh (const std::string &arg_mesh_name, sFloat arg_x, sFloat arg_y, sFloat arg_z) |
virtual sBool | addMusclesToRender (const std::string &arg_robot, const SActuatorSetMuscleParsed &arg_mset, const sBool add_musc_via_points) |
virtual sBool | removeMusclesFromRender (const std::string &arg_robot, const std::string &arg_mset) |
sBool | addSphereToRender (const std::string &arg_robot, const std::string &arg_link, const Eigen::Vector3d &arg_pos, const sFloat arg_size=0.01, chai3d::cGenericObject **arg_ret_ptr=S_NULL) |
sBool | addSphereToRender (const Eigen::Vector3d &arg_pos, chai3d::cGenericObject *&arg_ret_ptr, const sFloat arg_size=0.01) |
sBool | addBeltedEllipsoidToRender (const Eigen::Vector3d &arg_pos, chai3d::cGenericObject *&arg_ret_ptr, const sFloat arg_size=0.01) |
virtual sBool | destroyGraphics () |
virtual sBool | updateGraphics () |
virtual sBool | updateGraphicsForRobots () |
virtual sBool | updateGraphicsForMeshes () |
virtual sBool | updateGraphicsForMuscles () |
CGraphicsChai () | |
virtual | ~CGraphicsChai () |
SGraphicsChai * | getChaiData () |
const SGraphicsParsed * | getParsedData () |
virtual sBool | hasBeenInit () |
virtual bool | hasBeenInit () const |
virtual const std::string & | getType () const |
virtual const std::string & | getName () const |
Public Attributes | |
std::string | name_ |
sBool | has_been_init_ |
Protected Attributes | |
SGraphicsChai * | data_ |
bool | data_is_mine_ |
const SGraphicsParsed * | data_parsed_ |
std::string | type_ |
This is the interface for using chai graphics.
Enables rendering arbitrary scl robots.
|
inline |
Default constructor. Sets stuff to NULL.
|
inlinevirtual |
Default destructor. Does nothing
sBool scl::CGraphicsChai::addBeltedEllipsoidToRender | ( | const Eigen::Vector3d & | arg_pos, |
chai3d::cGenericObject *& | arg_ret_ptr, | ||
const sFloat | arg_size = 0.01 |
||
) |
Adds a belted ellipsoid (representing the inertia at an operational point) to the rendering environment wrt the global frame
arg_ret_ptr | Reference to a pointer, pass a pointer and get the object for your use |
|
virtual |
Adds a static mesh to render. Indexed by its name.
A mesh is defined as anything that DOESN'T obey the laws of physics. It is merely rendered (possibly with collision etc).
The parent mesh MUST exist in the graphics world already.
|
virtual |
Adds a static mesh to render. Indexed by its name.
A mesh is defined as anything that DOESN'T obey the laws of physics. It is merely rendered (possibly with collision etc).
Implements scl::CGraphicsBase.
|
virtual |
Adds a muscle system to the graphics rendering environment
A muscle system contains:
arg_robot | The robot to which the muscles will be attached |
arg_mset | The set of muscles to be attached |
Implements scl::CGraphicsBase.
sBool scl::CGraphicsChai::addRobotLink | ( | SGraphicsChaiRigidBody * | arg_robot_link | ) |
Recursively adds links to the chai scenegraph (used by addRobotToRender() ).
|
virtual |
Adds a robot's meshes to the graphics rendering environment.
A robot is defined as:
This tree structure allows selectively accessing the branching representations for different robots, and allows turning them on or off one-by-one.
Also, since we maintain different trees (chai, dynamics, parser-data etc..), we need some way to connect nodes between them. Each "SGraphicsChai data_" stores a pilemap of such trees in sutil::CMappedList< string, sutil::CMappedTree<string, SGraphicsPhysicalLink> > where the SGraphicsPhysicalLink object allows accessing links in all the different trees at one place.
arg_rob_parsed | The static robot specification |
arg_rob_io | The generalized coordinates etc. |
Implements scl::CGraphicsBase.
sBool scl::CGraphicsChai::addSphereToRender | ( | const std::string & | arg_robot, |
const std::string & | arg_link, | ||
const Eigen::Vector3d & | arg_pos, | ||
const sFloat | arg_size = 0.01 , |
||
chai3d::cGenericObject ** | arg_ret_ptr = S_NULL |
||
) |
Adds a sphere to a link on a robot in the rendering environment
arg_ret_ptr | Get the object for your use |
sBool scl::CGraphicsChai::addSphereToRender | ( | const Eigen::Vector3d & | arg_pos, |
chai3d::cGenericObject *& | arg_ret_ptr, | ||
const sFloat | arg_size = 0.01 |
||
) |
Adds a sphere to the rendering environment wrt the global frame
arg_ret_ptr | Reference to a pointer, pass a pointer and get the object for your use |
|
virtual |
Deallocates the chai world.
Implements scl::CGraphicsBase.
|
inlinevirtualinherited |
Get the object's type
|
inlinevirtualinherited |
Get the object's type
|
inlinevirtualinherited |
Get the object's type
|
inlinevirtualinherited |
Initialization state
|
inlinevirtual |
Initializes a graphics world using the camera information in the passed data structure.
Returns, true : Successfully created a world false : Failed (or the data structure was invalid).
arg_gr_ds | The graphics data structure loaded from the xml file. Specifies camera etc. information. |
Implements scl::CGraphicsBase.
|
virtual |
Initializes a graphics world using the camera information in the passed data structures.
Returns, true : Successfully created a world false : Failed (or the data structure was invalid).
position (eye)
lookat position (target)
"up" direction
arg_gr_ds | The graphics data structure loaded from the xml file. Specifies camera etc. information. |
arg_chai_ds | The graphics object to be used for computations. This allows someone else to (dynamically) allocate this object. |
|
virtual |
Removes a static mesh from the rendered scene. Indexed by its name.
A mesh is defined as anything that DOESN"T obey the laws of physics. It is merely rendered (possibly with collision etc).
Implements scl::CGraphicsBase.
|
inlinevirtual |
Removes a muscle system from the graphics rendering environment
A muscle system is defined as:
NOTE TODO: Implement this.
Implements scl::CGraphicsBase.
|
virtual |
Removes a robot's meshes from the graphics rendering environment.
A robot is defined as:
Implements scl::CGraphicsBase.
sBool scl::CGraphicsChai::scaleMesh | ( | const std::string & | arg_mesh_name, |
sFloat | arg_x, | ||
sFloat | arg_y, | ||
sFloat | arg_z | ||
) |
Scales a mesh along the x, y and z axes if it has been added to the rendering environment
|
virtual |
Updates the rotation and translation transformations for all the robots' and meshes' chai objects. ie. Updates all the CGenericObjects..
Implements scl::CGraphicsBase.
|
inlinevirtual |
Updates the rotation and translation transformations for meshes' associated CGenerericObject branching chai representation. NOTE : Since meshes don't move themselves, this function does nothing. The meshes might move during user interaction sessions, but other code must update their frame transforms.
Implements scl::CGraphicsBase.
|
virtual |
Updates the rotation and translation transformations for muscle systems' associated CGenerericObject branching chai representation.
Implements scl::CGraphicsBase.
|
virtual |
Updates the rotation and translation transformations for robots' associated CGenerericObject branching chai representation.
Uncomment this if required:
Implements scl::CGraphicsBase.
|
inherited |
Whether the object is ready for use
|
inherited |
The object's name
|
protectedinherited |
The object's type. Should only be set by the constructor