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
f6e6550a
Commit
f6e6550a
authored
10 years ago
by
Joseph Mirabel
Committed by
Joseph Mirabel
10 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Separate declaration and definition of Robot
parent
a90c6d1f
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
include/hpp/manipulation/robot.hh
+15
-49
15 additions, 49 deletions
include/hpp/manipulation/robot.hh
src/robot.cc
+63
-5
63 additions, 5 deletions
src/robot.cc
with
78 additions
and
54 deletions
include/hpp/manipulation/robot.hh
+
15
−
49
View file @
f6e6550a
...
...
@@ -20,10 +20,11 @@
#ifndef HPP_MANIPULATION_ROBOT_HH
# define HPP_MANIPULATION_ROBOT_HH
# include <hpp/manipulation/handle.hh>
# include <hpp/manipulation/object.hh>
# include <hpp/model/device.hh>
# include "hpp/manipulation/fwd.hh"
# include "hpp/manipulation/config.hh"
namespace
hpp
{
namespace
manipulation
{
/// Robot holding one or several objects.
...
...
@@ -58,68 +59,33 @@ namespace hpp {
vectorIn_t
fullVelocity
);
/// Get robot manipulating objects
const
Devices_t
&
robots
()
const
{
return
robots_
;
}
const
Devices_t
&
robots
()
const
;
/// Get objects manipulated by the robot
const
Objects_t
&
objects
()
const
{
return
objects_
;
}
const
Objects_t
&
objects
()
const
;
/// Get joint of this corresponding to joint of original object or robot.
const
JointPtr_t
&
joint
(
const
JointConstPtr_t
&
original
)
{
return
jointMap_
[
original
];
}
const
JointPtr_t
&
joint
(
const
JointConstPtr_t
&
original
);
/// \name Composite robot handles
/// \{
/// Add a handle
void
addHandle
(
const
std
::
string
&
name
,
const
HandlePtr_t
&
handle
)
{
handles_
[
name
]
=
handle
;
}
void
addHandle
(
const
std
::
string
&
name
,
const
HandlePtr_t
&
handle
);
/// Return the handle named name
const
HandlePtr_t
&
handle
(
const
std
::
string
&
name
)
const
{
Handles_t
::
const_iterator
it
=
handles_
.
find
(
name
);
if
(
it
==
handles_
.
end
())
throw
std
::
runtime_error
(
"no handle with name "
+
name
);
return
it
->
second
;
}
const
HandlePtr_t
&
handle
(
const
std
::
string
&
name
)
const
;
/// \}
/// Add a gripper
void
addGripper
(
const
std
::
string
&
name
,
const
GripperPtr_t
&
gripper
)
{
grippers_
[
name
]
=
gripper
;
}
void
addGripper
(
const
std
::
string
&
name
,
const
GripperPtr_t
&
gripper
);
/// Return the gripper named name
const
GripperPtr_t
&
gripper
(
const
std
::
string
&
name
)
const
{
Grippers_t
::
const_iterator
it
=
grippers_
.
find
(
name
);
if
(
it
==
grippers_
.
end
())
throw
std
::
runtime_error
(
"no gripper with name "
+
name
);
return
it
->
second
;
}
const
GripperPtr_t
&
gripper
(
const
std
::
string
&
name
)
const
;
/// Get Device names in the same order than the compositeRobot has been
/// build
std
::
vector
<
std
::
string
>
getDeviceNames
()
{
std
::
vector
<
std
::
string
>
deviceNames
;
for
(
Devices_t
::
iterator
itDevice
=
robots_
.
begin
()
;
itDevice
!=
robots_
.
end
()
;
itDevice
++
)
{
deviceNames
.
push_back
((
*
itDevice
)
->
name
());
}
for
(
Objects_t
::
iterator
itObject
=
objects_
.
begin
()
;
itObject
!=
objects_
.
end
()
;
itObject
++
)
{
deviceNames
.
push_back
((
*
itObject
)
->
name
());
}
return
deviceNames
;
}
std
::
vector
<
std
::
string
>
getDeviceNames
();
/// Print object in a stream
virtual
std
::
ostream
&
print
(
std
::
ostream
&
os
)
const
;
...
...
This diff is collapsed.
Click to expand it.
src/robot.cc
+
63
−
5
View file @
f6e6550a
...
...
@@ -18,10 +18,13 @@
// <http://www.gnu.org/licenses/>.
#include
<hpp/util/debug.hh>
#include
<hpp/manipulation/fwd.hh>
#include
<hpp/model/object-factory.hh>
#include
<hpp/manipulation/robot.hh>
#include
<hpp/model/gripper.hh>
#include
<hpp/model/object-factory.hh>
#include
"hpp/manipulation/fwd.hh"
#include
"hpp/manipulation/handle.hh"
#include
"hpp/manipulation/object.hh"
#include
"hpp/manipulation/robot.hh"
namespace
hpp
{
namespace
manipulation
{
...
...
@@ -29,6 +32,61 @@ namespace hpp {
typedef
std
::
map
<
std
::
string
,
GripperPtr_t
>
Grippers_t
;
typedef
std
::
vector
<
JointPtr_t
>
JointVector_t
;
const
Devices_t
&
Robot
::
robots
()
const
{
return
robots_
;
}
const
Objects_t
&
Robot
::
objects
()
const
{
return
objects_
;
}
const
JointPtr_t
&
Robot
::
joint
(
const
JointConstPtr_t
&
original
)
{
return
jointMap_
[
original
];
}
void
Robot
::
addHandle
(
const
std
::
string
&
name
,
const
HandlePtr_t
&
handle
)
{
handles_
[
name
]
=
handle
;
}
const
HandlePtr_t
&
Robot
::
handle
(
const
std
::
string
&
name
)
const
{
Handles_t
::
const_iterator
it
=
handles_
.
find
(
name
);
if
(
it
==
handles_
.
end
())
throw
std
::
runtime_error
(
"no handle with name "
+
name
);
return
it
->
second
;
}
void
Robot
::
addGripper
(
const
std
::
string
&
name
,
const
GripperPtr_t
&
gripper
)
{
grippers_
[
name
]
=
gripper
;
}
const
GripperPtr_t
&
Robot
::
gripper
(
const
std
::
string
&
name
)
const
{
Grippers_t
::
const_iterator
it
=
grippers_
.
find
(
name
);
if
(
it
==
grippers_
.
end
())
throw
std
::
runtime_error
(
"no gripper with name "
+
name
);
return
it
->
second
;
}
std
::
vector
<
std
::
string
>
Robot
::
getDeviceNames
()
{
std
::
vector
<
std
::
string
>
deviceNames
;
for
(
Devices_t
::
iterator
itDevice
=
robots_
.
begin
()
;
itDevice
!=
robots_
.
end
()
;
itDevice
++
)
{
deviceNames
.
push_back
((
*
itDevice
)
->
name
());
}
for
(
Objects_t
::
iterator
itObject
=
objects_
.
begin
()
;
itObject
!=
objects_
.
end
()
;
itObject
++
)
{
deviceNames
.
push_back
((
*
itObject
)
->
name
());
}
return
deviceNames
;
}
void
Robot
::
copyKinematicChain
(
const
JointPtr_t
&
parentJoint
,
const
JointConstPtr_t
&
joint
)
{
...
...
@@ -86,7 +144,7 @@ namespace hpp {
for
(
model
::
JointVector_t
::
const_iterator
itJoint
=
joints
.
begin
()
;
itJoint
!=
joints
.
end
()
;
itJoint
++
)
{
gripper
->
addDisabledCollision
(
jointMap_
[
*
itJoint
]);
}
}
addGripper
(
gripper
->
name
(),
gripper
);
}
}
...
...
@@ -200,7 +258,7 @@ namespace hpp {
","
<<
joint2
->
name
()
<<
")"
);
hpp
::
model
::
Device
::
addCollisionPairs
(
joint1
,
joint2
,
hpp
::
model
::
COLLISION
);
hpp
::
model
::
Device
::
addCollisionPairs
(
joint1
,
joint2
,
hpp
::
model
::
Device
::
addCollisionPairs
(
joint1
,
joint2
,
hpp
::
model
::
DISTANCE
);
}
}
...
...
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