Skip to content

Commit

Permalink
Merge pull request #243 from LoreMoretti/bug_fix
Browse files Browse the repository at this point in the history
Fix memory allocation bug in ForwardKinematics and RelativeTransform blocks
  • Loading branch information
traversaro authored Feb 6, 2024
2 parents a30a6fc + 8425b7c commit 19b7408
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 5 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,12 @@ The format of this document is based on [Keep a Changelog](https://keepachangelo

## [unreleased]

## [5.6.1] - 2023-02-06

## Fixed

- Fix memory allocation bug in ForwardKinematics and RelativeTransform blocks (https://github.com/robotology/wb-toolbox/pull/243).

## [5.6.0] - 2022-10-21

### Changed
Expand Down
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# GNU Lesser General Public License v2.1 or any later version.

cmake_minimum_required(VERSION 3.5)
project(WB-Toolbox LANGUAGES CXX VERSION 5.6.0)
project(WB-Toolbox LANGUAGES CXX VERSION 5.6.1)

if(WBT_BUILD_DOCS)
add_subdirectory(doc)
Expand Down
4 changes: 2 additions & 2 deletions toolbox/library/src/ForwardKinematics.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -227,8 +227,8 @@ bool ForwardKinematics::output(const BlockInformation* blockInfo)
}

// Allocate objects for row-major -> col-major conversion
Map<const Matrix4diDynTree> world_H_frame_RowMajor =
toEigen(world_H_frame.asHomogeneousTransform());
const iDynTree::Matrix4x4 world_H_frame_asHomogeneous = world_H_frame.asHomogeneousTransform();
Map<const Matrix4diDynTree> world_H_frame_RowMajor = toEigen(world_H_frame_asHomogeneous);
Map<Matrix4dSimulink> world_H_frame_ColMajor(output->getBuffer<double>(), 4, 4);

// Forward the buffer to Simulink transforming it to ColMajor
Expand Down
5 changes: 3 additions & 2 deletions toolbox/library/src/RelativeTransform.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -235,8 +235,9 @@ bool RelativeTransform::output(const BlockInformation* blockInfo)
}

// Allocate objects for row-major -> col-major conversion
Map<const Matrix4diDynTree> frame1_H_frame2_RowMajor =
toEigen(frame1_H_frame2.asHomogeneousTransform());
const iDynTree::Matrix4x4 frame1_H_frame2_asHomogeneous =
frame1_H_frame2.asHomogeneousTransform();
Map<const Matrix4diDynTree> frame1_H_frame2_RowMajor = toEigen(frame1_H_frame2_asHomogeneous);
Map<Matrix4dSimulink> frame1_H_frame2_ColMajor(output->getBuffer<double>(), 4, 4);

// Forward the buffer to Simulink transforming it to ColMajor
Expand Down

0 comments on commit 19b7408

Please sign in to comment.