Update, the sobelEdgeDetection example ran fine. It uses a slightly different "cfg" object description and declared build directory. It doesn't use the CustomInclude or CustomSource fields.
Made changes to the liveCapture.m and codegen to emulate the sobelEdgeDetection example and it worked just fine:
function liveCapture() %#codegen
% Copyright 2018-2020 The MathWorks, Inc.
hwobj = jetson;
camObj = camera(hwobj,"vi-output, imx219 8-0010",[1280 720]);
dispObj = imageDisplay(hwobj);
% Main loop
for k = 1:10000
% Capture the image from the camera on hardware.
img = snapshot(camObj);
% Display image.
image(dispObj,img);
end
end
With the codegen:
%% Setup
disp('Building cfg object....')
cfg = coder.gpuConfig('exe');
cfg.Hardware = coder.hardware('NVIDIA Jetson');
cfg.Hardware.BuildDir = '~/remoteBuildDir';
cfg.GenerateExampleMain = 'GenerateCodeAndCompile';
disp('...done with cfg object')
%% compile
disp('Starting codegen....')
% codegen -config cfg liveCapture %from example on site
codegen('-config ',cfg,'liveCapture','-report');
disp('...completed codegen')
%% Run on Target
hwobj.setDisplayEnvironment('1.0');
pid = runApplication(hwobj,'liveCapture');