Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Simox
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Software
Simox
Simox
Commits
0be4a0f3
Commit
0be4a0f3
authored
5 years ago
by
Mirko Wächter
Browse files
Options
Downloads
Patches
Plain Diff
refactoring
parent
89ea8cff
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
VirtualRobot/SceneObject.cpp
+9
-2
9 additions, 2 deletions
VirtualRobot/SceneObject.cpp
VirtualRobot/SceneObject.h
+9
-0
9 additions, 0 deletions
VirtualRobot/SceneObject.h
with
18 additions
and
2 deletions
VirtualRobot/SceneObject.cpp
+
9
−
2
View file @
0be4a0f3
...
...
@@ -988,13 +988,18 @@ namespace VirtualRobot
return
physics
.
inertiaMatrix
;
}
Eigen
::
Matrix3f
SceneObject
::
getI
nertiaMatrix
(
const
Eigen
::
Vector3f
&
shift
)
Eigen
::
Matrix3f
SceneObject
::
shiftInertia
(
const
Eigen
::
Matrix3f
i
nertiaMatrix
,
const
Eigen
::
Vector3f
&
shift
,
float
mass
)
{
Eigen
::
Matrix3f
skew
;
skew
<<
0
,
-
shift
(
2
),
+
shift
(
1
),
+
shift
(
2
),
0
,
-
shift
(
0
),
-
shift
(
1
),
+
shift
(
0
),
0
;
return
getInertiaMatrix
()
+
getMass
()
*
skew
.
transpose
()
*
skew
;
return
inertiaMatrix
-
mass
*
skew
.
transpose
()
*
skew
;
}
Eigen
::
Matrix3f
SceneObject
::
getInertiaMatrix
(
const
Eigen
::
Vector3f
&
shift
)
{
return
shiftInertia
(
getInertiaMatrix
(),
shift
,
getMass
());
}
Eigen
::
Matrix3f
SceneObject
::
getInertiaMatrix
(
const
Eigen
::
Vector3f
&
shift
,
const
Eigen
::
Matrix3f
&
rotation
)
...
...
@@ -1079,6 +1084,8 @@ namespace VirtualRobot
physics
.
inertiaMatrix
=
im
;
}
SceneObject
::
Physics
SceneObject
::
getPhysics
()
{
return
physics
;
...
...
This diff is collapsed.
Click to expand it.
VirtualRobot/SceneObject.h
+
9
−
0
View file @
0be4a0f3
...
...
@@ -296,6 +296,15 @@ namespace VirtualRobot
void
setInertiaMatrix
(
const
Eigen
::
Matrix3f
&
im
);
/**
* @brief The shift is done using the parallel axis theorem (https://en.wikipedia.org/wiki/Parallel_axis_theorem)
* @param inertiaMatrix
* @param shift
* @param mass
* @return
*/
static
Eigen
::
Matrix3f
shiftInertia
(
const
Eigen
::
Matrix3f
inertiaMatrix
,
const
Eigen
::
Vector3f
&
shift
,
float
mass
);
float
getFriction
();
void
setFriction
(
float
friction
);
...
...
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