A Hello World Component

Use the following procedure to create a simple component that prints hello world to the terminal upon startup.

  1. Create a new REDHAWK component Project:
  1. Name the project: HelloWorld

  2. Click Next.

  3. Select:
  1. Click Next.

  2. Click Finish.
  1. Generate Code:
  1. In the HelloWorld.cpp file, add the following include to the beginning of the file:

    #include <iostream>
  2. In the HelloWorld.cpp file, add the following code to the serviceFunction() method:

    std::cout << "Hello world" << std::endl;
  3. Compile the project:
  1. Drag the project to the Target SDR section of the REDHAWK Explorer.

  2. On a terminal, start a Python session.

  3. Run the following commands:

    >>> from ossie.utils import sb
    >>> hello_world = sb.launch("HelloWorld")
    >>> sb.start()