Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
G
gazebo-pkgs
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
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
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
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
CeTI
ROS
ROS Packages
gazebo-pkgs
Commits
c79a1912
Commit
c79a1912
authored
9 years ago
by
Jennifer Buehler
Browse files
Options
Downloads
Patches
Plain Diff
added OnAttach() and OnDetach() to grasp fix plugin
parent
2383a1f9
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
gazebo_grasp_plugin/include/gazebo_grasp_plugin/GazeboGraspFix.h
+11
-1
11 additions, 1 deletion
...grasp_plugin/include/gazebo_grasp_plugin/GazeboGraspFix.h
gazebo_grasp_plugin/src/GazeboGraspFix.cpp
+4
-0
4 additions, 0 deletions
gazebo_grasp_plugin/src/GazeboGraspFix.cpp
with
15 additions
and
1 deletion
gazebo_grasp_plugin/include/gazebo_grasp_plugin/GazeboGraspFix.h
+
11
−
1
View file @
c79a1912
...
...
@@ -81,9 +81,19 @@ public:
GazeboGraspFix
();
GazeboGraspFix
(
physics
::
ModelPtr
_model
);
virtual
~
GazeboGraspFix
();
/**
* Gets called just after the object has been attached to the link
*/
virtual
void
OnAttach
(
const
std
::
string
&
objectName
){}
/**
* Gets called just after the object has been detached to the link
*/
virtual
void
OnDetach
(
const
std
::
string
&
objectName
){}
private
:
virtual
void
Init
();
virtual
void
Load
(
physics
::
ModelPtr
_parent
,
sdf
::
ElementPtr
_sdf
);
private:
/**
* Collects for each object all forces which are currently applied on it.
* Then, for each object, checks whether of all the forces applied,
...
...
This diff is collapsed.
Click to expand it.
gazebo_grasp_plugin/src/GazeboGraspFix.cpp
+
4
−
0
View file @
c79a1912
...
...
@@ -617,6 +617,7 @@ bool GazeboGraspFix::HandleAttach(const std::string& objName)
}
gazebo
::
math
::
Pose
diff
=
obj
->
GetLink
()
->
GetWorldPose
()
-
this
->
palmLink
->
GetWorldPose
();
this
->
palmLink
->
AttachStaticModel
(
obj
,
diff
);
this
->
OnAttach
(
objName
);
#else
physics
::
CollisionPtr
obj
=
boost
::
dynamic_pointer_cast
<
physics
::
Collision
>
(
this
->
world
->
GetEntity
(
objName
));
if
(
!
obj
.
get
()){
...
...
@@ -633,6 +634,7 @@ bool GazeboGraspFix::HandleAttach(const std::string& objName)
// it, the fingers keep wobbling, which can create difficulties when moving the arm.
obj
->
GetLink
()
->
SetCollideMode
(
"none"
);
}
this
->
OnAttach
(
objName
);
#endif // USE_MODEL_ATTACH
return
true
;
}
...
...
@@ -646,6 +648,7 @@ void GazeboGraspFix::HandleDetach(const std::string& objName)
return
;
}
this
->
palmLink
->
DetachStaticModel
(
objName
);
this
->
OnDetach
(
objName
);
#else
physics
::
CollisionPtr
obj
=
boost
::
dynamic_pointer_cast
<
physics
::
Collision
>
(
this
->
world
->
GetEntity
(
objName
));
if
(
!
obj
.
get
()){
...
...
@@ -657,5 +660,6 @@ void GazeboGraspFix::HandleDetach(const std::string& objName)
obj
->
GetLink
()
->
SetCollideMode
(
"all"
);
}
this
->
fixedJoint
->
Detach
();
this
->
OnDetach
(
objName
);
#endif // USE_MODEL_ATTACH
}
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