Modify the system to start a custom application

The provided reference image on this board only starts the Sensor service.

The Robot OS and Sensor examples aren't good applications to run from startup since it writes output to the console. If you want to start an application when you boot, you'll need to create your own application, which we'll refer to as mycustom_example. You can use an existing SLM and sensor configuration files once you have uploaded your application to the Car Creek MRB to start your application. The following steps provides an overview of how to modify an existing configuration file to start your custom application:

  1. On your target, copy of the SLM configuration file that uses the sensor configuration file that matches the sensors and cameras connected to your board to slm-config-platform.xml. If you decide to create a custom configuration file, you must start the Sensor service with the name of the configuration file you created. See the Configure sensors and cameras on the reference image section in this chapter for more information. For example, if you created an application to use the a single camera, you can make a copy of slm-config-platform-single-cam.xml.
    # cp slm-config-platform-single-cam.xml
         slm-config-platform.xml
  2. Open the slm-config-platform.xml file on the target using vi. Alternatively, you can also modify the configuration file if you're connected using the QNX Momentics IDE.
  3. Add an entry to the slm-config-platform.xml file that represents your component called mycustom_component as shown below. This component specifies the binary to start your application on the board, which is called mycustom_example. Your new component should depend on the sensor component.
    ....
    <SLM:component name="sensor">
            <SLM:command>/base/bin/sensor</SLM:command>
            <SLM:args>-b Denverton -U 521:521,1001 -r /accounts/1000/shared/sensor 
                      -c /base/etc/system/config/usb_camera.conf</SLM:args>
    	<SLM:depend>resarb</SLM:depend>
    	<SLM:depend>screen-ready</SLM:depend>
        </SLM:component>
    
    ...
    ...
    <SLM:component name="mycustom_component">
            <SLM:command>/base/usr/bin/mycustom_example</SLM:command>
        <SLM:depend>sensor</SLM:depend>
        <SLM:stop stop="signal">SIGTERM</SLM:stop>
    </SLM:component>
    ...
    ...
    Note: In this case, there are no parameters required for the binary called mycustom_example.