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.

IWR6843: Adding lua external modules to extend the automation

Part Number: IWR6843

Hi,

I am creating a set of lua scripts to automate the data capture with various user options. 

I created MyLuaModule.lua as a module and tried to include it as part of my main automation script.

local newModule = require("MyLuaModule")

However, because MyLuaModule.lua is not on the packages path, it cannot be found during execution and I keep getting an error. (Ideally, I would like to keep this module in a folder of my choosing rather than the mmWave Studio path)

I discovered that it is possible to extend the existing package path using the following function, but I think this is a bit dangerous (as it modifies the existing installation) and there should be a higher level of defining additional user pacakage paths without affecting the built in packages.

package.path = package.path .. ";" .. active_script_root .. "?.lua"

Also, if I want to revert the package.path to its original state, how can I achieve this? Is there a configuration file hidden somewhere that I can manually edit to make the changes I need?

Regards,

Cagri

  • Hi, Cagri:

    I just tried to save one lua script in other folder and then direct the fw_path relative to this lua script location.  Then I run this script in the radar studio GUI, and it works fine for me.   Is it something you are looking for?

    Best,

    Zigang

  • Hi Zigang,

    Thanks for your message.

    I am able to run lua scripts from any folder of my choosing as well. There is no issues there.

    I think my problem was related to defininf "packages", which seem to be *.dll files rather than lua scripts. lua scripts seem to be able to include the content of those dll files as packages.

    After writing my message, I explored further and decided to include multiple lua scripts using dofile(<name of lua script>) rather than trying to include them as packages as follows:

    package.path = package.path .. ";" .. <my lua file path> .. "?.lua" .. ";

    I think including lua files as packages overcomplicate things for me and I can live without them.

    We can consider this thread as resolved now.

    Thanks once again!

    Regards,

    Cagri