![]() |
Autonomy Software C++ 24.5.1
Welcome to the Autonomy Software repository of the Mars Rover Design Team (MRDT) at Missouri University of Science and Technology (Missouri S&T)! API reference contains the source code and other resources for the development of the autonomy software for our Mars rover. The Autonomy Software project aims to compete in the University Rover Challenge (URC) by demonstrating advanced autonomous capabilities and robust navigation algorithms.
|
Classes | |
| class | Args |
| class | ANSI |
Functions | |
| None | print_ansi (str message, *ANSI codes) |
| None | print_if_verbose (str message, *ANSI codes) |
| None | print_separator () |
| None | print_key_values (str key, list[str] values, int length) |
| Never | print_error_and_exit (str message) |
| pathlib.Path | relative_or_full_path (pathlib.Path path) |
| tuple[int,...]|None | parse_llvm_version (str path_str) |
| str|None | get_llvm_std_module (str search) |
| pathlib.Path|None | find_vs_path () |
| list[str] | get_module_flags (str name, pathlib.Path module_output_path) |
| bool | compile_module (str name, list[pathlib.Path] paths, pathlib.Path module_output_path) |
Variables | |
| parser = argparse.ArgumentParser(formatter_class=argparse.ArgumentDefaultsHelpFormatter) | |
| _ = parser.add_argument("files", action="store", nargs="*", help="the source file(s) to compile") | |
| args = Args(parser.parse_args(args=None if len(sys.argv) > 1 else ["--help"])) | |
| ANSI_INFO = ANSI.fg_bright_blue | |
| ANSI_ERROR = ANSI.fg_bright_red | |
| ANSI_SUCCESS = ANSI.fg_bright_green | |
| ANSI_SEPARATOR = ANSI.fg_bright_yellow | |
| ANSI_TRY_ALL = ANSI.fg_bright_magenta | |
| bool | no_color = "" |
| list | source_paths = [pathlib.Path(file) for file in args.files] |
| list | child_args = [arg for arg in sys.argv[1:] if arg not in ("-y", "--try-all")] |
| list | compilers = [] |
| list | standards = ["c++17", "c++20", "c++23"] |
| pathlib | workspace_path = pathlib.Path(__file__).parent.parent.resolve() |
| float | compile_start = time.perf_counter() |
| list | warnings_as_errors = "cl" else ["-f-Werror"] |
| list | command |
| compile_result | |
| str | compiler = "" |
| pathlib | vs_path = find_vs_path() |
| list | defines = args.define[:] |
| list | deps = args.deps[:] |
| bool | disable_exceptions = "true" |
| list | flags = args.flag[:] |
| list | includes = args.include[:] |
| dict | modules = {name: files.split(",") for module in args.module for name, files in (module.split("="),)} |
| str | output = args.output |
| list | pass_args = args.pass_args[:] |
| str | std_module = args.std_module |
| pathlib | compile_yaml = pathlib.Path.cwd() / "compile_cpp.yaml" |
| dict | raw_config = yaml.safe_load(file) or {} |
| compile_config = cast("dict[str, Any]", raw_config) | |
| pathlib | binary_path = None |
| pathlib | build_folder .Path |
| bool | auto_binary = False |
| tuple | output_path = (pathlib.Path.cwd() / output).resolve() |
| exist_ok | |
| True | |
| parents | |
| bool | use_std_module = not (std_module is None or std_module == "disable" or args.std != "c++23") |
| str | gcc_std_path = "bits/std.cc" |
| bool | success = False |
| pathlib | vc_version_path = vs_path / "VC" / "Auxiliary" / "Build" / "Microsoft.VCToolsVersion.default.txt" |
| encoding | |
| str | vc_version = vc_version_file.read().strip() |
| pathlib | vc_tools_path = vs_path / "VC" / "Tools" / "MSVC" / vc_version |
| str | clang_path = shutil.which("clang++") |
| pathlib | std_path = pathlib.Path(clang_path).parent.parent / "share" / "libc++" / "v1" / "std.cppm" |
| str | llvm_std_path = get_llvm_std_module("/usr/local/Cellar/llvm") |
| str | module_extension = "" |
| str | short_compiler = "g++" else "msvc" |
| str | suffix = f"{args.type}-{short_compiler}-cpp{args.std[-2:]}" |
| str | extension = "Windows" else "" |
| str | module_indicator = "module_" if args.as_module else "" |
| str | binary_name = f"{source_paths[0].stem}_{module_indicator}{suffix}{extension}" |
| bool | recompiled_modules = False |
| dict | module_paths = {name: [(pathlib.Path.cwd() / file).resolve() for file in files] for name, files in modules.items()} |
| dict | module_output_paths = {name: build_folder / f"{path[0].stem}_module_{suffix}{module_extension}" for name, path in module_paths.items()} |
| bool | need_recompile = True |
| list | deps_paths = [(pathlib.Path.cwd() / file).resolve() for file in deps] |
| float | binary_mod = binary_path.stat().st_mtime |
| list | include_paths = [(pathlib.Path.cwd() / folder).resolve() for folder in includes] |
| str | compiler_path | None |
| pathlib | vs_pwsh_path = vs_path / "Common7" / "Tools" / "Launch-VsDevShell.ps1" |
| int | max_length = 16 |
| float | run_start = time.perf_counter() |
| subprocess | run_result |
██████ ███████ ████████ ██ ██ ██████ ███████ █████ ██████ ██████ ██████ ██████ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██████ ███████ ██ ███████ ██████ █████ ███████ ██ ██ ██████ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██████ ███████ ██ ██ ██ ██ ██ ███████ ██ ██ ██████ ███████ ██ ██████ ██████ ███████ `BS::thread_pool`: a fast, lightweight, modern, and easy-to-use C++17/C++20/C++23 thread pool library v5.1.0 (2026-01-03) By Barak Shoshany <baraksh@gmail.com> <https://baraksh.com/> Copyright (c) 2021-2026 Barak Shoshany. Licensed under the MIT license. If you found this project useful, please consider starring it on GitHub! If you use this library in software of any kind, please provide a link to the GitHub repository https://github.com/bshoshany/thread-pool in the source code and documentation. If you use this library in published research, please cite it as follows: Barak Shoshany, "A C++17 Thread Pool for High-Performance Scientific Computing", doi:10.1016/j.softx.2024.101687, SoftwareX 26 (2024) 101687, arXiv:2105.00613 This Python script can be used to compile simple C++ programs (with only a few source and/or header files) using a variety of compilers, C++ standards, and other options. It also includes support for C++20 modules and C++23 Standard Library modules. It is used in the thread pool library's development environment to compile and run the test program using different compilers and C++ standards. It is not part of the library itself, but users of the library may find it useful, especially if they wish to use the library as a C++20 module.
| None compile_cpp.print_ansi | ( | str | message, |
| *ANSI | codes ) |
Print a message. Uses the given ANSI codes if specified. Does not add newline. Does not print color if the `NO_COLOR` environment variable is set.

