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
33
34
import warnings
36
37
from .. import util
37
38
from .. import exceptions
38
39
40
+ logger = logging .getLogger ('wam' )
41
+
39
42
class WAM (Manipulator ):
40
43
def __init__ (self , sim , owd_namespace ,
41
44
iktype = openravepy .IkParameterization .Type .Transform6D ):
@@ -219,13 +222,14 @@ def ClearTrajectoryStatus(manipulator):
219
222
if not manipulator .simulated :
220
223
manipulator .controller .SendCommand ('ClearStatus' )
221
224
222
- def MoveUntilTouch (manipulator , direction , distance , max_distance = float ( '+inf' ) ,
225
+ def MoveUntilTouch (manipulator , direction , distance , max_distance = None ,
223
226
max_force = 5.0 , max_torque = None , ignore_collisions = None , ** kw_args ):
224
227
"""Execute a straight move-until-touch action.
225
228
This action stops when a sufficient force is is felt or the manipulator
226
229
moves the maximum distance. The motion is considered successful if the
227
230
end-effector moves at least distance. In simulation, a move-until-touch
228
231
action proceeds until the end-effector collids with the environment.
232
+
229
233
@param direction unit vector for the direction of motion in the world frame
230
234
@param distance minimum distance in meters
231
235
@param max_distance maximum distance in meters
@@ -235,6 +239,14 @@ def MoveUntilTouch(manipulator, direction, distance, max_distance=float('+inf'),
235
239
@param **kw_args planner parameters
236
240
@return felt_force flag indicating whether we felt a force.
237
241
"""
242
+
243
+ if max_distance is None :
244
+ max_distance = 1.
245
+ warnings .warn (
246
+ 'MoveUntilTouch now requires the "max_distance" argument.'
247
+ ' This will be an error in the future.' ,
248
+ DeprecationWarning )
249
+
238
250
# TODO: Is ignore_collisions a list of names or KinBody pointers?
239
251
if max_torque is None :
240
252
max_torque = numpy .array ([100.0 , 100.0 , 100.0 ])
0 commit comments