Share 
Follow 
AboutDownloadsDocumentsForumsSource CodeIssuesNews
Date:
2014-10-15 13:15
Priority:
3
State:
Open
Submitted by:
joseph salini (josephsalini)
Assigned to:
Ayman Habib (aymanh)
Summary:
missing python wrappers for some SimTK classes?

Detailed description
Hello,

I am using python wrappers of opensim to build my models, and I have some issues while writing my scripts.
Indeed, I need to create some 'SimTK::Transform' for positioning geometries, and I need a 'SimTK::Rotation' and a 'SimTK::Vec3' to instantiate my class.
The problem is 'SimTK::Rotation' seems not to be available in the wrappers.

By searching in the source file "OpenSim/Wrapping/Python/swig/pyWrapOpenSim.i", it seems that <SWIGSimTK/Rotation.h> and <SWIGSimTK/CoordinateAxis.h> are never included.

If it is not made on purpose, I guess it is sufficient to add in "pyWrapOpenSim.i" something like:
"""
// Rotation
%include <SWIGSimTK/Rotation.h>
namespace SimTK {
%template(Rotation) SimTK::Rotation_<double>;
}

%include <SWIGSimTK/CoordinateAxis.h>
"""

Best regards,

Add A Comment: Notepad

Message  ↓
Date: 2014-10-15 17:14
Sender: Ayman Habib

Hi Joseph,

Excellent find, here's the section of the .i file we use for Java wrapping (that should've been in the python interface file as well)
....
%include <SWIGSimTK/SpatialAlgebra.h>
namespace SimTK {
%template(SpatialVec) Vec<2, Vec3>;
%template(VectorOfSpatialVec) Vector_<SpatialVec>;
%template(VectorOfVec3) Vector_<Vec3>;
}

%include <SWIGSimTK/CoordinateAxis.h>
%include <SWIGSimTK/Rotation.h>
namespace SimTK {
%template(Rotation) SimTK::Rotation_<double>;
%template(InverseRotation) SimTK::InverseRotation_<double>;
}
// Transform
%include <SWIGSimTK/Transform.h>
....

Will fix in the next release but you can make the edits above to the interface file and get going.

Best regards

No Changes Have Been Made to This Item

Feedback