Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
P
pinocchio
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
Stack Of Tasks
pinocchio
Commits
395cc0ab
Commit
395cc0ab
authored
9 years ago
by
jcarpent
Browse files
Options
Downloads
Patches
Plain Diff
[Python] Expose new setter methods for inertia class
parent
657c3ec8
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/python/inertia.hpp
+16
-6
16 additions, 6 deletions
src/python/inertia.hpp
with
16 additions
and
6 deletions
src/python/inertia.hpp
+
16
−
6
View file @
395cc0ab
...
...
@@ -54,6 +54,9 @@ namespace se3
typedef
typename
Inertia_fx
::
Vector6
Vector6_fx
;
typedef
typename
Inertia_fx
::
Vector3
Vector3_fx
;
typedef
typename
Inertia_fx
::
Motion
Motion_fx
;
typedef
typename
Inertia_fx
::
Scalar_t
Scalar_t
;
public:
static
PyObject
*
convert
(
Inertia
const
&
m
)
...
...
@@ -72,9 +75,9 @@ namespace se3
(
bp
::
arg
(
"mass"
),
bp
::
arg
(
"lever"
),
bp
::
arg
(
"inertia"
))),
"Initialize from mass, lever and 3d inertia."
)
.
add_property
(
"mass"
,
&
Inertia
_fx
::
m
ass
)
.
add_property
(
"lever"
,
&
InertiaPythonVisitor
::
l
ever
)
.
add_property
(
"inertia"
,
&
InertiaPythonVisitor
::
i
nertia
)
.
add_property
(
"mass"
,
&
Inertia
PythonVisitor
::
getMass
,
&
InertiaPythonVisitor
::
setM
ass
)
.
add_property
(
"lever"
,
&
InertiaPythonVisitor
::
getLever
,
&
InertiaPythonVisitor
::
setL
ever
)
.
add_property
(
"inertia"
,
&
InertiaPythonVisitor
::
getInertia
,
&
InertiaPythonVisitor
::
setI
nertia
)
.
def
(
"matrix"
,
&
Inertia_fx
::
matrix
)
.
def
(
"se3Action"
,
&
Inertia_fx
::
se3Action
)
...
...
@@ -93,6 +96,15 @@ namespace se3
.
staticmethod
(
"Random"
)
;
}
static
Scalar_t
getMass
(
const
Inertia_fx
&
self
)
{
return
self
.
mass
();
}
static
void
setMass
(
Inertia_fx
&
self
,
Scalar_t
mass
)
{
self
.
mass
()
=
mass
;
}
static
Vector3_fx
getLever
(
const
Inertia_fx
&
self
)
{
return
self
.
lever
();
}
static
void
setLever
(
Inertia_fx
&
self
,
const
Vector3_fx
&
lever
)
{
self
.
lever
()
=
lever
;
}
static
Matrix3_fx
getInertia
(
const
Inertia_fx
&
self
)
{
return
self
.
inertia
().
matrix
();
}
static
void
setInertia
(
Inertia_fx
&
self
,
const
Vector6_fx
&
minimal_inertia
)
{
self
.
inertia
().
data
()
=
minimal_inertia
;
}
static
Inertia_fx
*
makeFromMCI
(
const
double
&
mass
,
const
Vector3_fx
&
lever
,
...
...
@@ -106,8 +118,6 @@ namespace se3
throw
eigenpy
::
Exception
(
"The 3d inertia should be positive."
);
return
new
Inertia_fx
(
mass
,
lever
,
inertia
);
}
static
Matrix3_fx
inertia
(
const
Inertia_fx
&
Y
)
{
return
Y
.
inertia
().
matrix
();
}
static
Vector3_fx
lever
(
const
Inertia_fx
&
Y
)
{
return
Y
.
lever
();
}
static
std
::
string
toString
(
const
Inertia_fx
&
m
)
{
std
::
ostringstream
s
;
s
<<
m
;
return
s
.
str
();
}
...
...
@@ -124,7 +134,7 @@ namespace se3
}
};
};
// struct InertiaPythonVisitor
...
...
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