Updated: April 19, 2023 |
Use slm in the Sensor Framework for QNX SDP to modify the launch order of applications and services without rebuilding the target image.
For more information about how to use SLM, see slm in the Utilities Reference.
The Sensor Framework uses multiple SLM configuration files to manage dependencies between processes, commands for launching processes, and other properties.
The following default files are included:
% mount -uw /base % cp /base/etc/my-slm-config.xml /base/etc/slm-config-platform.xmlwhere my-slm-config.xml is the name of the SLM configuration file that you want to use.
Updated: April 19, 2023 |
This example describes how to set up a SLM file to use a file camera immediately after the target boots.
To use this configuration, you must ensure that you have a file camera specified in the sensor configuration file. For example:
... begin SENSOR_UNIT_1 type = file_camera address = /usr/share/videos/adas_example.mp4 playback_group = 1 name = front-camera direction = 0,0,0 position = 0,0,800 end SENSOR_UNIT_1 ...
For more information, see the Example: Sensor configuration file for file camera section.
To configure your SLM configuration file for a file camera, here's what you need to do:
The resarb component must start before the sensor component. The resarb component is used to permit arbitration of resources so that multiple processes can access the same resource. The sensor component requires this arbitration as a dependency when you're using file cameras.
In general, the resarb component must be started, but it's not required as an explicit dependency for the sensor component for other sensors and cameras.
For example, start the sensor component with a dependency to wait until the screen_ready component comes up.
Your SLM configuration should include components as follows:
<SLM:system xmlns:SLM="SLM"> ... <SLM:component name="screen-ready"> <SLM:command launch="builtin">no_op</SLM:command> <SLM:waitfor wait="pathname">/dev/screen</SLM:waitfor> </SLM:component> ... <SLM:component name="resarb"> <SLM:command>/base/bin/resarb</SLM:command> <SLM:stop stop="signal">SIGTERM</SLM:stop> </SLM:component> ... <SLM:component name="sensor"> <SLM:command>/base/bin/sensor</SLM:command> <SLM:args>-U 521:521,1001 -r /accounts/1000/shared/camera -c /base/etc/system/config/adas_example_capture.conf</SLM:args> <SLM:depend>resarb</SLM:depend> <SLM:depend>screen-ready</SLM:depend> </SLM:component> ... <SLM:component name="adas_example"> <SLM:command>/base/usr/bin/adas_example</SLM:command> <SLM:args>-pointcloud</SLM:args> <SLM:depend>sensor</SLM:depend> <SLM:stop stop="signal">SIGTERM</SLM:stop> </SLM:component> ... </SLM:system>
If your application uses other sensors, in addition to a file camera, more components and dependencies than what's shown here may be required in the SLM configuration file.
Updated: April 19, 2023 |
This example describes how to set up a SLM file to use a USB camera immediately after the target boots.
For this configuration, you must ensure that you have a USB camera configured in the sensor configuration file. For example:
begin SENSOR_UNIT_1 type = usb_camera usb_driver_path = /dev/usb/io-usb-otg name = front-camera position = 0, 0, 0 direction = 0, 0, 1 address = -1, -1, -1, -1 end SENSOR_UNIT_1
For more information, see the Example: Sensor configuration file for USB camera section.
For a USB camera to start immediately after the board boots, the USB driver must start before the Sensor service. If the USB driver isn't already part of your IFS image, you need to start the USB driver in your SLM configuration and have the Sensor service depend on it. For example, you would specify that the sensor component depends on the usb component.
If you aren't using a USB camera, you don't need to set up a dependency on the usb component in your SLM configuration file.
For example, start the sensor component with a dependency to wait until the screen_ready component comes up.
Your SLM configuration should include components as follows:
<SLM:system xmlns:SLM="SLM"> ... <SLM:component name="screen-ready"> <SLM:command launch="builtin">no_op</SLM:command> <SLM:waitfor wait="pathname">/dev/screen</SLM:waitfor> </SLM:component> ... <!-- Include a usb component to start the USB driver using SLM if the USB driver isn't already part of your IFS image. --> <SLM:component name="usb"> <SLM:command>io-usb-otg</SLM:command> <SLM:args>-n /dev/usb/io-usb-otg -d hcd-xhci</SLM:args> </SLM:component> ... <SLM:component name="resarb"> <SLM:command>/base/bin/resarb</SLM:command> <SLM:stop stop="signal">SIGTERM</SLM:stop> </SLM:component> ... <SLM:component name="sensor"> <SLM:command>/base/bin/sensor</SLM:command> <SLM:args>-U 521:521,1001 -r /accounts/1000/shared/camera -c /base/etc/system/config/usb_camera.conf</SLM:args> <!-- Add a dependency on the usb component if you are starting the USB driver through SLM. --> <SLM:depend>usb</SLM:depend> <SLM:depend>screen-ready</SLM:depend> </SLM:component> ... <SLM:component name="adas_example"> <SLM:command>/base/usr/bin/adas_example</SLM:command> <SLM:args>-pointcloud</SLM:args> <SLM:depend>sensor</SLM:depend> <SLM:stop stop="signal">SIGTERM</SLM:stop> </SLM:component> ... </SLM:system>
If your application uses other sensors, in addition to a USB camera, more components and dependencies than what's shown here may be required in the SLM configuration file.