Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
R
RobotAPI
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
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
ArmarX
RobotAPI
Merge requests
!169
bugfix: platform position controller is turning into wrong direction
Code
Review changes
Check out branch
Download
Patches
Plain diff
Merged
bugfix: platform position controller is turning into wrong direction
fix/platform-rotation
into
master
Overview
0
Commits
3
Pipelines
0
Changes
1
Merged
Fabian Reister
requested to merge
fix/platform-rotation
into
master
3 years ago
Overview
0
Commits
3
Pipelines
0
Changes
1
Expand
Changes
Orientation PID controller with 'limitless' flag to clamp error to [-pi, pi]
Clamping incoming angles (target orientation and current orientation) to [-pi, pi]
Simplified implementation (removed the buggy/incorrect code)
Tests
Tested in simulation: from orientation -1.3 to 1.5
Edited
3 years ago
by
Fabian Reister
0
0
Merge request reports
Viewing commit
1741ed76
Prev
Next
Show latest version
1 file
+
3
−
17
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
1741ed76
cleanup
· 1741ed76
Fabian Reister
authored
3 years ago
source/RobotAPI/components/units/RobotUnit/NJointControllers/NJointHolonomicPlatformGlobalPositionController.cpp
+
3
−
17
Options
@@ -80,24 +80,10 @@ namespace armarx
return
;
}
const
float
measuredOrientation
=
rtGetControlStruct
().
globalOrientation
;
const
Eigen
::
Vector2f
measuredPosition
=
rtGetControlStruct
().
globalPosition
;
// + relativeCurrentPosition;
const
float
measuredOrientation
=
rtGetControlStruct
().
globalOrientation
;
//+ relativeOrientation;
const
float
targetOrientation
=
rtGetControlStruct
().
targetOrientation
;
// measured and target orientation are now within bounds [-pi, pi]
// in which orientation to rotate? => angleBetween is not reliable yet!
// float angleBetween = targetOrientation - measuredOrientation;
// angleBetween = simox::math::periodic_clamp(angleBetween, -M_PIf32, M_PIf32);
// targetOrientation = measuredOrientation + angleBetween;
// -> now angleBetween is reliable
pid
.
update
(
timeSinceLastIteration
.
toSecondsDouble
(),
measuredPosition
,
rtGetControlStruct
().
target
);
//opid.update(timeSinceLastIteration.toSecondsDouble(), static_cast<double>(updatedOrientation), rtGetControlStruct().targetOrientation);
opid
.
update
(
timeSinceLastIteration
.
toSecondsDouble
(),
static_cast
<
double
>
(
measuredOrientation
),
targetOrientation
);
pid
.
update
(
timeSinceLastIteration
.
toSecondsDouble
(),
rtGetControlStruct
().
globalPosition
,
rtGetControlStruct
().
target
);
opid
.
update
(
timeSinceLastIteration
.
toSecondsDouble
(),
static_cast
<
double
>
(
measuredOrientation
),
rtGetControlStruct
().
targetOrientation
);
const
Eigen
::
Rotation2Df
global_R_local
(
-
measuredOrientation
);
Loading