A base class for defining visualizers for Pinocchio in C++. This provides basic building blocks (a base constructor, data members, getters for the models). More...
#include <pinocchio/visualizers/base-visualizer.hpp>
Public Types | |
typedef SE3::Matrix4 | Matrix4 |
Public Member Functions | |
BaseVisualizer (const Model &model, const GeometryModel &visual_model, const GeometryModel *collision_model, Data &data, GeometryData &visual_data, GeometryData *collision_data) | |
Class constructor for borrowing external data. | |
BaseVisualizer (const Model &model, const GeometryModel &visual_model, const GeometryModel *collision_model=nullptr) | |
Class constructor which will create internally-managed data objects. | |
virtual void | clean () |
Delete all objects from the scene. | |
GeometryData & | collisionData () |
const GeometryData & | collisionData () const |
const GeometryModel & | collisionModel () const |
Data & | data () |
const Data & | data () const |
virtual void | display (const boost::optional< ConstVectorRef > &q=boost::none) |
Display configuration q (if an actual value is given) or update the Pinocchio frames. | |
template<typename D > | |
void | display (const Eigen::MatrixBase< D > &q) |
virtual void | enableCameraControl (bool) |
Enable/disable controlling the camera from keyboard and mouse. | |
virtual bool | forceRedraw () |
Override this in child class when the scene has to be redrawn. Useful for play(). | |
bool | hasCollisionModel () const |
bool | hasExternalData () const |
Whether the internal data pointers are borrowed (external), or owned. | |
virtual void | initViewer () |
Initialize the viewer. | |
virtual void | loadViewerModel ()=0 |
Load the Pinocchio model. | |
const Model & | model () const |
void | play (const ConstMatrixRef &qs, Scalar dt) |
virtual void | play (const std::vector< ConstVectorRef > &qs, Scalar dt) |
Play an entire trajectory, waiting for time dt between each keyframe. | |
virtual void | rebuildData () |
Re-build data objects. Required if the models were modified. | |
virtual void | setCameraPose (const Eigen::Ref< const Matrix4 > &) |
Set the active camera 6D pose. | |
void | setCameraPose (const SE3 &pose) |
Set the active camera 6D pose. | |
virtual void | setCameraPosition (const Eigen::Ref< const Vector3 > &) |
Set the active camera position. | |
virtual void | setCameraTarget (const Eigen::Ref< const Vector3 > &) |
Set the active camera target. | |
virtual void | setCameraZoom (Scalar) |
Set camera zoom level; what this means depends on the implementation (FOV zoom or moving forwards). | |
GeometryData & | visualData () |
const GeometryData & | visualData () const |
const GeometryModel & | visualModel () const |
Protected Member Functions | |
void | destroyData () |
virtual void | displayImpl ()=0 |
virtual void | displayPrecall () |
This method is called at the beginning of display(). | |
Protected Attributes | |
GeometryData * | m_collisionData |
GeometryModel const * | m_collisionModel |
Data * | m_data |
std::reference_wrapper< Model const > | m_model |
bool | m_ownedData |
GeometryData * | m_visualData |
GeometryModel const * | m_visualModel |
A base class for defining visualizers for Pinocchio in C++. This provides basic building blocks (a base constructor, data members, getters for the models).
The base API assumes that the visualizer is not the owner of the underlying Pinocchio multibody, visual or collision models. Their lifetimes should be managed by the application context itself.
Definition at line 34 of file base-visualizer.hpp.
typedef SE3::Matrix4 Matrix4 |
Definition at line 37 of file base-visualizer.hpp.
BaseVisualizer | ( | const Model & | model, |
const GeometryModel & | visual_model, | ||
const GeometryModel * | collision_model, | ||
Data & | data, | ||
GeometryData & | visual_data, | ||
GeometryData * | collision_data | ||
) |
Class constructor for borrowing external data.
model | Reference to Pinocchio Model class. |
visual_model | Reference to visual GeometryModel. |
collision_model | Pointer to collision model. Pass nullptr if no collision model is to be provided. |
data | Reference to Data object. The visualizer will store an internal reference as a pointer. |
visual_data | Reference to visual (VISUAL) GeometryData object. The visualizer will store an internal reference as a pointer. |
collision_data | Pointer to collision (COLLISION) GeometryData object. The visualizer will store this pointer internally as a reference. |
collision_model
is provided with no collision_data
. If the reverse happens, then the collision GeometryData is simply ignored. BaseVisualizer | ( | const Model & | model, |
const GeometryModel & | visual_model, | ||
const GeometryModel * | collision_model = nullptr |
||
) |
Class constructor which will create internally-managed data objects.
model | Reference to Pinocchio Model class. |
visual_model | Reference to visual GeometryModel. |
collision_model | Pointer to collision model. Pass nullptr if no collision model is to be provided. |
Delete all objects from the scene.
Definition at line 143 of file base-visualizer.hpp.
|
inline |
Definition at line 193 of file base-visualizer.hpp.
|
inline |
Definition at line 200 of file base-visualizer.hpp.
|
inline |
Definition at line 157 of file base-visualizer.hpp.
|
inline |
Definition at line 175 of file base-visualizer.hpp.
Definition at line 179 of file base-visualizer.hpp.
Definition at line 91 of file base-visualizer.hpp.
This method is called at the beginning of display().
Definition at line 218 of file base-visualizer.hpp.
Enable/disable controlling the camera from keyboard and mouse.
Definition at line 138 of file base-visualizer.hpp.
Override this in child class when the scene has to be redrawn. Useful for play().
Definition at line 105 of file base-visualizer.hpp.
|
inline |
Definition at line 164 of file base-visualizer.hpp.
|
inline |
Whether the internal data pointers are borrowed (external), or owned.
Definition at line 170 of file base-visualizer.hpp.
Initialize the viewer.
Definition at line 75 of file base-visualizer.hpp.
Definition at line 147 of file base-visualizer.hpp.
Set the active camera 6D pose.
Definition at line 121 of file base-visualizer.hpp.
Set the active camera 6D pose.
Definition at line 126 of file base-visualizer.hpp.
Set the active camera position.
Definition at line 116 of file base-visualizer.hpp.
Set the active camera target.
Definition at line 111 of file base-visualizer.hpp.
Set camera zoom level; what this means depends on the implementation (FOV zoom or moving forwards).
Definition at line 133 of file base-visualizer.hpp.
|
inline |
Definition at line 184 of file base-visualizer.hpp.
|
inline |
Definition at line 188 of file base-visualizer.hpp.
|
inline |
Definition at line 152 of file base-visualizer.hpp.
|
protected |
Definition at line 214 of file base-visualizer.hpp.
|
protected |
Definition at line 210 of file base-visualizer.hpp.
|
protected |
Definition at line 212 of file base-visualizer.hpp.
Definition at line 208 of file base-visualizer.hpp.
|
protected |
Definition at line 215 of file base-visualizer.hpp.
|
protected |
Definition at line 213 of file base-visualizer.hpp.
|
protected |
Definition at line 209 of file base-visualizer.hpp.