Skip to content

Commit

Permalink
Change getWorldTransformsAsHomogeneous signature by adding const
Browse files Browse the repository at this point in the history
  • Loading branch information
fjandrad committed Apr 7, 2020
1 parent c6c500c commit f1f6135
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 6 deletions.
5 changes: 4 additions & 1 deletion bindings/matlab/+iDynTreeWrappers/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,10 @@ Not proper wrappers, they wrap more than one method of the class each. **Require

## Matlab Native visualization

Not actual wrappers, they use the iDynTreeWrappers in combination with the MATLAB patch plotting functions to visualize the robot. **Not tested in Octave**
Not actual wrappers, they use the iDynTreeWrappers in combination with the MATLAB patch plotting functions to visualize the robot.
**Disclaimers**:
- This visualization **has not been tested** with Octave.
- At the moment, there is **no support** for .dae mesh files.

- [prepareVisualization](prepareVisualization.m)
- [updateVisualization](updateVisualization.m)
Expand Down
8 changes: 7 additions & 1 deletion bindings/matlab/+iDynTreeWrappers/getMeshes.m
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@
% - `map` : Cell array having both the names of the meshes and the associated link
% - `linkMeshInfo` : Struct array that contain the link name and a struct (`meshInfo`) that contains the name of file or if is a simple geometry, the triangulation ( edges and vertices of the mesh ) and the link to geometry transform.
%
% NOTE: at the moment only STL files are supported.
%
% Author : Francisco Andrade (franciscojavier.andradechavez@iit.it)
%
% Copyright (C) 2019 Istituto Italiano di Tecnologia (IIT). All rights reserved.
Expand Down Expand Up @@ -42,7 +44,11 @@
meshName=split(externalMesh.filename,':');
meshFile=meshName{2};
% Import an STL mesh, returning a PATCH-compatible face-vertex structure
mesh_triangles = stlread([meshFilePrefix meshFile]);
if strcmp('package',meshName{1})
mesh_triangles = stlread([meshFilePrefix meshFile]);
else
mesh_triangles = stlread(meshFile);
end
meshInfo(solids).meshFile=meshFile;
meshInfo(solids).scale=scale';
else
Expand Down
2 changes: 1 addition & 1 deletion bindings/matlab/autogenerated/iDynTreeMATLAB_wrap.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -94543,7 +94543,7 @@ int _wrap_KinDynComputations_getWorldTransformsAsHomogeneous(int resc, mxArray *
std::vector< std::string,std::allocator< std::string > > *ptr = (std::vector< std::string,std::allocator< std::string > > *)0;
int res = swig::asptr(argv[1], &ptr);
if (!SWIG_IsOK(res) || !ptr) {
SWIG_exception_fail(SWIG_ArgError((ptr ? res : SWIG_TypeError)), "in method '" "KinDynComputations_getWorldTransformsAsHomogeneous" "', argument " "2"" of type '" "std::vector< std::string,std::allocator< std::string > >""'");
SWIG_exception_fail(SWIG_ArgError((ptr ? res : SWIG_TypeError)), "in method '" "KinDynComputations_getWorldTransformsAsHomogeneous" "', argument " "2"" of type '" "std::vector< std::string,std::allocator< std::string > > const""'");
}
arg2 = *ptr;
if (SWIG_IsNewObj(res)) delete ptr;
Expand Down
4 changes: 3 additions & 1 deletion doc/matlab_visualization.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@
The MATLAB Visualization uses the MATLAB capabilities for displaying meshes and figures and the floating-base kinematics of iDynTree to get the new poses of the links.
It uses the [iDynTreeWrappers](../bindings/matlab/%2BiDynTreeWrappers) to handle the model and obtaining the required transforms.

**Rermark**: This visualization has not been tested with Octave.
**Disclaimers**:
- This visualization has not been tested with Octave.
- At the moment there is no support for .dae mesh files.

## functions
### Main functions
Expand Down
2 changes: 1 addition & 1 deletion src/high-level/include/iDynTree/KinDynComputations.h
Original file line number Diff line number Diff line change
Expand Up @@ -385,7 +385,7 @@ class KinDynComputations {
* (world_H_frame).
*
*/
std::vector<iDynTree::Matrix4x4> getWorldTransformsAsHomogeneous(std::vector<std::string> frameNames);
std::vector<iDynTree::Matrix4x4> getWorldTransformsAsHomogeneous(const std::vector<std::string> frameNames);

/**
* Return the transform where the frame is the frame
Expand Down
3 changes: 2 additions & 1 deletion src/high-level/src/KinDynComputations.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1073,7 +1073,7 @@ Transform KinDynComputations::getWorldTransform(const FrameIndex frameIndex)
return world_H_frame;
}

std::vector<iDynTree::Matrix4x4> KinDynComputations::getWorldTransformsAsHomogeneous(std::vector<std::string> frameNames)
std::vector<iDynTree::Matrix4x4> KinDynComputations::getWorldTransformsAsHomogeneous(const std::vector<std::string> frameNames)
{
std::vector<iDynTree::Matrix4x4> worldTransforms;
int numberOfTransforms=frameNames.size();
Expand All @@ -1094,6 +1094,7 @@ std::vector<iDynTree::Matrix4x4> KinDynComputations::getWorldTransformsAsHomogen
return worldTransforms;
}


unsigned int KinDynComputations::getNrOfFrames() const
{
return this->pimpl->m_robot_model.getNrOfFrames();
Expand Down

0 comments on commit f1f6135

Please sign in to comment.