Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
S
sot-dynamic-pinocchio
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-dynamic-pinocchio
Commits
ab9c3de1
Commit
ab9c3de1
authored
13 years ago
by
Florent Lamiraux
Browse files
Options
Downloads
Patches
Plain Diff
Add a command to get hand parameters.
parent
c03bf5b2
No related branches found
No related tags found
1 merge request
!1
[major][cpp] starting point to integrate pinocchio
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/dynamic-command.h
+35
-0
35 additions, 0 deletions
src/dynamic-command.h
src/dynamic.cpp
+15
-0
15 additions, 0 deletions
src/dynamic.cpp
with
50 additions
and
0 deletions
src/dynamic-command.h
+
35
−
0
View file @
ab9c3de1
...
@@ -491,6 +491,41 @@ namespace dynamicgraph { namespace sot {
...
@@ -491,6 +491,41 @@ namespace dynamicgraph { namespace sot {
return
Value
();
return
Value
();
}
}
};
// class Write
};
// class Write
class
GetHandParameter
:
public
Command
{
public:
virtual
~
GetHandParameter
()
{}
GetHandParameter
(
Dynamic
&
entity
,
const
std
::
string
&
docstring
)
:
Command
(
entity
,
boost
::
assign
::
list_of
(
Value
::
BOOL
),
docstring
)
{
}
virtual
Value
doExecute
()
{
Dynamic
&
robot
=
static_cast
<
Dynamic
&>
(
owner
());
std
::
vector
<
Value
>
values
=
getParameterValues
();
bool
right
=
values
[
0
].
value
();
ml
::
Matrix
handParameter
(
4
,
4
);
handParameter
.
setIdentity
();
CjrlHand
*
hand
;
if
(
right
)
hand
=
robot
.
m_HDR
->
rightHand
();
else
hand
=
robot
.
m_HDR
->
leftHand
();
vector3d
axis
;
hand
->
getThumbAxis
(
axis
);
for
(
unsigned
int
i
=
0
;
i
<
3
;
i
++
)
handParameter
(
i
,
0
)
=
axis
(
i
);
hand
->
getForeFingerAxis
(
axis
);
for
(
unsigned
int
i
=
0
;
i
<
3
;
i
++
)
handParameter
(
i
,
1
)
=
axis
(
i
);
hand
->
getPalmNormal
(
axis
);
for
(
unsigned
int
i
=
0
;
i
<
3
;
i
++
)
handParameter
(
i
,
2
)
=
axis
(
i
);
hand
->
getCenter
(
axis
);
for
(
unsigned
int
i
=
0
;
i
<
3
;
i
++
)
handParameter
(
i
,
3
)
=
axis
(
i
);
return
Value
(
handParameter
);
}
};
// class GetHandParameter
}
// namespace command
}
// namespace command
}
/* namespace sot */
}
/* namespace dynamicgraph */
}
/* namespace sot */
}
/* namespace dynamicgraph */
...
...
This diff is collapsed.
Click to expand it.
src/dynamic.cpp
+
15
−
0
View file @
ab9c3de1
...
@@ -412,6 +412,21 @@ Dynamic( const std::string & name, bool build )
...
@@ -412,6 +412,21 @@ Dynamic( const std::string & name, bool build )
new
dynamicgraph
::
command
::
Getter
<
Dynamic
,
ml
::
Vector
>
new
dynamicgraph
::
command
::
Getter
<
Dynamic
,
ml
::
Vector
>
(
*
this
,
&
Dynamic
::
getAnklePositionInFootFrame
,
docstring
));
(
*
this
,
&
Dynamic
::
getAnklePositionInFootFrame
,
docstring
));
docstring
=
"
\n
"
" Get geometric parameters of hand.
\n
"
"
\n
"
" Input
\n
"
" - a boolean: whether right foot or not,
\n
"
" Return
\n
"
" - a matrix 4 by 4 the columns of which respectively represent
\n
"
" - the thumb axis,
\n
"
" - the forefinger axis,
\n
"
" - the palm normal,
\n
"
" - the hand center.
\n
"
" Note that the last line is (0 0 0 1).
\n
"
"
\n
"
;
addCommand
(
"getHandParameter"
,
new
command
::
GetHandParameter
(
*
this
,
docstring
));
sotDEBUGOUT
(
5
);
sotDEBUGOUT
(
5
);
}
}
...
...
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