Skip to content

Commit

Permalink
Merge pull request #921 from S-Dafarra/fix/VectorVizSlowedDown
Browse files Browse the repository at this point in the history
Fixed the slowing down of the visualizer when updating the vectors.
  • Loading branch information
traversaro committed Oct 18, 2021
2 parents a2b6936 + c427fcc commit a727322
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Fixed
- Fixed the conversion from irrlicht pixels to iDynTree pixels. Fixed a typo in the environment method of the visualizer. Fixed the running of two visualizer instances in the same process (https://github.com/robotology/idyntree/pull/903).
- Fixed the update of the vectors in the visualization that caused the FPS to drop (https://github.com/robotology/idyntree/pull/921).

## [4.1.0] - 2021-07-22

Expand Down Expand Up @@ -411,7 +412,7 @@ As this is an `inline` function, this modification does not affect `iDynTree`'s
- The `IVector`, `IRawVector`, `IMatrix` and `IRawMatrix` interfaces have been removed for performance reasons,
see https://github.com/robotology/idyntree/issues/98#issuecomment-158823148 . If you want to write generic
code in C++ you can rely on templates, and on Matlab and Python you can rely on the native dynamic type system.

- All the core classes that have a fixed size (`Position`, `Rotation`, `Transform`, `SpatialMotionVector`, etc, etc) are
not initialized by their empty constructor for performance reasons, see https://github.com/robotology/idyntree/issues/98#issuecomment-158795881 .
From now on, make sure that initialize them before any use. Most of those classes should have a `zero()` method to
Expand Down
3 changes: 1 addition & 2 deletions src/visualization/src/VectorsVisualization.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,6 @@ void VectorsVisualization::drawVector(size_t vectorIndex)

irr::core::vector3df arrowRotation = idyntree2irr_rot(arrowRotationMatrix);

irr::scene::ISceneNode * frameNode = m_smgr->addEmptySceneNode();

irr::scene::IMesh* arrowMesh = m_smgr->getGeometryCreator()->createArrowMesh(4, 8, arrowHeight, 0.9f * arrowHeight,
arrowWidth, 2.0f * arrowWidth);

Expand All @@ -57,6 +55,7 @@ void VectorsVisualization::drawVector(size_t vectorIndex)
}
else
{
irr::scene::ISceneNode * frameNode = m_smgr->addEmptySceneNode();
m_vectors[vectorIndex].visualizationNode = m_smgr->addMeshSceneNode(arrowMesh,frameNode);
}
m_vectors[vectorIndex].visualizationNode->setPosition(arrowPosition);
Expand Down

0 comments on commit a727322

Please sign in to comment.