28
28
# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
29
29
# POSSIBILITY OF SUCH DAMAGE.
30
30
31
+ import logging
31
32
import numpy
32
33
import openravepy
34
+ import warnings
33
35
from manipulator import Manipulator
34
36
from prpy .clone import Clone
35
37
from .. import util
36
38
from .. import exceptions
37
39
40
+ logger = logging .getLogger ('wam' )
41
+
38
42
class WAM (Manipulator ):
39
43
def __init__ (self , sim , owd_namespace ,
40
44
iktype = openravepy .IkParameterization .Type .Transform6D ):
@@ -242,13 +246,14 @@ def ClearTrajectoryStatus(manipulator):
242
246
if not manipulator .simulated :
243
247
manipulator .controller .SendCommand ('ClearStatus' )
244
248
245
- def MoveUntilTouch (manipulator , direction , distance , max_distance = float ( '+inf' ) ,
249
+ def MoveUntilTouch (manipulator , direction , distance , max_distance = None ,
246
250
max_force = 5.0 , max_torque = None , ignore_collisions = None , ** kw_args ):
247
251
"""Execute a straight move-until-touch action.
248
252
This action stops when a sufficient force is is felt or the manipulator
249
253
moves the maximum distance. The motion is considered successful if the
250
254
end-effector moves at least distance. In simulation, a move-until-touch
251
255
action proceeds until the end-effector collids with the environment.
256
+
252
257
@param direction unit vector for the direction of motion in the world frame
253
258
@param distance minimum distance in meters
254
259
@param max_distance maximum distance in meters
@@ -258,6 +263,14 @@ def MoveUntilTouch(manipulator, direction, distance, max_distance=float('+inf'),
258
263
@param **kw_args planner parameters
259
264
@return felt_force flag indicating whether we felt a force.
260
265
"""
266
+
267
+ if max_distance is None :
268
+ max_distance = 1.
269
+ warnings .warn (
270
+ 'MoveUntilTouch now requires the "max_distance" argument.'
271
+ ' This will be an error in the future.' ,
272
+ DeprecationWarning )
273
+
261
274
# TODO: Is ignore_collisions a list of names or KinBody pointers?
262
275
if max_torque is None :
263
276
max_torque = numpy .array ([100.0 , 100.0 , 100.0 ])
0 commit comments