Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
E
eigenpy
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Guilhem Saurel
eigenpy
Commits
24e1044e
Unverified
Commit
24e1044e
authored
5 years ago
by
Justin Carpentier
Committed by
GitHub
5 years ago
Browse files
Options
Downloads
Plain Diff
Merge pull request #136 from jcarpent/devel
Improve conversion
parents
b20044cd
46756995
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
include/eigenpy/angle-axis.hpp
+5
-0
5 additions, 0 deletions
include/eigenpy/angle-axis.hpp
include/eigenpy/details.hpp
+3
-29
3 additions, 29 deletions
include/eigenpy/details.hpp
include/eigenpy/quaternion.hpp
+5
-3
5 additions, 3 deletions
include/eigenpy/quaternion.hpp
with
13 additions
and
32 deletions
include/eigenpy/angle-axis.hpp
+
5
−
0
View file @
24e1044e
...
...
@@ -22,6 +22,7 @@ namespace eigenpy
struct
call
<
Eigen
::
AngleAxis
<
Scalar
>
>
{
typedef
Eigen
::
AngleAxis
<
Scalar
>
AngleAxis
;
static
inline
void
expose
()
{
AngleAxisVisitor
<
AngleAxis
>::
expose
();
...
...
@@ -46,6 +47,7 @@ namespace eigenpy
typedef
typename
AngleAxis
::
Matrix3
Matrix3
;
typedef
typename
Eigen
::
Quaternion
<
Scalar
,
0
>
Quaternion
;
typedef
Eigen
::
RotationBase
<
AngleAxis
,
3
>
RotationBase
;
public:
...
...
@@ -136,6 +138,9 @@ namespace eigenpy
"AngleAxis representation of a rotation.
\n\n
"
,
bp
::
no_init
)
.
def
(
AngleAxisVisitor
<
AngleAxis
>
());
// Cast to Eigen::RotationBase and vice-versa
bp
::
implicitly_convertible
<
AngleAxis
,
RotationBase
>
();
}
};
...
...
This diff is collapsed.
Click to expand it.
include/eigenpy/details.hpp
+
3
−
29
View file @
24e1044e
...
...
@@ -515,34 +515,8 @@ namespace eigenpy
}
};
template
<
typename
MatType
>
struct
EigenFromPy
<
Eigen
::
MatrixBase
<
MatType
>
>
{
typedef
EigenFromPy
<
MatType
>
EigenFromPyDerived
;
typedef
Eigen
::
MatrixBase
<
MatType
>
Base
;
/// \brief Determine if pyObj can be converted into a MatType object
static
void
*
convertible
(
PyArrayObject
*
pyObj
)
{
return
EigenFromPyDerived
::
convertible
(
pyObj
);
}
/// \brief Allocate memory and copy pyObj in the new storage
static
void
construct
(
PyObject
*
pyObj
,
bp
::
converter
::
rvalue_from_python_stage1_data
*
memory
)
{
EigenFromPyDerived
::
construct
(
pyObj
,
memory
);
}
static
void
registration
()
{
bp
::
converter
::
registry
::
push_back
(
reinterpret_cast
<
void
*
(
*
)(
_object
*
)
>
(
&
EigenFromPy
::
convertible
),
&
EigenFromPy
::
construct
,
bp
::
type_id
<
Base
>
());
}
};
template
<
typename
MatType
,
typename
EigenEquivalentType
>
EIGENPY_DEPRECATED
void
enableEigenPySpecific
()
{
enableEigenPySpecific
<
MatType
>
();
...
...
@@ -557,7 +531,8 @@ namespace eigenpy
// Add also conversion to Eigen::MatrixBase<MatType>
typedef
Eigen
::
MatrixBase
<
MatType
>
MatTypeBase
;
EigenFromPy
<
MatTypeBase
>::
registration
();
bp
::
implicitly_convertible
<
MatType
,
MatTypeBase
>
();
bp
::
implicitly_convertible
<
MatTypeBase
,
MatType
>
();
}
};
...
...
@@ -585,7 +560,6 @@ namespace eigenpy
bp
::
to_python_converter
<
MatType
,
EigenToPy
<
MatType
>
>
();
EigenFromPyConverter
<
MatType
>::
registration
();
}
}
// namespace eigenpy
...
...
This diff is collapsed.
Click to expand it.
include/eigenpy/quaternion.hpp
+
5
−
3
View file @
24e1044e
...
...
@@ -263,9 +263,11 @@ namespace eigenpy
"'q*v' (rotating 'v' by 'q'), "
"'q==q', 'q!=q', 'q[0..3]'."
,
bp
::
no_init
)
.
def
(
QuaternionVisitor
<
Quaternion
>
())
;
.
def
(
QuaternionVisitor
<
Quaternion
>
());
// Cast to Eigen::QuaternionBase and vice-versa
bp
::
implicitly_convertible
<
Quaternion
,
QuaternionBase
>
();
bp
::
implicitly_convertible
<
QuaternionBase
,
Quaternion
>
();
}
};
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment