src/conntact/assembly_tools.py
def vectorRegionCompare(self, input:list, bounds_max:list, bounds_min:list) -> bool:
        """.. vectorRegionCompare Compares an input to boundaries element-wise. Essentially checks whether a vector is within a rectangular region.
        :param input: (list of floats) x,y,z of a vector to check.
        :param bounds_max: (list of floats) x,y,z max value of each element.
        :param bounds_min: (list of floats) x,y,z min value of each element.
        :return: (bool) Whether the vector falls within the region. 
        """
        #Simply compares abs. val.s of input's elements to a vector of maximums and returns whether it exceeds
        #if(symmetrical):
        #    bounds_min[0], bounds_min[1], bounds_min[2] = bounds_max[0] * -1, bounds_max[1] * -1, bounds_max[2] * -1
        #TODO - convert to a process of numpy arrays! They process way faster because that library is written in C++
        #Note - actually Numpy's allclose() method may be perfect here.

        # rospy.logerr("Bounds and stuff: " +str(input) + str(bounds_max) + str(bounds_min))
        if( bounds_max[0] >= input[0] >= bounds_min[0]):
            if( bounds_max[1] >= input[1] >= bounds_min[1]):
                if( bounds_max[2] >= input[2] >= bounds_min[2]):
                    return True
        return False
.. vectorRegionCompare Compares an input to boundaries element-wise. Essentially checks whether a vector is within a rectangular region.
        :param input: (list of floats) x,y,z of a vector to check.
        :param bounds_max: (list of floats) x,y,z max value of each element.
        :param bounds_min: (list of floats) x,y,z min value of each element.
        :return: (bool) Whether the vector falls within the region. 
        
vectorRegionCompare Compares an input to boundaries element-wise. Essentially checks whether a vector is within a rectangular region.
vectorRegionCompare Compares an input to boundaries element - wise . Essentially checks whether a vector is within a rectangular region .
def vectorRegionCompare(self, input:list, bounds_max:list, bounds_min:list) -> bool:
        if( bounds_max[0] >= input[0] >= bounds_min[0]):
            if( bounds_max[1] >= input[1] >= bounds_min[1]):
                if( bounds_max[2] >= input[2] >= bounds_min[2]):
                    return True
        return False
def vectorRegionCompare ( self , input : list , bounds_max : list , bounds_min : list ) -> bool : if ( bounds_max [ 0 ] >= input [ 0 ] >= bounds_min [ 0 ] ) : if ( bounds_max [ 1 ] >= input [ 1 ] >= bounds_min [ 1 ] ) : if ( bounds_max [ 2 ] >= input [ 2 ] >= bounds_min [ 2 ] ) : return True return False
.. vectorRegionCompare Compares an input to boundaries element-wise.
.. vectorRegionCompare Compares an input to boundaries element - wise .
""".. vectorRegionCompare Compares an input to boundaries element-wise. Essentially checks whether a vector is within a rectangular region.
        :param input: (list of floats) x,y,z of a vector to check.
        :param bounds_max: (list of floats) x,y,z max value of each element.
        :param bounds_min: (list of floats) x,y,z min value of each element.
        :return: (bool) Whether the vector falls within the region. 
        """ #Simply compares abs. val.s of input's elements to a vector of maximums and returns whether it exceeds #if(symmetrical): #    bounds_min[0], bounds_min[1], bounds_min[2] = bounds_max[0] * -1, bounds_max[1] * -1, bounds_max[2] * -1 #TODO - convert to a process of numpy arrays! They process way faster because that library is written in C++ #Note - actually Numpy's allclose() method may be perfect here. # rospy.logerr("Bounds and stuff: " +str(input) + str(bounds_max) + str(bounds_min))
(bool) Whether the vector falls within the region.
( bool ) Whether the vector falls within the region .
self
input
list
(list of floats) x,y,z of a vector to check.
( list of floats ) x y z of a vector to check .
bounds_max
list
(list of floats) x,y,z max value of each element.
( list of floats ) x y z max value of each element .
bounds_min
list
(list of floats) x,y,z min value of each element.
( list of floats ) x y z min value of each element .