Ejemplo n.º 1
0
class TestPyCodeletStatus(unittest.TestCase):
    '''
    Test loading subgraph via the application API
    '''
    @classmethod
    def setUpClass(cls):
        # method will be ran once before any test is ran
        pass

    @classmethod
    def tearDownClass(cls):
        # method will be ran once after all tests have run
        pass

    def setUp(self):
        # ran before each test
        return super().setUp()

    def tearDown(self):
        # ran after each test
        return super().tearDown()

    def test_report_status(self):
        self._app = Application()
        self._app.add('success')
        self._app.add('failure')

        node_success = self._app.nodes['success']
        self.assertIsNotNone(node_success)
        component = node_success.add(self._app.registry.isaac.alice.PyCodelet)
        self.assertIsNotNone(component)

        node_failure = self._app.nodes['failure']
        self.assertIsNotNone(node_failure)
        component = node_failure.add(self._app.registry.isaac.alice.PyCodelet)
        self.assertIsNotNone(component)

        self._app.nodes['success'].add(AlwaysSucceedCodelet)
        self._app.nodes['failure'].add(AlwaysFailureCodelet)

        self._app.start_wait_stop(1.5)

        self.assertEqual(node_success.status, Status.Success)
        self.assertEqual(node_failure.status, Status.Failure)
distribution of this software and related documentation without an express
license agreement from NVIDIA CORPORATION is strictly prohibited.
'''
from isaac import Application
import argparse

if __name__ == '__main__':
    parser = argparse.ArgumentParser(description='Measures recording performance')
    args = parser.parse_args()

    app = Application(name="write_speed_test", modules=[
        "message_generators",
        "cask",
        "sight",
    ])

    img_gen_node = app.add("img_gen")
    img_gen = img_gen_node.add(app.registry.isaac.message_generators.CameraGenerator)
    img_gen.config.rows = 720
    img_gen.config.cols = 1080
    img_gen.config.tick_period = "15 Hz"

    recorder_node = app.add("recorder")
    recorder = recorder_node.add(app.registry.isaac.cask.Recorder)
    recorder.config.use_compression = True

    app.connect(img_gen, "color_left", recorder, "img1")
    app.connect(img_gen, "color_right", recorder, "img2")

    app.start_wait_stop(duration=10.0)