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,19 +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 = 2. ,
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.
252
256
253
- The maximum distance defaults to a value that is higher than the size
254
- of the reachable workspace of the WAM, which is roughly a sphere with a
255
- radius of one meter. This means that, by default, the arm will move as
256
- far as possible while obeying the straight-line constraint.
257
-
258
257
@param direction unit vector for the direction of motion in the world frame
259
258
@param distance minimum distance in meters
260
259
@param max_distance maximum distance in meters
@@ -265,6 +264,13 @@ def MoveUntilTouch(manipulator, direction, distance, max_distance=2.,
265
264
@return felt_force flag indicating whether we felt a force.
266
265
"""
267
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
+
268
274
# TODO: Is ignore_collisions a list of names or KinBody pointers?
269
275
if max_torque is None :
270
276
max_torque = numpy .array ([100.0 , 100.0 , 100.0 ])
0 commit comments