OpenVSP Python API Integration Guide
OpenVSP Python API Integration Guide
Presented by:
Justin Gravett
[Link]@[Link]
Empirical Systems Aerospace, Inc. (ESAero)
Agenda
• Introduction
• C++ API
• AngelScript API
• Python API
Introduction
API Functions
C++ API
AngelScript API
Python API
Python API
MATLAB API
ESAero Support
• Integrated MATLAB API with
PANTHER toolset in Phase I SBIR
• Minor modifications made to
OpenVSP – released publicly NASA SBIR PHASE I - UAM Disturbance
Rejection in Conceptual Design
– Duplicated test suite to verify
functionality
– Tried to keep the build process as
simple as possible
Install Anaconda
• Anaconda Version Archive
– Version 5.2.0 – Includes
Python 3.6, compatible with
OpenVSP 3.21.2
• Latest Version
– Only use this version if
compiling OpenVSP
yourself
• Add to PATH
– Recommend through
installation option
– Could manually adding to
system PATH
Empirical Systems Aerospace, Inc. [Link] NNX09CC86P
OpenVSP
SBIR Review,
Workshop
Presented
2020to
Sept.
NASA, – Sept.
15thJuly 7th, 2009
17th
12
SWIG - Python
SWIG - MATLAB
• SWIG - MATLAB
– Unofficial SWIG build with MATLAB bindings
– [Link]
• User must compile OpenVSP
• Git required
– Sourcetree recommended Git GUI
• MinGW, MSYS, & PCRE used
4. Point the VSP CMAKE options to look for the [Link] that you just created
4. Point the VSP CMAKE options to look for the [Link] that you just created
Build Process – 1
1. Clone the swig-matlab repo & checkout matlab-customdoc
2. Compile swig-matlab from source and generate a [Link]
3. Create a 'matlab_api' (use the 'python_api' as a template)
4. Point the VSP CMAKE options to look for the [Link] that you just created
5. Compile OpenVSP (Build solution, Build INSTALL)
6. Delete duplicate SwigClear(self) function in SwigRef.m
7. Build some test scripts in MATLAB to verify everything is working
SWIG-MATLAB
Origin: [Link]
Branch: matlab-customdoc
ESAero branch off of 0fc411742bdfb36c3180d5b671a1da92766af90e
Two commits cherry picked:
Use Latest Git SHA: 82ca29bc9889792856a5d98c5903fb168a5e42f7
Empirical Systems Aerospace, Inc. [Link] NNX09CC86P
OpenVSP
SBIR Review,
Workshop
Presented
2020to
Sept.
NASA, – Sept.
15thJuly 7th, 2009
17th
17
Build Process – 2
1. Clone the swig-matlab repo & checkout matlab-customdoc
2. Compile swig-matlab from source and generate a [Link]
3. Create a 'matlab_api' (use the 'python_api' as a template)
4. Point the VSP CMAKE options to look for the [Link] that you just created
5. Compile OpenVSP (Build solution, Build INSTALL)
6. Delete duplicate SwigClear(self) function in SwigRef.m
7. Build some test scripts in MATLAB to verify everything is working
Build Process – 2
1. Clone the swig-matlab repo & checkout matlab-customdoc
2. Compile swig-matlab from source and generate a [Link]
3. Create a 'matlab_api' (use the 'python_api' as a template)
4. Point the VSP CMAKE options to look for the [Link] that you just created
5. Compile OpenVSP (Build solution, Build INSTALL)
6. Delete duplicate SwigClear(self) function in SwigRef.m
7. Build some test scripts in matlab to verify everything is working
Build Process – 2
1. Clone the swig-matlab repo & checkout matlab-customdoc
2. Compile swig-matlab from source and generate a [Link]
3. Create a 'matlab_api' (use the 'python_api' as a template)
4. Point the VSP CMAKE options to look for the [Link] that you just created
5. Compile OpenVSP (Build solution, Build INSTALL)
6. Delete duplicate SwigClear(self) function in SwigRef.m
7. Build some test scripts in matlab to verify everything is working
Build Process – 3
1. Clone the swig-matlab repo & checkout matlab-customdoc
2. Compile swig-matlab from source and generate a [Link]
3. Create a 'matlab_api' (use the 'python_api' as a template)
4. Point the VSP CMAKE options to look for the [Link] that you just created
5. Compile OpenVSP (Build solution, Build INSTALL)
6. Delete duplicate SwigClear(self) function in SwigRef.m
7. Build some test scripts in MATLAB to verify everything is working
Build Process – 3
1. Clone the swig-matlab repo & checkout matlab-customdoc
2. Compile swig-matlab from source and generate a [Link]
3. Create a 'matlab_api' (use the 'python_api' as a template)
4. Point the VSP CMAKE options to look for the [Link] that you just created
5. Compile OpenVSP (Build solution, Build INSTALL)
6. Delete duplicate SwigClear(self) function in SwigRef.m
7. Build some test scripts in MATLAB to verify everything is working
Build Process – 3
1. Clone the swig-matlab repo & checkout matlab-customdoc
2. Compile swig-matlab from source and generate a [Link]
3. Create a 'matlab_api' (use the 'python_api' as a template)
4. Point the VSP CMAKE options to look for the [Link] that you just created
5. Compile OpenVSP (Build solution, Build INSTALL)
6. Delete duplicate SwigClear(self) function in SwigRef.m
7. Build some test scripts in MATLAB to verify everything is working
Build Process – 4
1. Clone the swig-matlab repo & checkout matlab-customdoc
2. Compile swig-matlab from source and generate a [Link]
3. Create a 'matlab_api' (use the 'python_api' as a template)
4. Point the VSP CMAKE options to look for the [Link] that you just created
5. Compile OpenVSP (Build solution, Build INSTALL)
6. Delete duplicate SwigClear(self) function in SwigRef.m
7. Build some test scripts in MATLAB to verify everything is working
Build Process – 4
1. Clone the swig-matlab repo & checkout matlab-customdoc
2. Compile swig-matlab from source and generate a [Link]
3. Create a 'matlab_api' (use the 'python_api' as a template)
4. Point the VSP CMAKE options to look for the [Link] that you just created
5. Compile OpenVSP (Build solution, Build INSTALL)
6. Delete duplicate SwigClear(self) function in SwigRef.m
7. Build some test scripts in matlab to verify everything is working
If you are successful….
Build Process – 5
1. Clone the swig-matlab repo & checkout matlab-customdoc
2. Compile swig-matlab from source and generate a [Link]
3. Create a 'matlab_api' (use the 'python_api' as a template)
4. Point the VSP CMAKE options to look for the [Link] that you just created
5. Compile OpenVSP (Build solution, Build INSTALL)
6. Delete duplicate SwigClear(self) function in SwigRef.m
7. Build some test scripts in matlab to verify everything is working
Build Process – 6
1. Clone the swig-matlab repo & checkout matlab-customdoc
2. Compile swig-matlab from source and generate a [Link]
3. Create a 'matlab_api' (use the 'python_api' as a template)
4. Point the VSP CMAKE options to look for the [Link] that you just created
5. Compile OpenVSP (Build solution, Build INSTALL)
6. Delete duplicate SwigClear(self) function in SwigRef.m
7. Build some test scripts in matlab to verify everything is working
Build Process – 7
1. Clone the swig-matlab repo & checkout matlab-customdoc
2. Compile swig-matlab from source and generate a [Link]
3. Create a 'matlab_api' (use the 'python_api' as a template)
4. Point the VSP CMAKE options to look for the [Link] that you just created
5. Compile OpenVSP (Build solution, Build INSTALL)
6. Delete duplicate SwigClear(self) function in SwigRef.m
7. Build some test scripts in matlab to verify everything is working
APITestMain.m APITestSuiteTest.m
Questions?