Skip to content

Commit b98b65c

Browse files
committed
Merge pull request #175 from personalrobotics/bugfix/172
Deprecated the GetVelocityLimits override on WAM.
2 parents 587c9c0 + 8b69fe2 commit b98b65c

File tree

1 file changed

+7
-31
lines changed

1 file changed

+7
-31
lines changed

src/prpy/base/wam.py

Lines changed: 7 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ def ServoTo(manipulator, target, duration, timeStep=0.05, collisionChecking=True
165165
else:
166166
return False
167167

168-
def GetVelocityLimits(self, openrave=True, owd=True):
168+
def GetVelocityLimits(self, openrave=None, owd=None):
169169
"""Get the OpenRAVE and OWD joint velocity limits.
170170
This function checks both the OpenRAVE and OWD joint velocity limits.
171171
If they do not match, a warning is printed and the minimum value is
@@ -174,37 +174,13 @@ def GetVelocityLimits(self, openrave=True, owd=True):
174174
@param owd flag to set the OWD velocity limits
175175
@return list of velocity limits, in radians per second
176176
"""
177-
# Update the OpenRAVE limits.
178-
if openrave:
179-
or_velocity_limits = Manipulator.GetVelocityLimits(self)
180-
if self.simulated or not owd:
181-
return or_velocity_limits
182-
183-
# Update the OWD limits.
184-
if owd and not self.simulated:
185-
args = [ 'GetSpeed' ]
186-
args_str = ' '.join(args)
187-
owd_speed_limits_all = self.controller.SendCommand(args_str)
188-
#if we get nothing back, e.g. if the arm isn't running, return openrave lims
189-
if owd_speed_limits_all is None:
190-
return or_velocity_limits
191-
192-
owd_speed_limits = map(float, owd_speed_limits_all.split(','));
193-
#first 7 numbers are velocity limits
194-
owd_velocity_limits = numpy.array(owd_speed_limits[0:len(self.GetIndices())])
195-
196-
diff_arr = numpy.subtract(or_velocity_limits, owd_velocity_limits)
197-
max_diff = max(abs(diff_arr))
198-
199-
if max_diff > 0.01:
200-
# TODO: Change this to use the logging framework.
201-
print('GetVelocityLimits Error: openrave and owd limits very different')
202-
print('\tOpenrave limits:\t' + str(or_velocity_limits))
203-
print('\tOWD limits:\t\t' + str(owd_velocity_limits))
204-
205-
return numpy.minimum(or_velocity_limits, owd_velocity_limits)
177+
if openrave is not None or owd is not None:
178+
warnings.warn(
179+
'The "openrave" and "owd" flags are deprecated in'
180+
' GetVelocityLimits and will be removed in a future version.',
181+
DeprecationWarning)
206182

207-
return or_velocity_limits
183+
return Manipulator.GetVelocityLimits(self)
208184

209185
def SetVelocityLimits(self, velocity_limits, min_accel_time,
210186
openrave=True, owd=True):

0 commit comments

Comments
 (0)