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
0c07b170
Commit
0c07b170
authored
6 years ago
by
Mirko Wächter
Browse files
Options
Downloads
Patches
Plain Diff
made enforcement of joint limits optional
parent
65fe0fda
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
VirtualRobot/Nodes/RobotNode.cpp
+20
-8
20 additions, 8 deletions
VirtualRobot/Nodes/RobotNode.cpp
VirtualRobot/Nodes/RobotNode.h
+5
-1
5 additions, 1 deletion
VirtualRobot/Nodes/RobotNode.h
with
25 additions
and
9 deletions
VirtualRobot/Nodes/RobotNode.cpp
+
20
−
8
View file @
0c07b170
...
...
@@ -10,7 +10,7 @@
#include
"../XML/BaseIO.h"
#include
<cmath>
#include
<iomanip>
#include
<boost/optional/optional_io.hpp>
#include
<algorithm>
#include
<Eigen/Core>
...
...
@@ -125,6 +125,16 @@ namespace VirtualRobot
}
bool
RobotNode
::
getEnforceJointLimits
()
const
{
return
enforceJointLimits
;
}
void
RobotNode
::
setEnforceJointLimits
(
bool
value
)
{
enforceJointLimits
=
value
;
}
RobotPtr
RobotNode
::
getRobot
()
const
{
RobotPtr
result
(
robot
);
...
...
@@ -181,15 +191,17 @@ namespace VirtualRobot
}
else
{
// non-limitless joint: clamp to borders
if
(
q
<
jointLimitLo
)
if
(
enforceJointLimits
)
// non-limitless joint: clamp to borders
{
q
=
jointLimitLo
;
}
if
(
q
<
jointLimitLo
)
{
q
=
jointLimitLo
;
}
if
(
q
>
jointLimitHi
)
{
q
=
jointLimitHi
;
if
(
q
>
jointLimitHi
)
{
q
=
jointLimitHi
;
}
}
}
...
...
This diff is collapsed.
Click to expand it.
VirtualRobot/Nodes/RobotNode.h
+
5
−
1
View file @
0c07b170
...
...
@@ -339,7 +339,10 @@ namespace VirtualRobot
*/
virtual
void
setJointValueNoUpdate
(
float
q
);
protected
:
bool
getEnforceJointLimits
()
const
;
void
setEnforceJointLimits
(
bool
value
);
protected
:
/*!
Queries parent for global pose and updates visualization accordingly
*/
...
...
@@ -370,6 +373,7 @@ namespace VirtualRobot
float
jointValueOffset
;
float
jointLimitLo
,
jointLimitHi
;
bool
enforceJointLimits
=
true
;
bool
limitless
;
// whether this joint has limits or not (ignored if nodeType != Joint).
DHParameter
optionalDHParameter
;
// When the joint is defined via DH parameters they are stored here
float
maxVelocity
;
//! given in m/s
...
...
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