|
@@ -3,39 +3,17 @@
|
|
|
"""
|
|
|
gripper_controller - action based controller for grippers.
|
|
|
Copyright (c) 2011-2014 Vanadium Labs LLC. All right reserved.
|
|
|
-
|
|
|
- Redistribution and use in source and binary forms, with or without
|
|
|
- modification, are permitted provided that the following conditions are met:
|
|
|
- * Redistributions of source code must retain the above copyright
|
|
|
- notice, this list of conditions and the following disclaimer.
|
|
|
- * Redistributions in binary form must reproduce the above copyright
|
|
|
- notice, this list of conditions and the following disclaimer in the
|
|
|
- documentation and/or other materials provided with the distribution.
|
|
|
- * Neither the name of Vanadium Labs LLC nor the names of its
|
|
|
- contributors may be used to endorse or promote products derived
|
|
|
- from this software without specific prior written permission.
|
|
|
-
|
|
|
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
|
|
- ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
|
|
- WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
|
|
- DISCLAIMED. IN NO EVENT SHALL VANADIUM LABS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
|
|
|
- INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
|
|
- LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
|
|
|
- OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
|
|
- LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
|
|
|
- OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
|
|
|
- ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
|
"""
|
|
|
|
|
|
import rospy, actionlib
|
|
|
import thread
|
|
|
|
|
|
+from parallel_convert import ParallelConvert
|
|
|
from control_msgs.msg import GripperCommandAction
|
|
|
from sensor_msgs.msg import JointState
|
|
|
from std_msgs.msg import Float64
|
|
|
from math import asin, sin
|
|
|
from multiprocessing import Lock
|
|
|
-from arbotix_python.parallel_convert import *
|
|
|
|
|
|
|
|
|
class GripperModel:
|
|
@@ -151,8 +129,6 @@ class TrapezoidGripperModel(GripperModel):
|
|
|
|
|
|
class ParallelGripperModel(GripperModel):
|
|
|
# One servo to open/close parallel jaws, typically via linkage.
|
|
|
- # TODO - currently we only show one finger, and report twice the distance. Opening
|
|
|
- # reports correct width but center is not correct
|
|
|
def __init__(self):
|
|
|
GripperModel.__init__(self)
|
|
|
self.convertor = ParallelConvert(self.joint)
|
|
@@ -189,9 +165,7 @@ class GripperActionController:
|
|
|
rospy.logerr('no model specified, exiting')
|
|
|
exit()
|
|
|
|
|
|
- if model == 'dualservo':
|
|
|
- self.model = TrapezoidGripperModel()
|
|
|
- elif model == 'parallel':
|
|
|
+ if model == 'parallel':
|
|
|
self.model = ParallelGripperModel()
|
|
|
elif model == 'singlesided':
|
|
|
self.model = OneSideGripperModel()
|