This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

AWR1642BOOST: Increasing the number of zones in Occupancy Detection demo

Part Number: AWR1642BOOST

Hello,

Can someone advise me what changes are required in the application,Matlab script and configuration files to make the number of occupancy zones into 4.

Regards,

Abit

  • Abit,

    I have referred your question to our occupancy detection demo expert. Please allow some time for a response.

    Regards,
    Kyle
  • Hi Abit,

    As I mentioned on the phone, this will require running the "feature" and "decision" algorithms over pairs of zones, since they were designed to run on a pair of zones.  I have made most of the software changes for to create 3 pairs of zones, and have it running in the GUI.  The only thing remaining is to expand the CLI interface to accept 3 sets of coefficients, then do the training required for the new zones.  Currently all 3 zone pairs are running with the same coefficients, so they aren't quite as reliable yet as the first two zones.

    I should be able to get this to you in a few days. You will need to do your own training, because I probably won't be able to get to that for a while.  The 6 zones I have defined look like this:

    The corresponding zone definition is this:

    zoneDef 6 16 16 8 15 16 16 26 15 37 15 6 11 37 15 31 11 37 15 19 10 55 4 6 36

    In the meantime, if you wanted to try doing training, follow the procedure listed in the user guide using the following two sets of zones.  Of course, you may want adjust the zone placement first, this is a generic configuration.  Unless you change the first two zones, you shouldn't have to re-train them, though it is not a bad idea when running in a new environment (ie. a different car).

    zoneDef 2 37 15 6 11 37 15 31 11 (2nd zone pair - 1st and 3rd zones on the second row)

    zoneDef 2 37 15 19 10 55 4 6 36  (3rd zone pair - middle zone on second row and third row zone)

      -dave

  • Thank you so much Dave.

    For the training, I recorded some data using the Record widget in the GUI and I could open the recorded files (log_001.mat,log_002.mat etc.) using Matlab. But I don't know how to identify brightspot from this data.In 'rangeAzimuth_log' matrix (when open with Matlab) I assume each column refers to a frame.There are 3072 rows in each column. How to identify a physical spot from these values?
  • Hi Abit,

    You shouldn't need to open these files, other than with the tools. When you run the gui to collect the data, you should use one of the two pairs of zone definitions from above: (or your updated zone defs)

    zoneDef 2 37 15 6 11 37 15 31 11 (2nd zone pair - 1st and 3rd zones on the second row)

    The Matlab gui will then show you the heatmap and these zone definitions, so you can center a person in each occupied zone prior to starting recording. Or are you trying to do something else with the files? Each "row" should be a 48x64 cell heatmap.

    - dave
  • Hi Dave,

    Thank you. I was referring and following a guide (in the resource explorer) to set up Zone Definitions manually. So I was looking (in the recorded data) for where bright spots occur when the zones are occupied.

    Regards,
    Abit
  • Ah, I see. It is much easier to simply run the demo and have a person sit in a zone. Then adjust the zone definition and restart the demo until you're satisfied with it. Try to leave a few low-power cells surrounding the bright spot inside the zone, or at least a few cells in between zones, so that the bright spot doesn't inadvertently trigger a neighboring cell.

    -dave
  • Thank you so much, Dave.

    Would you be able to share the updated codes (with 6 zones), please?

    Regards,
    Abit
  • Yes, please contact Chris, I've given him an internal link to the zip file.

    -dave
  • Thank you so much, Dave.

  • Hi Dave,

    Thank you. I got the zip file from Chris.

    It seems not working on the board as the board that we have is ES1.0.

    Can you please advise on how can I make it compatible with ES1.0?

    Regards,
    Abit

  • Hi Abit,

    >Can you please advise on how can I make it compatible with ES1.0?

    The mmWave SDK for 2.0 has different APIs, so you can't just recompile with it unfortunately.  The easiest way would be to compare the demo project source for the 1.0 2-zone demo and the one that I provided, and copy the changes related to 6 zones into the 1.0 demo.

    A better solution is to get a 2.0 EVM if at all possible.

      -dave

  • Hi Dave,

    Thank you.

    Does Matlab GUI has SDK dependency? Can I use the same Matlab GUI script for ES1.0 and ES 2.0?

    Regards,

    Abit

  • Hi Abit,

    No, there is no dependency of the GUI on the SDK.  There is a simple profile change though.  The second parameter of the lowPower command should be 1 for ES 2, and 0 for ES 1.

      -dave

  • Hi Dave,

    Thank you so much for your help.

    I compared and updated the code in Automotive toolbox 1_2 for ES01 and it is working.

    However, I'm getting the following error in Matlab, when Decision Source is selected as Matlab:

    Matrix dimensions must agree.

    Error in od_demo>zone_occupDetect (line 1102)
    featureVec = (featureVec - meanVector) ./ stdVector;

    Error in od_demo (line 373)
    [decisionValue, featureVec] = zone_occupDetect(rangeAzimuth, coeffMatrix, meanVector,... 


    Could you please advise ?

    Regards,
    Abit

  • Hi Abit,

    That part of the code hasn't been updated yet.  The "per zone" commands are now prefaced with a "zone pair" parameter, and saved in the parseCfg function like this:

            elseif strcmp(C{1},'meanVector')
                pair = str2num(C{2}) + 1;
                P.meanVector =  [pair, str2num(C{3}), str2num(C{4}), str2num(C{5}), str2num(C{6}), str2num(C{7})];

    Which means that the following code needs to run inside a loop over the zone pairs:

    % features: power ratio in dB
    pwrRatio = avgPwr / sum(avgPwr);
    pwrRatiodB = 10*log10(pwrRatio);

    % features: correlation coefficient between pairs
    corrCoeff = corrcoef(zonePwrdB(winIdx, :));
    xcorrCoeff = corrCoeff(1, 2);

    % form the feature vector
    featureVec = [avgPwrdB, pwrRatiodB, xcorrCoeff]; % 1 x 5 for two zones

    % normalize and add one
    featureVec = (featureVec - meanVector) ./ stdVector;
    featureVec_ = [1, featureVec].'; % now column vector

    % occupancy detection
    prob = sigmoid(coeffMatrix * featureVec_);
    [~, class_predict] = max(prob);
    class_predict = class_predict - 1;
    occupVec = de2bi(class_predict, numZones);

    I will get to this in the next week or so.

     -dave

  • Thank you so much for your help, Dave.