Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
S
sot-core
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Stack Of Tasks
sot-core
Commits
e80b9383
Commit
e80b9383
authored
14 years ago
by
Nicolas Mansard
Browse files
Options
Downloads
Patches
Plain Diff
Added an initializer from passing point.
parent
ce18f5c3
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
include/sot/core/gain-adaptive.hh
+4
-0
4 additions, 0 deletions
include/sot/core/gain-adaptive.hh
src/task/gain-adaptive.cpp
+44
-0
44 additions, 0 deletions
src/task/gain-adaptive.cpp
with
48 additions
and
0 deletions
include/sot/core/gain-adaptive.hh
+
4
−
0
View file @
e80b9383
...
...
@@ -95,6 +95,10 @@ class SOTGAINADAPTATIVE_EXPORT GainAdaptive
void
init
(
const
double
&
valueAt0
,
const
double
&
valueAtInfty
,
const
double
&
tanAt0
);
void
initFromPassingPoint
(
const
double
&
valueAt0
,
const
double
&
valueAtInfty
,
const
double
&
errorReference
,
const
double
&
valueAtReference
);
void
forceConstant
(
void
);
public
:
/* --- SIGNALS --- */
...
...
This diff is collapsed.
Click to expand it.
src/task/gain-adaptive.cpp
+
44
−
0
View file @
e80b9383
...
...
@@ -85,6 +85,17 @@ void GainAdaptive::addCommands()
addCommand
(
"set"
,
makeCommandVoid3
(
*
this
,
&
GainAdaptive
::
init
,
docstring
));
docstring
=
"
\n
"
" set from value at 0 and infinity, with a passing point
\n
"
" Input:
\n
"
" floating point value: value at 0,
\n
"
" floating point value: value at infinity,
\n
"
" floating point value: reference point,
\n
"
" floating point value: percentage at ref point.
\n
"
"
\n
"
;
addCommand
(
"setByPoint"
,
makeCommandVoid4
(
*
this
,
&
GainAdaptive
::
initFromPassingPoint
,
docstring
));
}
GainAdaptive
::
...
...
@@ -133,6 +144,39 @@ init( const double& valueAt0,
return
;
}
/*
* The idea is to fix value at 0 and infinity. Now, we are looking for a smart
* way to chose the slope at 0 or the coeff B (it is more or less the same).
* I can imagine to way of using a passing point:
* - first, imposing a value gref at position xref: g(xref)=gref.
* In that case, B=-1/xref*log((gref-C)/A):
* gnuplot> A=1; C=.1; xref=.1; gref=.4; B=1/xref*log((gref-C)/A)
* gnuplot> plot [0:(A+C)/B*10][C-.1*(A-C):A+C+.1*(A-C)] A*exp(-B*x)+C, A+C-B*x
* - second solution: imposing to reach a percentage of raise at a given point. It
* is more or less the same as before, but with gref := C+p*A, for a given p. In that
* case, B=-1/xref*log(p)
* gnuplot> A=1; C=.1; xref=.1; p=.1; B=1/xref*log(p)
* gnuplot> plot [0:(A+C)/B*10][C-.1*(A-C):A+C+.1*(A-C)] A*exp(-B*x)+C, A+C-B*x
*
* The second solution is tried in the following.
*/
void
GainAdaptive
::
initFromPassingPoint
(
const
double
&
valueAt0
,
const
double
&
valueAtInfty
,
const
double
&
xref
,
const
double
&
p
)
//gref )
{
coeff_c
=
valueAtInfty
;
coeff_a
=
valueAt0
-
valueAtInfty
;
if
(
0
==
coeff_a
)
{
coeff_b
=
0
;
}
else
{
//coeff_b = -1/xref*log( (gref-coeff_c)/coeff_a );
coeff_b
=
-
1
/
xref
*
log
(
p
);
}
}
void
GainAdaptive
::
forceConstant
(
void
)
{
...
...
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