Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
loco-3d
Multicontact-api
Commits
a288b441
Commit
a288b441
authored
Jan 30, 2020
by
Pierre Fernbach
Browse files
[C++] add method COntactSequence::getALlEffectorsInContact
parent
b736c09b
Changes
1
Show whitespace changes
Inline
Side-by-side
include/multicontact-api/scenario/contact-sequence.hpp
View file @
a288b441
...
...
@@ -17,6 +17,7 @@ struct ContactSequenceTpl : public serialization::Serializable<ContactSequenceTp
EIGEN_MAKE_ALIGNED_OPERATOR_NEW
typedef
_ContactPhase
ContactPhase
;
typedef
typename
ContactPhase
::
Scalar
Scalar
;
typedef
typename
ContactPhase
::
t_strings
t_strings
;
typedef
std
::
vector
<
ContactPhase
>
ContactPhaseVector
;
ContactSequenceTpl
(
const
size_t
size
=
0
)
:
m_contact_phases
(
size
)
{}
...
...
@@ -742,6 +743,21 @@ struct ContactSequenceTpl : public serialization::Serializable<ContactSequenceTp
return
true
;
}
/**
* @brief getAllEffectorsInContact return a vector of names of all the effectors used to create contacts during the sequence
* @return
*/
t_strings
getAllEffectorsInContact
()
const
{
// use set to guarantee uniqueness, but return a vector for easier use and python bindings
std
::
set
<
std
::
string
>
res_set
;
for
(
const
ContactPhase
&
phase
:
m_contact_phases
){
for
(
const
std
::
string
&
eeName
:
phase
.
effectorsInContact
()){
res_set
.
insert
(
eeName
);
}
}
return
t_strings
(
res_set
.
begin
(),
res_set
.
end
());
}
/* End Helpers */
/*Public Attributes*/
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment