fmi_adapter
fmi_adapter copied to clipboard
End time in FMU is not considered
From https://stackoverflow.com/questions/72374492/one-time-fmu-execution-with-fmi-adapter:
An end time (t_end) specified in an FMU is not considered by the fmi_adapter but the FMU is being evaluated constantly, i.e., it never finishes.
The ambition of fmi_adapter is not to implement the entire FMI standard but to support typical, straightforward use-cases with the Robot Operating System (ROS). Since ROS is mainly intended as framework and middleware for robotic systems, where the start and end of the operating time is defined externally by some UI or management system, the fmi_adapter currently does not consider an end time specified in an FMU.
I just checked the fmi-library used by the fmi_adapter but have not found a function to check for an end time in a quick search. Also, the fmi2_status_t
enum does not provide a relevant value. There is a value fmi2_terminated
in the fmi2_status_kind_t
enum. Maybe it can be used with fmi2_capi_get_status(..)
. This required more investigation on my end. Do you know more?
For the time being, I added a note in the README.md
that end times are currently not supported.
A stop time can optionally be defined in the default experiment of an FMU, but may be ignored by the importer. The stop time can be inquired via FMILIB functions.
FMILIB_EXPORT int fmi2_import_get_default_experiment_has_stop | ( | fmi2_import_t * | fmu | ) | FMILIB_EXPORT double fmi2_import_get_default_experiment_stop | ( | fmi2_import_t * | fmu | ) |
It is unclear to me, if considering such a stop time in ROS makes sense.