Cheetah Software
1.0
|
#include <DrawList.h>
Public Member Functions | |
DrawList () | |
size_t | addCheetah3 (Vec4< float > color, bool useOld) |
size_t | addMiniCheetah (Vec4< float > color, bool useOld) |
void | buildDrawList () |
void | loadFiles () |
size_t | addCheckerboard (Checkerboard &checkerBoard) |
size_t | addDebugSphere (float radius) |
void | addBox (double depth, double width, double height, const Vec3< double > &pos, const Mat3< double > &ori, bool transparent) |
void | addMesh (double grid_size, const Vec3< double > &left_corner, const DMat< double > &height_map, bool transparent) |
void | resize (size_t nUniqueObject, size_t nTotalObjects) |
size_t | getNumObjectsToDraw () |
size_t | getGLDrawArrayOffset (size_t i) |
size_t | getGLDrawArraySize (size_t i) |
float * | getVertexArray () |
float * | getNormalArray () |
size_t | getSizeOfAllData () |
float * | getColorArray () |
QMatrix4x4 & | getModelBaseTransform (size_t i) |
QMatrix4x4 & | getModelKinematicTransform (size_t i) |
float | getGLDataSizeMB () |
bool | needsReload () |
template<typename T > | |
void | updateRobotFromModel (DynamicsSimulator< T > &model, size_t id, bool updateOrigin=false) |
template<typename T > | |
void | updateAdditionalInfo (DynamicsSimulator< T > &model) |
template<typename T > | |
void | updateCheckerboardFromCollisionPlane (CollisionPlane< T > &model, size_t id) |
template<typename T > | |
void | updateCheckerboard (T height, size_t id) |
template<typename T > | |
void | updateDebugSphereLocation (Vec3< T > &position, size_t id) |
const size_t & | getTotalNumGC () |
const std::vector< double > & | getGCPos (size_t idx) |
const std::vector< double > & | getGCForce (size_t idx) |
const std::vector< BoxInfo > & | getBoxInfoList () |
const DMat< double > & | getHeightMap () |
const Vec3< double > & | getHeightMapLeftCorner () |
const double & | getHeightMapMax () |
const double & | getHeightMapMin () |
const double & | getGridSize () |
const Vec3< double > & | getCameraOrigin () |
Static Public Member Functions | |
static void | setSolidColor (std::vector< float > &data, size_t size, float r, float g, float b) |
Public Attributes | |
VisualizationData * | _visualizationData |
vectorAligned< SolidColor > | _instanceColor |
std::vector< QMatrix4x4 > | _kinematicXform |
Private Attributes | |
size_t | _nUnique = 0 |
size_t | _nTotal = 0 |
std::vector< std::vector< float > > | _vertexData |
std::vector< std::vector< float > > | _normalData |
std::vector< std::vector< float > > | _colorData |
vectorAligned< Mat4< float > > | _offsetXforms |
std::string | _baseFileName = "../resources/" |
std::vector< size_t > | _objectMap |
std::vector< size_t > | _glArrayOffsets |
std::vector< size_t > | _glArraySizes |
std::vector< float > | _glVertexData |
std::vector< float > | _glNormalData |
std::vector< float > | _glColorData |
std::vector< QMatrix4x4 > | _modelOffsets |
bool | _reloadNeeded = false |
bool | _additionalInfoFirstVisit = true |
size_t | _nTotalGC = 0 |
std::vector< bool > | _cp_touch |
std::vector< std::vector< double > > | _cp_pos |
std::vector< std::vector< double > > | _cp_force |
std::vector< BoxInfo > | _box_list |
double | _grid_size |
Vec3< double > | _height_map_left_corner |
DMat< double > | _height_map |
double | _height_map_max |
double | _height_map_min |
Vec3< double > | _cameraOrigin |
size_t | _cheetah3LoadIndex = 0 |
size_t | _miniCheetahLoadIndex = 0 |
size_t | _sphereLoadIndex = 0 |
size_t | _cubeLoadIndex = 0 |
Definition at line 49 of file DrawList.h.
|
inline |
Definition at line 53 of file DrawList.h.
References BoxInfo::depth, BoxInfo::height, and BoxInfo::width.
void DrawList::addBox | ( | double | depth, |
double | width, | ||
double | height, | ||
const Vec3< double > & | pos, | ||
const Mat3< double > & | ori, | ||
bool | transparent | ||
) |
Definition at line 288 of file DrawList.cpp.
References _box_list, _cubeLoadIndex, _instanceColor, _kinematicXform, _modelOffsets, _nTotal, _objectMap, BoxInfo::depth, disgustingGreen, BoxInfo::frame, BoxInfo::height, SolidColor::rgba, ori::rotationMatrixToQuaternion(), SolidColor::useSolidColor, and BoxInfo::width.
size_t DrawList::addCheckerboard | ( | Checkerboard & | checkerBoard | ) |
Adds a checkerboard to the list of drawables. Uses an identity transformation. You must call updateCheckerboardFromCollisionPlane to set the actual transform.
Definition at line 215 of file DrawList.cpp.
References _colorData, _instanceColor, _kinematicXform, _modelOffsets, _normalData, _nTotal, _nUnique, _objectMap, _vertexData, Checkerboard::computeVertices(), Checkerboard::getSize(), and SolidColor::useSolidColor.
size_t DrawList::addCheetah3 | ( | Vec4< float > | color, |
bool | useOld | ||
) |
Load the cheetah 3 model and build the draw list. Returns an index number that can later be used to update the position of the robot.
Definition at line 48 of file DrawList.cpp.
References _cheetah3LoadIndex, _instanceColor, _kinematicXform, _modelOffsets, _nTotal, _objectMap, buildDrawList(), f(), SolidColor::rgba, and SolidColor::useSolidColor.
size_t DrawList::addDebugSphere | ( | float | radius | ) |
Adds a sphere to the list of drawables.
Definition at line 247 of file DrawList.cpp.
References _kinematicXform, _modelOffsets, _nTotal, _objectMap, and _sphereLoadIndex.
void DrawList::addMesh | ( | double | grid_size, |
const Vec3< double > & | left_corner, | ||
const DMat< double > & | height_map, | ||
bool | transparent | ||
) |
Definition at line 338 of file DrawList.cpp.
References _grid_size, _height_map, _height_map_left_corner, _height_map_max, and _height_map_min.
size_t DrawList::addMiniCheetah | ( | Vec4< float > | color, |
bool | useOld | ||
) |
Load the mini cheetah model and builds the draw list. Returns an index number that can later be used to update the position of the robot. TODO check all this once the mini cheetah dynamics model exists again
Definition at line 129 of file DrawList.cpp.
References _instanceColor, _kinematicXform, _miniCheetahLoadIndex, _modelOffsets, _nTotal, _objectMap, f(), SolidColor::rgba, and SolidColor::useSolidColor.
void DrawList::buildDrawList | ( | ) |
Rebuilds the drawing list and sets the flag indicating that model data must be reloaded.
Definition at line 266 of file DrawList.cpp.
References _colorData, _glArrayOffsets, _glArraySizes, _glColorData, _glNormalData, _glVertexData, _normalData, _nUnique, _reloadNeeded, and _vertexData.
|
inline |
|
inline |
|
inline |
Get the array containing all color data.
Definition at line 121 of file DrawList.h.
|
inline |
|
inline |
|
inline |
Get size of data used by the GPU in megabytes For debugging
Definition at line 142 of file DrawList.h.
|
inline |
For the i-th object, get the offset into the model data. For use with the glDrawArrays function. Note that several objects may have the same geometry, so this will return the same value for these objects!
Definition at line 93 of file DrawList.h.
|
inline |
For the i-th object, get the size of the model data array
Definition at line 100 of file DrawList.h.
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
Get the Qt transformation matrix which should be applied to the model geometry This is to correct for errors when exporting parts and shifts them all to the origin.
Definition at line 128 of file DrawList.h.
|
inline |
Get the Qt transformation matrix which should be applied to move a model from the origin to where it should be in the world
Definition at line 134 of file DrawList.h.
|
inline |
Get the array containing all normal data. Use getGLDrawArrayOffset/Size to get indices and sizes for each object
Definition at line 114 of file DrawList.h.
|
inline |
Get the total number of objects to be drawn
Definition at line 85 of file DrawList.h.
|
inline |
|
inline |
|
inline |
Get the array containing all vertex data. Use getGLDrawArrayOffset/Size to get indices and sizes for each object
Definition at line 108 of file DrawList.h.
void DrawList::loadFiles | ( | ) |
Definition at line 10 of file DrawList.cpp.
References _baseFileName, _cheetah3LoadIndex, _colorData, _cubeLoadIndex, _miniCheetahLoadIndex, _normalData, _nUnique, _sphereLoadIndex, _vertexData, debugRedColor, defaultRobotColor, disgustingGreen, load_obj_file(), and setSolidColor().
|
inline |
Returns true a single time if we have changed geometries and need to reload.
Definition at line 153 of file DrawList.h.
|
inline |
|
inlinestatic |
Fill color data with a solid color
Definition at line 247 of file DrawList.h.
|
inline |
Update the additional information drawn by GUI Doesn't run the simulator
model | : the simulator |
Definition at line 191 of file DrawList.h.
References DynamicsSimulator< T >::getContactForce(), DynamicsSimulator< T >::getModel(), and DynamicsSimulator< T >::getTotalNumGC().
|
inline |
|
inline |
Updates the position of a checkerboard to match an infinite collision plane The infinite collision plane only specifies orientation, so we
model | : the collision plane |
id | : the id retured from creating the checkerboard |
Definition at line 222 of file DrawList.h.
References spatialTransformToQT().
|
inline |
Definition at line 237 of file DrawList.h.
|
inline |
Update the position of a robot's bodies using the result of a dynamics simulation. Doesn't run the simulator - just pulls _Xa from the DynamicsSimulator
model | : the simulator |
id | : the id returned from the loadCheetah3 or loadMiniCheetah function. |
Definition at line 170 of file DrawList.h.
References DynamicsSimulator< T >::getModel(), DynamicsSimulator< T >::getNumBodies(), DynamicsSimulator< T >::getState(), and spatialTransformToQT().
|
private |
Definition at line 302 of file DrawList.h.
|
private |
Definition at line 288 of file DrawList.h.
|
private |
Definition at line 308 of file DrawList.h.
|
private |
Definition at line 315 of file DrawList.h.
|
private |
Definition at line 317 of file DrawList.h.
|
private |
Definition at line 285 of file DrawList.h.
|
private |
Definition at line 307 of file DrawList.h.
|
private |
Definition at line 306 of file DrawList.h.
|
private |
Definition at line 305 of file DrawList.h.
|
private |
Definition at line 318 of file DrawList.h.
|
private |
Definition at line 292 of file DrawList.h.
|
private |
Definition at line 293 of file DrawList.h.
|
private |
Definition at line 297 of file DrawList.h.
|
private |
Definition at line 296 of file DrawList.h.
|
private |
Definition at line 295 of file DrawList.h.
|
private |
Definition at line 310 of file DrawList.h.
|
private |
Definition at line 312 of file DrawList.h.
|
private |
Definition at line 311 of file DrawList.h.
|
private |
Definition at line 313 of file DrawList.h.
|
private |
Definition at line 313 of file DrawList.h.
vectorAligned<SolidColor> DrawList::_instanceColor |
Definition at line 278 of file DrawList.h.
std::vector<QMatrix4x4> DrawList::_kinematicXform |
Definition at line 279 of file DrawList.h.
|
private |
Definition at line 317 of file DrawList.h.
|
private |
Definition at line 299 of file DrawList.h.
|
private |
Definition at line 284 of file DrawList.h.
|
private |
Definition at line 282 of file DrawList.h.
|
private |
Definition at line 304 of file DrawList.h.
|
private |
Definition at line 282 of file DrawList.h.
|
private |
Definition at line 290 of file DrawList.h.
|
private |
Definition at line 287 of file DrawList.h.
|
private |
Definition at line 301 of file DrawList.h.
|
private |
Definition at line 318 of file DrawList.h.
|
private |
Definition at line 283 of file DrawList.h.
VisualizationData* DrawList::_visualizationData |
Definition at line 51 of file DrawList.h.