Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
24 changes: 24 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,27 @@ services/data/
datamodel/umaa/cpp11_gen/

build/

python/tests/__pycache__/

python/rtiumaapy/__pycache__/

# Python virtual environment
python/.venv/

# All pycache directories under python/
python/**/__pycache__/

# Reference / vendored directories (not part of the SDK)
python/architecture/v1/

# Pytest outputs
python/.pytest_cache/
python/tests/.pytest_cache/
python/tests/pytest_*.txt

# Backup files
python/**/*.bak

# Sphinx build output
python/docs/_build/
65 changes: 65 additions & 0 deletions datamodel/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -103,3 +103,68 @@ install(DIRECTORY ${UMAA_CPP11_GEN_DIR}/
DESTINATION include
FILES_MATCHING PATTERN "*.hpp"
)

# ═══════════════════════════════════════════════════════════════════════════
# Python codegen — generate flat Python type modules from UMAA IDL
#
# This target is NOT part of the default build. Run it explicitly:
# cmake --build build --target gen_python_umaa_types
#
# It invokes rtiddsgen once per IDL file, directing every output into the
# same flat directory (python/rtiumaapy/datamodel/). The generated files
# are checked into the repository so that downstream consumers do not need
# rtiddsgen installed.
#
# NOTE: rtiddsgen ≥ 4.4.0 (Connext ≥ 7.5.0) supports -joinInputFiles
# which can consolidate all types into a single .py per domain.
# When the next LTS release is adopted, this target should be updated
# to use -joinInputFiles / -joinedFilesOutputName for a cleaner
# single-file-per-domain layout.
#
# NOTE: ConnextDdsCodegen.cmake ≥ 7.6.0 adds LANG "Python" support for
# connextdds_rtiddsgen_run(). When the vendored rticonnextdds-cmake-utils
# is updated to that version, this custom target can be replaced with
# the standard module. Until then we invoke rtiddsgen directly.
# ═══════════════════════════════════════════════════════════════════════════

# Output into the rtiumaapy package so generated types ship with pip install
get_filename_component(_PYTHON_PKG_DIR
"${CMAKE_CURRENT_SOURCE_DIR}/../python/rtiumaapy/datamodel" ABSOLUTE)
set(UMAA_PYTHON_GEN_DIR "${_PYTHON_PKG_DIR}")

# rtiddsgen executable — RTICODEGEN_DIR is set by FindRTIConnextDDS
set(_RTIDDSGEN "${RTICODEGEN_DIR}/rtiddsgen")

# Stamp file that proves the whole gen step completed
set(_PYTHON_GEN_STAMP "${CMAKE_CURRENT_BINARY_DIR}/.gen_python_stamp")

# Collect every IDL in the tree so CMake knows to re-run when they change
file(GLOB_RECURSE _ALL_IDL_FILES "${UMAA_IDL_DIR}/UMAA/*.idl")

# Build one COMMAND per IDL file — all output goes to the same flat dir
list(LENGTH _ALL_IDL_FILES _idl_count)
set(_PYTHON_IDL_COMMANDS)
foreach(_idl_file IN LISTS _ALL_IDL_FILES)
list(APPEND _PYTHON_IDL_COMMANDS
COMMAND "${_RTIDDSGEN}"
-language Python
-d "${UMAA_PYTHON_GEN_DIR}"
-replace
-I "${UMAA_IDL_DIR}"
"${_idl_file}"
)
endforeach()

add_custom_command(
OUTPUT "${_PYTHON_GEN_STAMP}"
COMMAND ${CMAKE_COMMAND} -E make_directory "${UMAA_PYTHON_GEN_DIR}"
${_PYTHON_IDL_COMMANDS}
COMMAND ${CMAKE_COMMAND} -E touch "${_PYTHON_GEN_STAMP}"
DEPENDS ${_ALL_IDL_FILES}
COMMENT "Generating flat Python types from UMAA IDL (${_idl_count} files)..."
)

add_custom_target(gen_python_umaa_types
DEPENDS "${_PYTHON_GEN_STAMP}"
)

74 changes: 74 additions & 0 deletions datamodel/umaa/idl/UMAA/DdsDefinitions.idl
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
/**
*
* DISTRIBUTION STATEMENT A. Approved for public release.
* Distribution is unlimited.
* This software was developed by the Department of the Navy,
* NAVSEA Unmanned and Small Combatants. It is provided under the terms of
* use found in the LICENSE file at the source code root directory.
*
*/

/**
*
* System-wide DDS constants shared by all UMAA SDK implementations
* (Python, C++, etc.). Generated code provides these constants in each
* target language — no hand-maintained qos.py or qos.h needed.
*
*/

#ifndef _UMAA_DDS_DEFINITIONS
#define _UMAA_DDS_DEFINITIONS

module UMAA
{
module DdsDefinitions
{

// ── QoS Library & Profile Names ──────────────────────────────────────

/** QoS library name as declared in umaa_qos_lib.xml. */
const string QOS_LIBRARY_NAME = "UMAAQoSLib";

/** Auto-assigner profile — uses topic_filter rules to resolve QoS from topic name. */
const string QOS_ASSIGNER_PROFILE = "UMAAQoSLib::AssignerQoS";

/** Participant QoS profile — type_object_max_serialized_length, CFT property length, etc. */
const string QOS_PARTICIPANT_PROFILE = "UMAAQoSLib::DefaultUMAAParticipant";

// ── Individual QoS Profile Names (for reference / diagnostics) ───────

/** Best-effort, keep-last-1 — general telemetry reports. */
const string QOS_TELEMETRY_PROFILE = "UMAAQoSLib::TelemetryQoS";

/** Reliable, keep-all, liveliness 5s/10s — commands, acks, status, execution status. */
const string QOS_COMMAND_PROFILE = "UMAAQoSLib::CommandQoS";

/** Reliable, transient-local, keep-all — *SpecsReportType (config) topics. */
const string QOS_CONFIG_PROFILE = "UMAAQoSLib::ConfigQoS";

/** Reliable, keep-all, no liveliness — *SetElement / *ListElement topics. */
const string QOS_ELEMENT_PROFILE = "UMAAQoSLib::ElementQoS";

// ── QoS File Paths ───────────────────────────────────────────────────

/** QoS XML filename (relative to deployment root or bundled resource). */
const string QOS_FILE_NAME = "umaa_qos_lib.xml";

/** Repo-relative path to the canonical QoS XML. */
const string QOS_FILE_PATH = "qos/umaa_qos_lib.xml";

// ── Content Filter Expressions ───────────────────────────────────────

/** CFT expression that blocks all samples (always false). Used by
CommandConsumer to gate its filtered reader before a session starts. */
const string CFT_BLOCK_ALL = "1=0";

// ── Defaults ─────────────────────────────────────────────────────────

/** Default DDS domain ID for UMAA applications. */
const long DEFAULT_DOMAIN_ID = 0;

};
};

#endif // _UMAA_DDS_DEFINITIONS
Loading