Example #1
0
    def test_above_outside_threshold(self):
        object_pose = Pose()
        object_pose.position.x = 0.0
        object_pose.position.y = 0.0
        object_pose.position.z = 5.0
        object_pose.orientation.x = 0.0
        object_pose.orientation.y = 0.0
        object_pose.orientation.z = 0.0
        object_pose.orientation.w = 1.0

        reference_height = 2.0
        threshold_distance = 3.0

        result = height(object_pose, reference_height, threshold_distance)
        self.assertEquals(result, 1)
Example #2
0
    def test_below_outside_threshold_y_axis(self):
        object_pose = Pose()
        object_pose.position.x = 0.0
        object_pose.position.y = 5.0
        object_pose.position.z = 0.0
        object_pose.orientation.x = 0.0
        object_pose.orientation.y = 0.0
        object_pose.orientation.z = 0.0
        object_pose.orientation.w = 1.0

        reference_height = -1.0
        threshold_distance = 2.0

        result = height(object_pose,
                        reference_height,
                        threshold_distance,
                        axis='y')
        self.assertEquals(result, 1)
Example #3
0
    def test_above_within_threshold_y_axis(self):
        object_pose = Pose()
        object_pose.position.x = 0.0
        object_pose.position.y = 3.0
        object_pose.position.z = 0.0
        object_pose.orientation.x = 0.0
        object_pose.orientation.y = 0.0
        object_pose.orientation.z = 0.0
        object_pose.orientation.w = 1.0

        reference_height = 1.0
        threshold_distance = 4.0

        result = height(object_pose,
                        reference_height,
                        threshold_distance,
                        axis='y')
        self.assertEquals(result, 0)
Example #4
0
    def test_below_outside_threshold(self):
        object_pose = Pose()
        object_pose.position.x = 0.0
        object_pose.position.y = 0.0
        object_pose.position.z = -5.0
        object_pose.orientation.x = 0.0
        object_pose.orientation.y = 0.0
        object_pose.orientation.z = 0.0
        object_pose.orientation.w = 1.0

        reference_height = -1.0
        threshold_distance = 2.0

        result = height(object_pose,
                        reference_height,
                        threshold_distance,
                        direction="negative")
        self.assertEquals(result, 1)
Example #5
0
    def test_below_within_threshold_x_axis(self):
        object_pose = Pose()
        object_pose.position.x = -2.0
        object_pose.position.y = 0.0
        object_pose.position.z = 0.0
        object_pose.orientation.x = 0.0
        object_pose.orientation.y = 0.0
        object_pose.orientation.z = 0.0
        object_pose.orientation.w = 1.0

        reference_height = -1.0
        threshold_distance = 4.0

        result = height(object_pose,
                        reference_height,
                        threshold_distance,
                        direction="negative",
                        axis='x')
        self.assertEquals(result, 0)