nasa / ogma

Other
329 stars 24 forks source link

`copilot-core`: ROS, FPrime and Copilot backends expect handlers to be named differently #130

Closed Andersen0 closed 6 months ago

Andersen0 commented 6 months ago

Issue: Linker Error During Compilation of ROS Application

Summary

I am encountering a linker error towards the end of compiling a ROS application, specifically with undefined references to various handlers. This issue is preventing the successful build of the copilot package.

Details

The compilation process fails with the following linker error: collect2: error: ld returned 1 exit status

Affected Environment

Steps to Reproduce

Expected Behavior

The application should compile successfully without any linker errors.

Actual Behavior

The build process fails with a linker error related to undefined references to handlers.

Additional Context

Terminal output showcasing the error:

Please note that the undefined reference to "halt" can be ignored for the purposes of this issue.

Request for Assistance

Any insights or suggestions on how to resolve these undefined reference errors would be greatly appreciated. If further information or clarification is needed, please let me know.

ivanperez-keera commented 6 months ago

Description

The Spec to Copilot translator and the FPrime and ROS translators generate handler names in slightly different ways. The latter adds an extra prop to handler names, which means that the combination of both requires a manual edit before they can be integrated.

Type

Additional context

None.

Requester

Method to check presence of bug

Compiling the following trivial spec with both the ROS and the Copilot backends should produce files that can be compiled together without edits:

--- reqs.json
{
  "test_componentSpec": {
    "Functions": [
    ],
    "Internal_variables": [
    ],
    "Other_variables": [
      {
        "name": "a",
        "type": "bool"
      }
    ],
    "Requirements": [
      {
        "CoCoSpecCode": "true",
        "fretish": "unimportant",
        "name": "testCopilot",
        "ptLTL": "a"
      }
    ]
  }
}

--- variable-db
("a","bool","/a","Bool")

Expected result

Compiling the spec above using both the Copilot and the ROS backends should produce a ROS app that includes the monitors and compiles correctly without edits.

Desired result

Compiling the spec above using both the Copilot and the ROS backends should produce a ROS app that includes the monitors and compiles correctly without edits.

Proposed solution

Modify FPrime and ROS app generators to not include the extra "prop" in handler names.

Further notes

None.

ivanperez-keera commented 6 months ago

Change Manager: Confirmed that the issue exists.

ivanperez-keera commented 6 months ago

Technical Lead: Confirmed that the issue should be addressed.

ivanperez-keera commented 6 months ago

Technical Lead: Issue scheduled for fixing in Ogma 1.3.

Fix assigned to: @ivanperez-keera.

ivanperez-keera commented 6 months ago

Implementor: Solution implemented, review requested.

ivanperez-keera commented 6 months ago

Change Manager: Verified that:

ivanperez-keera commented 6 months ago

Change Manager: Implementation ready to be merged.