Python API Docs - SimDynamX/SpaceTeamsPRO GitHub Wiki

Simulation Development Workflow → Python API Docs

Up to date for Platform 0.54.0

Written by Connor Jakubik

Prerequisites:


spaceteams Python Library

We took most of the functionality that is available to sim developers in C++ and exposed it in a Python API as well. The sim developer can write a python script that is started as a Python System, where the script connects to a sim and interacts with it similarly to a C++ System.

Parameter Type - C++ - Python type equivalency

Parameter st.VarType name C++ typename Python typename Description
bool bool bool Boolean value (True or False)
string std::string str Text string of ASCII characters
double double float or (numpy object) np.float64 Standard 64-bit floating point number
float float (numpy object) np.float32 32-bit floating point number
int8, int16, int32, int64 int8_t, int16_t, int32_t, int64_t (numpy object) np.int8, np.int16, np.int32, np.int64 signed integer types of various memory sizes
uint8, uint16, uint32, uint64 uint8_t, uint16_t, uint32_t, uint64_t (numpy object) np.uint8, np.uint16, np.uint32, np.uint64 unsigned integer types of various memory sizes
doubleV2, doubleV3, doubleV4 SC_DoubleV2, SC_DoubleV3, SC_DoubleV4 (numpy column vector) np.ndarray Vector with 2, 3, or 4 elements
doubleM2x2, doubleM3x3, doubleM4x4, doubleM5x5, doubleM6x6 SC_DoubleM2x2, SC_DoubleM3x3, SC_DoubleM4x4, SC_DoubleM5x5, SC_DoubleM6x6 (numpy matrix) np.ndarray Matrix with 2x2 through 6x6 elements
timestamp sc_tai_time st.timestamp (has .as_datetime() function) Specific date and time, microsecond precision
duration sc_duration datetime.timedelta Time difference, microsecond precision
uuid uuid::UUID_t uuid.UUID Universally Unique ID
entityID EntityID_t uuid.UUID Universally Unique ID, used for identifying an Entity
ParamArray of type std::vector<type> list[type] Dynamic-size array of type values

See more parameter variable type descriptions in the Parameter wiki page.

Link to Python API Documentation: https://simdynamx.github.io/stp-python-api-docs/

⚠️ **GitHub.com Fallback** ⚠️