afrl-rq / OpenUxAS

Project for multi-UAV cooperative decision making
Other
50 stars 24 forks source link

Update infrastructure and run_lmcgen #59

Closed manthonyaiello closed 2 years ago

manthonyaiello commented 2 years ago

Fix Issues #45 and #44

This commit makes a number of improvements.

  1. Update paths.sh to allow env overrides

Previously, paths.sh set path variables without checking to see if they had already been set by the user. This is now fixed: if the variable is already set, that value will be used. Otherwise, the default value will be used.

This will allow the user to more easily steer the behavior of the infrastructure (although care must be taken to ensure that values provided in the environment make sense).

  1. Update paths.py with docstrings and to match paths.sh

  2. Update run_example.py

Some minor problems in run_example are resolved / cleaned up. There is likely more work to be done here; this is a complex file.

  1. Update run_lmcpgen.py

Significant improvements to usability through better handling of paths and better error reporting.

run_lmcpgen will now run LmcpGen from:

  1. command-line argument - building if needed
  2. explicit environment variable (LMCP_DEVEL_DIR) - building if needed
  3. directory spec'd in repositories.yaml - building if needed
  4. sanbox - failing if not already build

run_lmcpgen will build for OpenAMASE if -a is given, building in:

  1. command-line argument
  2. explicit environment variable (AMASE_DEVEL_DIR)
  3. directory spec'd in repositories.yaml

OpenAMASE in the sandbox is not used, as changes would be overwritten on next anod build.

VVCAS-Sean commented 2 years ago

I have been able to confirm that running the script 'run-lmcpgen' will correctly run and build lmcpgen in the location specified in the repositories.yaml. However, the functionality with 'run-example' is not what I expected. Currently, when using user specified locations for OpenAMASE and LmcpGen, the 'run-example' script prompts the user to run 'anod build amase'. However, doing so still does not result in the 'run-example' working correctly. I would suggest that 'run-example' uses the same logic to check the location of the builds of amase and OpenUxAS that the 'run-lmcpgen' utilizes. I think a preferred solution would only rely on the user using an initial 'anod build uxas' to download dependencies and set a clean state from which a developer can perform operations such as installing new mdms and dependencies or modifying LmcpGen or OpenAMASE without the expectation of using anod for incremental build status.

manthonyaiello commented 2 years ago

@VVCAS-Sean it seems fair to expect that run-example will behave similarly to run-lmcpgen. I'll create a new issue to track that work (#60). In the meantime, I suggest that this PR should go ahead and be merged.