Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

vizInterface unit test #843

Open
wants to merge 4 commits into
base: develop
Choose a base branch
from
Open

vizInterface unit test #843

wants to merge 4 commits into from

Conversation

jackfox25
Copy link
Contributor

@jackfox25 jackfox25 commented Nov 7, 2024

  • Review: By commit
  • Merge strategy: Merge (no squash)

Description

This branch creates a unit test for vizInterface, validating the performance of the protobuffer packing and file saving functions.

  • Updated cmake to generate Python support file for vizMessage.proto
  • Upgraded protoc compiler to stable release version 3.20.0. Added Python protobuf install to optional packages (required for test script).
  • Created unit test which configures and executes a short scenario, saves to a binary file, then reads the file back in to evaluate. Only runs if vizInterface and protobuf are installed and configured.

Verification

test_vizInterface.py
Asserts that:

  • Number of messages in binary matches number of simulated frames
  • All spacecraft position, velocity, and rotation states match between binary file and message recorder, to specified accuracy
  • Number of celestial bodies == 1, and position/velocity is 0 (since Earth is set to central body)
  • Frame number and sim elapsed time match expected
  • Settings message is present at first frame and not at any other frame (won't show up again in the binary since it is stripped away between broadcast and saving)
  • Settings values including orbitLinesOn, spacecraftCSon, and keyboardLiveInput match expected
  • Epoch message is present at first timestep

Binaries created with new protoc compiler are backwards compatible with Vizard (tested on Windows/Mac).

Documentation

No functional BSK changes. Documentation file is auto-generated for test scenarios.

Future work

Add more components to test scenario to enhance testing

C++: protobuf/3.20.0 is a newer stable release that supports up to the latest Python protobuf library (5.27.0)
Python: protobuf version 5.27.0 is the current latest release, added to optional requirements.

These are both backwards compatible with proto binaries generated using earlier protobuf versions.
- Executes brief scenario, saves to file
- Parses protobuffers back in from binary, checks saved data against expected
- Only executes if optional Python protobuf package is installed and viz module is found
@jackfox25 jackfox25 marked this pull request as ready for review November 7, 2024 06:14
@jackfox25 jackfox25 requested a review from a team as a code owner November 7, 2024 06:14
@jackfox25 jackfox25 added the enhancement New feature or request label Nov 7, 2024
@schaubh schaubh changed the title Protobuf test scenario vizInterface unit test Nov 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants