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
Humanoid Path Planner
hpp-manipulation
Commits
2cc6e984
Commit
2cc6e984
authored
10 years ago
by
Joseph Mirabel
Committed by
Joseph Mirabel
10 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Fix bug: add collisions between robots from different URDF.
parent
d4aae937
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
include/hpp/manipulation/device.hh
+28
-1
28 additions, 1 deletion
include/hpp/manipulation/device.hh
src/CMakeLists.txt
+1
-0
1 addition, 0 deletions
src/CMakeLists.txt
src/device.cc
+53
-0
53 additions, 0 deletions
src/device.cc
with
82 additions
and
1 deletion
include/hpp/manipulation/device.hh
+
28
−
1
View file @
2cc6e984
...
@@ -63,6 +63,9 @@ namespace hpp {
...
@@ -63,6 +63,9 @@ namespace hpp {
return
os
;
return
os
;
}
}
/// \name Accessors to container elements
/// \{
/// Get an element of a container
/// Get an element of a container
template
<
typename
Element
>
template
<
typename
Element
>
const
Element
&
get
(
const
std
::
string
&
name
)
const
const
Element
&
get
(
const
std
::
string
&
name
)
const
...
@@ -84,13 +87,34 @@ namespace hpp {
...
@@ -84,13 +87,34 @@ namespace hpp {
Container
<
Element
>::
add
(
name
,
element
);
Container
<
Element
>::
add
(
name
,
element
);
}
}
/// \}
/// \name Collisions
/// \{
/// Cache joint vector
void
prepareInsertRobot
()
{
didPrepare_
=
true
;
jointCache_
=
getJointVector
();
}
/// Add collisions
/// between the joint vector cache initialized by prepareInsertRobot()
/// add the current Robot.
/// When creating a robot from several URDF files, this enables
/// collisions between joints from different files.
void
didInsertRobot
();
/// \}
protected
:
protected
:
/// Constructor
/// Constructor
/// \param name of the new instance,
/// \param name of the new instance,
/// \param robot Robots that manipulate objects,
/// \param robot Robots that manipulate objects,
/// \param objects Set of objects manipulated by the robot.
/// \param objects Set of objects manipulated by the robot.
Device
(
const
std
::
string
&
name
)
:
Device
(
const
std
::
string
&
name
)
:
Parent_t
(
name
)
Parent_t
(
name
)
,
jointCache_
(),
didPrepare_
(
false
)
{}
{}
void
init
(
const
DeviceWkPtr_t
&
self
)
void
init
(
const
DeviceWkPtr_t
&
self
)
...
@@ -101,6 +125,9 @@ namespace hpp {
...
@@ -101,6 +125,9 @@ namespace hpp {
private
:
private
:
DeviceWkPtr_t
self_
;
DeviceWkPtr_t
self_
;
model
::
JointVector_t
jointCache_
;
bool
didPrepare_
;
};
// class Device
};
// class Device
}
// namespace manipulation
}
// namespace manipulation
}
// namespace hpp
}
// namespace hpp
...
...
This diff is collapsed.
Click to expand it.
src/CMakeLists.txt
+
1
−
0
View file @
2cc6e984
...
@@ -25,6 +25,7 @@ ADD_LIBRARY(${LIBRARY_NAME} SHARED
...
@@ -25,6 +25,7 @@ ADD_LIBRARY(${LIBRARY_NAME} SHARED
manipulation-planner.cc
manipulation-planner.cc
problem-solver.cc
problem-solver.cc
roadmap.cc
roadmap.cc
device.cc
graph-path-validation.cc
graph-path-validation.cc
graph-steering-method.cc
graph-steering-method.cc
...
...
This diff is collapsed.
Click to expand it.
src/device.cc
0 → 100644
+
53
−
0
View file @
2cc6e984
///
/// Copyright (c) 2015 CNRS
/// Authors: Joseph Mirabel
///
///
// This file is part of hpp-manipulation.
// hpp-manipulation is free software: you can redistribute it
// and/or modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation, either version
// 3 of the License, or (at your option) any later version.
//
// hpp-manipulation is distributed in the hope that it will be
// useful, but WITHOUT ANY WARRANTY; without even the implied warranty
// of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// General Lesser Public License for more details. You should have
// received a copy of the GNU Lesser General Public License along with
// hpp-manipulation. If not, see
// <http://www.gnu.org/licenses/>.
#include
<hpp/manipulation/device.hh>
#include
<hpp/model/joint.hh>
namespace
hpp
{
namespace
manipulation
{
void
Device
::
didInsertRobot
()
{
if
(
!
didPrepare_
)
{
hppDout
(
error
,
"You must call prepareInsertRobot before."
);
}
didPrepare_
=
false
;
/// Build list of new joints
const
model
::
JointVector_t
jv
=
getJointVector
();
model
::
JointVector_t
newj
;
model
::
JointVector_t
::
const_iterator
retFind
,
it1
,
it2
;
for
(
it1
=
jv
.
begin
();
it1
!=
jv
.
end
();
++
it1
)
{
retFind
=
find
(
jointCache_
.
begin
(),
jointCache_
.
end
(),
*
it1
);
if
(
retFind
==
jointCache_
.
end
())
newj
.
push_back
(
*
it1
);
}
/// Add collision between old joints and new ones.
for
(
it1
=
newj
.
begin
();
it1
!=
newj
.
end
();
++
it1
)
{
if
(
!
(
*
it1
)
->
linkedBody
())
continue
;
for
(
it2
=
jointCache_
.
begin
();
it2
!=
jointCache_
.
end
();
++
it2
)
{
if
(
!
(
*
it2
)
->
linkedBody
())
continue
;
addCollisionPairs
(
*
it1
,
*
it2
,
model
::
COLLISION
);
addCollisionPairs
(
*
it1
,
*
it2
,
model
::
DISTANCE
);
}
}
jointCache_
.
clear
();
}
}
// namespace manipulation
}
// namespace hpp
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