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
Commits
9e494d82
Commit
9e494d82
authored
6 years ago
by
Mirko Wächter
Browse files
Options
Downloads
Patches
Plain Diff
optimized trajectory controller class
parent
86b44d4d
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
source/RobotAPI/libraries/core/TrajectoryController.cpp
+3
-3
3 additions, 3 deletions
source/RobotAPI/libraries/core/TrajectoryController.cpp
source/RobotAPI/libraries/core/TrajectoryController.h
+1
-1
1 addition, 1 deletion
source/RobotAPI/libraries/core/TrajectoryController.h
with
4 additions
and
4 deletions
source/RobotAPI/libraries/core/TrajectoryController.cpp
+
3
−
3
View file @
9e494d82
...
...
@@ -47,12 +47,12 @@ namespace armarx
veloctities
.
resize
(
traj
->
dim
(),
1
);
}
Eigen
::
VectorXf
TrajectoryController
::
update
(
double
deltaT
,
const
Eigen
::
VectorXf
currentPosition
)
const
Eigen
::
VectorXf
&
TrajectoryController
::
update
(
double
deltaT
,
const
Eigen
::
VectorXf
&
currentPosition
)
{
ARMARX_CHECK_EXPRESSION
(
pid
);
ARMARX_CHECK_EXPRESSION
(
traj
);
ARMARX_CHECK_EQUAL
(
static_cast
<
std
::
size_t
>
(
currentPosition
.
rows
()),
traj
->
dim
());
in
t
dim
=
traj
->
dim
();
size_
t
dim
=
traj
->
dim
();
currentTimestamp
=
currentTimestamp
+
deltaT
;
if
(
currentTimestamp
<
0.0
)
...
...
@@ -60,7 +60,7 @@ namespace armarx
currentTimestamp
=
0.0
;
}
for
(
in
t
i
=
0
;
i
<
dim
;
++
i
)
for
(
size_
t
i
=
0
;
i
<
dim
;
++
i
)
{
positions
(
i
)
=
traj
->
getState
(
currentTimestamp
,
i
,
0
);
veloctities
(
i
)
=
(
std
::
signbit
(
deltaT
)
?
-
1.0
:
1.0
)
*
traj
->
getState
(
currentTimestamp
,
i
,
1
);
...
...
This diff is collapsed.
Click to expand it.
source/RobotAPI/libraries/core/TrajectoryController.h
+
1
−
1
View file @
9e494d82
...
...
@@ -33,7 +33,7 @@ namespace armarx
{
public:
TrajectoryController
(
const
TrajectoryPtr
&
traj
,
float
kp
,
float
ki
=
0.0
f
,
float
kd
=
0.0
f
,
bool
threadSafe
=
true
);
Eigen
::
VectorXf
update
(
double
deltaT
,
const
Eigen
::
VectorXf
currentPosition
);
const
Eigen
::
VectorXf
&
update
(
double
deltaT
,
const
Eigen
::
VectorXf
&
currentPosition
);
//const MultiDimPIDControllerPtr& getPid() const;
//void setPid(const MultiDimPIDControllerPtr& value);
...
...
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