Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
H
hpp-manipulation
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
hpp-manipulation
Commits
6e38ce3a
Unverified
Commit
6e38ce3a
authored
5 years ago
by
Joseph Mirabel
Committed by
GitHub
5 years ago
Browse files
Options
Downloads
Plain Diff
Merge pull request #73 from jmirabel/devel
Add cost in GraphComponent.
parents
9a6abfb3
ad65e83b
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
include/hpp/manipulation/graph/graph-component.hh
+8
-0
8 additions, 0 deletions
include/hpp/manipulation/graph/graph-component.hh
src/graph/graph-component.cc
+16
-0
16 additions, 0 deletions
src/graph/graph-component.cc
src/graph/validation.cc
+3
-3
3 additions, 3 deletions
src/graph/validation.cc
with
27 additions
and
3 deletions
include/hpp/manipulation/graph/graph-component.hh
+
8
−
0
View file @
6e38ce3a
...
...
@@ -57,6 +57,9 @@ namespace hpp {
const
ImplicitPtr_t
&
numConstraint
,
const
segments_t
&
passiveDofs
=
segments_t
());
/// Add a cost function Implicit to the component.
virtual
void
addNumericalCost
(
const
ImplicitPtr_t
&
numCost
);
/// Reset the numerical constraints stored in the component.
virtual
void
resetNumericalConstraints
();
...
...
@@ -85,6 +88,9 @@ namespace hpp {
/// Get a reference to the NumericalConstraints_t
const
NumericalConstraints_t
&
numericalConstraints
()
const
;
/// Get a reference to the NumericalConstraints_t
const
NumericalConstraints_t
&
numericalCosts
()
const
;
/// Get a reference to the NumericalConstraints_t
const
IntervalsContainer_t
&
passiveDofs
()
const
;
...
...
@@ -119,6 +125,8 @@ namespace hpp {
NumericalConstraints_t
numericalConstraints_
;
/// Stores the passive dofs for each numerical constraints.
IntervalsContainer_t
passiveDofs_
;
/// Stores the numerical costs.
NumericalConstraints_t
numericalCosts_
;
/// List of LockedJoint constraints: \todo to be removed
const
LockedJoints_t
lockedJoints_
;
/// A weak pointer to the parent graph.
...
...
This diff is collapsed.
Click to expand it.
src/graph/graph-component.cc
+
16
−
0
View file @
6e38ce3a
...
...
@@ -59,11 +59,18 @@ namespace hpp {
passiveDofs_
.
push_back
(
passiveDofs
);
}
void
GraphComponent
::
addNumericalCost
(
const
ImplicitPtr_t
&
cost
)
{
isInit_
=
false
;
numericalCosts_
.
push_back
(
cost
);
}
void
GraphComponent
::
resetNumericalConstraints
()
{
isInit_
=
false
;
numericalConstraints_
.
clear
();
passiveDofs_
.
clear
();
numericalCosts_
.
clear
();
}
void
GraphComponent
::
addLockedJointConstraint
...
...
@@ -85,6 +92,10 @@ namespace hpp {
++
itpdof
;
}
assert
(
itpdof
==
passiveDofs_
.
end
());
for
(
NumericalConstraints_t
::
const_iterator
it
=
numericalCosts_
.
begin
();
it
!=
numericalCosts_
.
end
();
++
it
)
{
proj
->
add
(
*
it
,
1
);
}
return
!
numericalConstraints_
.
empty
();
}
...
...
@@ -93,6 +104,11 @@ namespace hpp {
return
numericalConstraints_
;
}
const
NumericalConstraints_t
&
GraphComponent
::
numericalCosts
()
const
{
return
numericalCosts_
;
}
const
std
::
vector
<
segments_t
>&
GraphComponent
::
passiveDofs
()
const
{
return
passiveDofs_
;
...
...
This diff is collapsed.
Click to expand it.
src/graph/validation.cc
+
3
−
3
View file @
6e38ce3a
...
...
@@ -41,9 +41,9 @@ namespace hpp {
{
const
NumericalConstraints_t
&
Ancs
=
A
->
numericalConstraints
();
const
NumericalConstraints_t
&
Bncs
=
B
->
numericalConstraints
();
for
(
NumericalConstraints_t
::
const_iterator
_nc
=
A
ncs
.
begin
();
_nc
!=
A
ncs
.
end
();
++
_nc
)
if
(
std
::
find
(
B
ncs
.
begin
(),
B
ncs
.
end
(),
*
_nc
)
==
B
ncs
.
end
())
for
(
NumericalConstraints_t
::
const_iterator
_nc
=
B
ncs
.
begin
();
_nc
!=
B
ncs
.
end
();
++
_nc
)
if
(
std
::
find
(
A
ncs
.
begin
(),
A
ncs
.
end
(),
*
_nc
)
==
A
ncs
.
end
())
return
false
;
return
true
;
}
...
...
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