| None compile_cpp.print_if_verbose | ( | str | message, |
| *ANSI | codes ) |
Print a message followed by a newline, but only if the verbose flag is set. Uses the given ANSI codes if specified.


| None compile_cpp.print_separator | ( | ) |
Print a separator line, but only if the verbose flag is set.


| None compile_cpp.print_key_values | ( | str | key, |
| list[str] | values, | ||
| int | length ) |
Print a key-value pair with the key left-aligned to the given length, but only if the verbose flag is set.


| Never compile_cpp.print_error_and_exit | ( | str | message | ) |
Print an error message followed by a newline in red and exit.


| pathlib.Path compile_cpp.relative_or_full_path | ( | pathlib.Path | path | ) |
If the path is relative to the current working directory, return it as a relative path; otherwise, return it as a full path.

| tuple[int, ...] | None compile_cpp.parse_llvm_version | ( | str | path_str | ) |
Extract the LLVM version from a path and returns it as a tuple of integers.

| str | None compile_cpp.get_llvm_std_module | ( | str | search | ) |
Get the path to the LLVM standard library module on Linux or macOS. If multiple paths are found, return the one with the latest LLVM version.


| pathlib.Path | None compile_cpp.find_vs_path | ( | ) |
Find the Visual Studio installation path, if it exists.

| list[str] compile_cpp.get_module_flags | ( | str | name, |
| pathlib.Path | module_output_path ) |
Get the appropriate flags to import a module with the given name from the given output path.

| bool compile_cpp.compile_module | ( | str | name, |
| list[pathlib.Path] | paths, | ||
| pathlib.Path | module_output_path ) |
Compile a module with the given name. The first path in `paths` is the module file, and the rest are its dependencies. Returns True if the module was recompiled, False if it was up to date.


| list compile_cpp.command |
| compile_cpp.compile_result |
| subprocess compile_cpp.run_result |