intera_interface/src/intera_interface/limb.py
def move_to_joint_positions(self, positions, timeout=15.0,
                                threshold=settings.JOINT_ANGLE_TOLERANCE,
                                test=None):
        """
        (Blocking) Commands the limb to the provided positions.

        Waits until the reported joint state matches that specified.

        This function uses a low-pass filter to smooth the movement.

        @type positions: dict({str:float})
        @param positions: joint_name:angle command
        @type timeout: float
        @param timeout: seconds to wait for move to finish [15]
        @type threshold: float
        @param threshold: position threshold in radians across each joint when
        move is considered successful [0.008726646]
        @param test: optional function returning True if motion must be aborted
        """
        cmd = self.joint_angles()

        def genf(joint, angle):
            def joint_diff():
                return abs(angle - self._joint_angle[joint])
            return joint_diff

        diffs = [genf(j, a) for j, a in positions.items() if
                 j in self._joint_angle]
        fail_msg = "{0} limb failed to reach commanded joint positions.".format(
                                                      self.name.capitalize())
        def test_collision():
            if self.has_collided():
                rospy.logerr(' '.join(["Collision detected.", fail_msg]))
                return True
            return False
        self.set_joint_positions(positions)
        intera_dataflow.wait_for(
            test=lambda: test_collision() or \
                         (callable(test) and test() == True) or \
                         (all(diff() < threshold for diff in diffs)),
            timeout=timeout,
            timeout_msg=fail_msg,
            rate=100,
            raise_on_error=False,
            body=lambda: self.set_joint_positions(positions)
            )

        (Blocking) Commands the limb to the provided positions.

        Waits until the reported joint state matches that specified.

        This function uses a low-pass filter to smooth the movement.

        @type positions: dict({str:float})
        @param positions: joint_name:angle command
        @type timeout: float
        @param timeout: seconds to wait for move to finish [15]
        @type threshold: float
        @param threshold: position threshold in radians across each joint when
        move is considered successful [0.008726646]
        @param test: optional function returning True if motion must be aborted
        
(Blocking) Commands the limb to the provided positions.
Waits until the reported joint state matches that specified.

This function uses a low-pass filter to smooth the movement.
( Blocking ) Commands the limb to the provided positions . Waits until the reported joint state matches that specified . This function uses a low - pass filter to smooth the movement .
def move_to_joint_positions(self, positions, timeout=15.0,
                                threshold=settings.JOINT_ANGLE_TOLERANCE,
                                test=None):
        cmd = self.joint_angles()
        def genf(joint, angle):
            def joint_diff():
                return abs(angle - self._joint_angle[joint])
            return joint_diff
        diffs = [genf(j, a) for j, a in positions.items() if
                 j in self._joint_angle]
        fail_msg = "{0} limb failed to reach commanded joint positions.".format(
                                                      self.name.capitalize())
        def test_collision():
            if self.has_collided():
                rospy.logerr(' '.join(["Collision detected.", fail_msg]))
                return True
            return False
        self.set_joint_positions(positions)
        intera_dataflow.wait_for(
            test=lambda: test_collision() or \
                         (callable(test) and test() == True) or \
                         (all(diff() < threshold for diff in diffs)),
            timeout=timeout,
            timeout_msg=fail_msg,
            rate=100,
            raise_on_error=False,
            body=lambda: self.set_joint_positions(positions)
            )
def move_to_joint_positions ( self , positions , timeout = 15.0 , threshold = settings . JOINT_ANGLE_TOLERANCE , test = None ) : cmd = self . joint_angles ( ) def genf ( joint , angle ) : def joint_diff ( ) : return abs ( angle - self . _joint_angle [ joint ] ) return joint_diff diffs = [ genf ( j , a ) for j , a in positions . items ( ) if j in self . _joint_angle ] fail_msg = "{0} limb failed to reach commanded joint positions." . format ( self . name . capitalize ( ) ) def test_collision ( ) : if self . has_collided ( ) : rospy . logerr ( ' ' . join ( [ "Collision detected." , fail_msg ] ) ) return True return False self . set_joint_positions ( positions ) intera_dataflow . wait_for ( test = lambda : test_collision ( ) or ( callable ( test ) and test ( ) == True ) or ( all ( diff ( ) < threshold for diff in diffs ) ) , timeout = timeout , timeout_msg = fail_msg , rate = 100 , raise_on_error = False , body = lambda : self . set_joint_positions ( positions ) )
(Blocking) Commands the limb to the provided positions.
( Blocking ) Commands the limb to the provided positions .
"""
        (Blocking) Commands the limb to the provided positions.

        Waits until the reported joint state matches that specified.

        This function uses a low-pass filter to smooth the movement.

        @type positions: dict({str:float})
        @param positions: joint_name:angle command
        @type timeout: float
        @param timeout: seconds to wait for move to finish [15]
        @type threshold: float
        @param threshold: position threshold in radians across each joint when
        move is considered successful [0.008726646]
        @param test: optional function returning True if motion must be aborted
        """
self
positions
None
timeout
seconds to wait for move to finish [15]
seconds to wait for move to finish [ 15 ]
threshold
position threshold in radians across each joint when
move is considered successful [0.008726646]
position threshold in radians across each joint when move is considered successful [ 0 . 008726646 ]
test
optional function returning True if motion must be aborted
optional function returning True if motion must be aborted