humanoid-path-planner / hpp-constraints

Definition of basic geometric constraints for motion planning
BSD 2-Clause "Simplified" License
3 stars 15 forks source link

[MatrixView] Fix assert in Eigen #192

Closed florent-lamiraux closed 6 months ago

florent-lamiraux commented 7 months ago

In Debug mode, in method Eigen::internal::variable_if_dynamic<T, Value>::setValue, if Value is not Dynamic there is a check that the input argument is equal to the Value template parameter. This check failed in the tests compiled in debug mode.

This modification fixes the issue.

florent-lamiraux commented 7 months ago

I tried to add a unit test in test/matrix-view.cc but I have not been able to make a matrix view of a matrix and to iterate on the blocks. If you can start something, I will be happy to finish it.

jmirabel commented 7 months ago

Have you seen the documentation of MatrixBlockView? The view is built using MatrixBlocks.[lr]view. Then it should be something like

for (MatrixBlockView::block_iterator block (view); block.valid(); ++block)
{
  // Access the current block
  view._block(block); // Returns an Eigen::Block object.
  // For the current block
  block.ri() // row, input
  block.ci() // col, input
  block.ro() // row, output
  block.co() // col, output
  block.rs() // number of rows
  block.cs() // number of cols
}