Skip to content

Commit

Permalink
Address review
Browse files Browse the repository at this point in the history
Delete meshes and update example accordingly.
Return empty vector if a wrong frame is requested.
Use the appropiate invalid frame index.
Erase commented line not used in mat4x4vec.i.
  • Loading branch information
fjandrad committed Apr 9, 2020
1 parent 8beaacc commit 4f1678a
Show file tree
Hide file tree
Showing 43 changed files with 21 additions and 3,414 deletions.
2 changes: 1 addition & 1 deletion bindings/matlab/matlab_mat4x4vec.i
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
d[overall_index]=content[index_sequence];
}
}
//free(content); //Tried to free the pointer but got error.

++it;
}

Expand Down
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
3,390 changes: 0 additions & 3,390 deletions examples/iDynTreeWrappers/model_uses_stl.urdf

This file was deleted.

31 changes: 14 additions & 17 deletions examples/iDynTreeWrappers/visualizeRobot.m
Original file line number Diff line number Diff line change
@@ -1,29 +1,26 @@
%% This script is an example on how to use the matlab iDynTree visualization
%% Launch this file from the folder it is contained
currentFolder=pwd;
% insert the path where the meshes may be found, it replaces what is required
% To use insert the path where the meshes may be found, it replaces what is required
% to complete the path inside the urdf visual mesh field.

% Example:
% The test model has the following mesh file in the URDF
% If a test model has the following mesh file in the URDF
% 'package://stl/sim_sea_2-5_root_link_prt-binary.stl'
% The required file is inside the meshes folder in this directory,
% so to complete the path we are missing meshes as a prefix to the full
% path starting from this directory.
meshFilePrefix='meshes/';
% The model is in this same folder
modelPath=[currentFolder '/'];
fileName='model_uses_stl.urdf';
% The required path is what it takes to reach the stl folder.
% meshFilePrefix=<path_to_stl_folder>;
% It basically replaces the functionality of find Package by inserting the
% path manually.
% The path to the model is also required:
% modelPath=<path_to_urdf_folder>;

% REMARK : If you have installed the URDF models by https://github.com/robotology/icub-models
% You could fill the required variables as follows:
% % Substitute in the following the location of the install prefix of icub-models
% icubModelsInstallPrefix = "";
% meshFilePrefix = [icubModelsInstallPrefix '/share']
% % Select the robot using the folder name
% robotName=""
% icubModelPath = [icubModelsInstallPrefix '/share/iCub/robots/' robotName '/']
% fileName='model.urdf';
icubModelsInstallPrefix = [getenv('ROBOTOLOGY_SUPERBUILD_SOURCE_DIR') '/build-linux/install/'];
meshFilePrefix = [icubModelsInstallPrefix '/share'];
% Select the robot using the folder name
robotName='iCubGenova04';
modelPath = [icubModelsInstallPrefix '/share/iCub/robots/' robotName '/'];
fileName='model.urdf';

jointOrder={
'r_hip_pitch';
Expand Down
12 changes: 6 additions & 6 deletions src/high-level/src/KinDynComputations.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -889,12 +889,12 @@ Transform KinDynComputations::getRelativeTransform(const std::string& refFrameNa
{
int refFrameIndex = getFrameIndex(refFrameName);
int frameIndex = getFrameIndex(frameName);
if( frameIndex < 0 )
if( frameIndex == iDynTree::FRAME_INVALID_INDEX )
{
reportError("KinDynComputations","getRelativeTransform","unknown frameName");
return Transform::Identity();
}
else if( refFrameIndex < 0 )
else if( refFrameIndex == iDynTree::FRAME_INVALID_INDEX )
{
reportError("KinDynComputations","getRelativeTransform","unknown refFrameName");
return Transform::Identity();
Expand Down Expand Up @@ -1005,7 +1005,7 @@ Transform KinDynComputations::getRelativeTransformExplicit(const iDynTree::Frame
Transform KinDynComputations::getWorldTransform(std::string frameName)
{
int frameIndex = getFrameIndex(frameName);
if( frameIndex < 0 )
if( frameIndex == iDynTree::FRAME_INVALID_INDEX )
{
return Transform::Identity();
}
Expand Down Expand Up @@ -1081,10 +1081,10 @@ std::vector<iDynTree::Matrix4x4> KinDynComputations::getWorldTransformsAsHomogen
{
std::string frameName=frameNames[number];
int frameIndex = getFrameIndex(frameName);
if( frameIndex < 0 )
if( frameIndex == iDynTree::FRAME_INVALID_INDEX )
{
reportError("KinDynComputations","getWorldTransformsAsHomogeneous", "requested frameName not found in model");
worldTransforms.push_back(Transform::Identity().asHomogeneousTransform());
reportError("KinDynComputations","getWorldTransformsAsHomogeneous", "requested frameName not found in model. Returning empty vector.");
return {};
}
else
{
Expand Down

0 comments on commit 4f1678a

Please sign in to comment.