Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
S
sot-talos-balance
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
Guilhem Saurel
sot-talos-balance
Commits
c07c893d
Commit
c07c893d
authored
5 years ago
by
Gabriele Buondonno
Browse files
Options
Downloads
Patches
Plain Diff
Resettable reference frame
parent
81c8b674
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
include/sot/talos_balance/simple-reference-frame.hh
+3
-0
3 additions, 0 deletions
include/sot/talos_balance/simple-reference-frame.hh
src/simple-reference-frame.cpp
+13
-7
13 additions, 7 deletions
src/simple-reference-frame.cpp
with
16 additions
and
7 deletions
include/sot/talos_balance/simple-reference-frame.hh
+
3
−
0
View file @
c07c893d
...
...
@@ -68,6 +68,7 @@ namespace dynamicgraph {
/* --- SIGNALS --- */
DECLARE_SIGNAL_IN
(
footLeft
,
MatrixHomogeneous
);
DECLARE_SIGNAL_IN
(
footRight
,
MatrixHomogeneous
);
DECLARE_SIGNAL_IN
(
reset
,
bool
);
DECLARE_SIGNAL_OUT
(
referenceFrame
,
MatrixHomogeneous
);
...
...
@@ -78,6 +79,8 @@ namespace dynamicgraph {
protected:
RobotUtilShrPtr
m_robot_util
;
Vector
m_rightFootSoleXYZ
;
MatrixHomogeneous
m_referenceFrame
;
bool
m_first
;
bool
m_initSucceeded
;
/// true if the entity has been successfully initialized
};
// class SimpleReferenceFrame
...
...
This diff is collapsed.
Click to expand it.
src/simple-reference-frame.cpp
+
13
−
7
View file @
c07c893d
...
...
@@ -36,7 +36,7 @@ namespace dynamicgraph
//Size to be aligned "-------------------------------------------------------"
#define PROFILE_SIMPLEREFERENCEFRAME_DCM_COMPUTATION "SimpleReferenceFrame: dcm computation "
#define INPUT_SIGNALS m_footLeftSIN << m_footRightSIN
#define INPUT_SIGNALS m_footLeftSIN << m_footRightSIN
<< m_resetSIN
#define OUTPUT_SIGNALS m_referenceFrameSOUT
...
...
@@ -55,10 +55,13 @@ namespace dynamicgraph
:
Entity
(
name
)
,
CONSTRUCT_SIGNAL_IN
(
footLeft
,
MatrixHomogeneous
)
,
CONSTRUCT_SIGNAL_IN
(
footRight
,
MatrixHomogeneous
)
,
CONSTRUCT_SIGNAL_OUT
(
referenceFrame
,
MatrixHomogeneous
,
m_footLeftSIN
<<
m_footRightSIN
)
,
CONSTRUCT_SIGNAL_IN
(
reset
,
bool
)
,
CONSTRUCT_SIGNAL_OUT
(
referenceFrame
,
MatrixHomogeneous
,
m_footLeftSIN
<<
m_footRightSIN
<<
m_resetSIN
)
,
m_first
(
true
)
,
m_initSucceeded
(
false
)
{
Entity
::
signalRegistration
(
INPUT_SIGNALS
<<
OUTPUT_SIGNALS
);
m_referenceFrame
.
setIdentity
();
/* Commands. */
addCommand
(
"init"
,
makeCommandVoid1
(
*
this
,
&
SimpleReferenceFrame
::
init
,
docCommandVoid1
(
"Initialize the entity."
,
"Robot name"
)));
...
...
@@ -105,14 +108,17 @@ namespace dynamicgraph
const
MatrixHomogeneous
&
footLeft
=
m_footLeftSIN
(
iter
);
const
MatrixHomogeneous
&
footRight
=
m_footRightSIN
(
iter
);
const
bool
reset
=
m_resetSIN
.
isPlugged
()
?
m_resetSIN
(
iter
)
:
false
;
const
Vector
&
centerTranslation
=
(
footLeft
.
translation
()
+
footRight
.
translation
()
)
/
2
+
m_rightFootSoleXYZ
;
if
(
reset
||
m_first
)
{
const
Vector
&
centerTranslation
=
(
footLeft
.
translation
()
+
footRight
.
translation
()
)
/
2
+
m_rightFootSoleXYZ
;
MatrixHomogeneous
referenceFrame
;
referenceFrame
.
linear
()
=
footRight
.
linear
()
;
referenceFrame
.
translation
()
=
centerTranslation
;
m_referenceFrame
.
linear
()
=
footRight
.
linear
()
;
m_
referenceFrame
.
translation
()
=
centerTranslation
;
}
s
=
referenceFrame
;
s
=
m_
referenceFrame
;
return
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