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
Package registry
Container Registry
Model registry
Operate
Terraform modules
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Florian Leander Singer
Simox
Commits
8630fc80
Commit
8630fc80
authored
4 years ago
by
Raphael Grimm
Browse files
Options
Downloads
Patches
Plain Diff
Add functions to get/set scaled joint values
parent
18a50ae7
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
VirtualRobot/Nodes/RobotNode.h
+23
-0
23 additions, 0 deletions
VirtualRobot/Nodes/RobotNode.h
with
23 additions
and
0 deletions
VirtualRobot/Nodes/RobotNode.h
+
23
−
0
View file @
8630fc80
...
...
@@ -22,6 +22,8 @@
*/
#pragma once
#include
<SimoxUtility/math/scale_value.h>
#include
"../VirtualRobot.h"
#include
"../VirtualRobotException.h"
#include
"../SceneObject.h"
...
...
@@ -248,6 +250,27 @@ namespace VirtualRobot
return
jointLimitLo
;
}
inline
float
scaleJointValue
(
float
val
,
float
min
=
-
1
,
float
max
=
1
)
{
return
simox
::
math
::
scale_value_from_to
(
val
,
jointLimitLo
,
jointLimitHi
,
min
,
max
);
}
inline
float
unscaleJointValue
(
float
val
,
float
min
=
-
1
,
float
max
=
1
)
{
return
simox
::
math
::
scale_value_from_to
(
val
,
min
,
max
,
jointLimitLo
,
jointLimitHi
);
}
inline
float
getScaledJointValue
(
float
min
=
-
1
,
float
max
=
1
)
{
return
scaleJointValue
(
getJointValue
(),
min
,
max
);
}
inline
void
setScaledJointValue
(
float
val
,
float
min
=
-
1
,
float
max
=
1
)
{
setJointValue
(
unscaleJointValue
(
val
,
min
,
max
));
}
inline
void
setScaledJointValueNoUpdate
(
float
val
,
float
min
=
-
1
,
float
max
=
1
)
{
setJointValueNoUpdate
(
unscaleJointValue
(
val
,
min
,
max
));
}
/*!
Set maximum velocity of this joint in rad/s or m/s.
To disbale max. velocity set to -1.0f.
...
...
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