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
d1f86947
Commit
d1f86947
authored
11 years ago
by
olivier stasse
Browse files
Options
Downloads
Plain Diff
Merge pull request #24 from mehdi-benallegue/master
Set the signal values AFTER the integration
parents
79035ac2
b3661c87
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/tools/device.cpp
+17
-17
17 additions, 17 deletions
src/tools/device.cpp
with
17 additions
and
17 deletions
src/tools/device.cpp
+
17
−
17
View file @
d1f86947
...
...
@@ -217,7 +217,7 @@ setStateSize( const unsigned int& size )
void
Device
::
setVelocitySize
(
const
unsigned
int
&
size
)
{
{
velocity_
.
resize
(
size
);
velocity_
.
fill
(
.0
);
velocitySOUT
.
setConstant
(
velocity_
);
...
...
@@ -270,19 +270,6 @@ increment( const double & dt )
int
time
=
stateSOUT
.
getTime
();
sotDEBUG
(
25
)
<<
"Time : "
<<
time
<<
std
::
endl
;
/* Position the signals corresponding to sensors. */
stateSOUT
.
setConstant
(
state_
);
stateSOUT
.
setTime
(
time
+
1
);
if
(
secondOrderIntegration_
)
{
velocitySOUT
.
setConstant
(
velocity_
);
velocitySOUT
.
setTime
(
time
+
1
);
}
for
(
int
i
=
0
;
i
<
4
;
++
i
){
if
(
!
withForceSignals
[
i
]
)
forcesSOUT
[
i
]
->
setConstant
(
forceZero6
);
}
ml
::
Vector
zmp
(
3
);
zmp
.
fill
(
.0
);
ZMPPreviousControllerSOUT
.
setConstant
(
zmp
);
// Run Synchronous commands and evaluate signals outside the main
// connected component of the graph.
try
...
...
@@ -342,6 +329,19 @@ increment( const double & dt )
<<
" running periodical commands (after)"
<<
std
::
endl
;
}
/* Position the signals corresponding to sensors. */
stateSOUT
.
setConstant
(
state_
);
stateSOUT
.
setTime
(
time
+
1
);
if
(
secondOrderIntegration_
)
{
velocitySOUT
.
setConstant
(
velocity_
);
velocitySOUT
.
setTime
(
time
+
1
);
}
for
(
int
i
=
0
;
i
<
4
;
++
i
){
if
(
!
withForceSignals
[
i
]
)
forcesSOUT
[
i
]
->
setConstant
(
forceZero6
);
}
ml
::
Vector
zmp
(
3
);
zmp
.
fill
(
.0
);
ZMPPreviousControllerSOUT
.
setConstant
(
zmp
);
// Others signals.
motorcontrolSOUT
.
setConstant
(
state_
);
}
...
...
@@ -349,7 +349,7 @@ increment( const double & dt )
void
Device
::
integrate
(
const
double
&
dt
)
{
const
ml
::
Vector
&
control
=
controlSIN
.
accessCopy
();
if
(
!
vel_controlInit_
)
{
vel_control_
=
ml
::
Vector
(
control
.
size
());
...
...
@@ -362,7 +362,7 @@ void Device::integrate( const double & dt )
// freedom as a translation and roll pitch yaw.
unsigned
int
offset
=
6
;
if
(
secondOrderIntegration_
)
{
...
...
@@ -382,7 +382,7 @@ void Device::integrate( const double & dt )
offset
=
0
;
integrateRollPitchYaw
(
state_
,
vel_control_
,
dt
);
}
for
(
unsigned
int
i
=
6
;
i
<
state_
.
size
();
++
i
)
{
state_
(
i
)
+=
(
vel_control_
(
i
-
offset
)
*
dt
);
}
}
...
...
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