- Post process the data in the FMU: Capture the required data while the FMU is running and then save it to a file using the ROS2's file handling capabilities.
- Log the data: If the FMU supports it you can log the data and extract it after the simulation.
- Use an external environment: Run the FMU in an external environment and then use an external script to save the captured data to a file.
"Save" function doesn't work in a Simulink FMU
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
I'm creating a Simulink FMU for robot trajectories. The input of my FMU is targetPos, i.e., the target point coordinates (x,y,z) of the robot.
The outputs are:
- ExitFlag - (not) reachable point
- config - joint angles of the manipulator
- info - IK solver details
I'm aiming to save the joint angles of all waypoints in the trajectory, i.e., config in all Simulink iterations. I prefer to do it in .csv for later compatibility, but .mat is also fine. I've included the Save block in Simulink directly connected to config.
I've exported the model as standalone FMU and it's generated succesfully.
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1010410/image.png)
ros2 launch fmi_adapter fmi_adapter_node.launch.py fmu_path:=FMI/Trajectory/RobotMARA_SimulinkFMU_v3.fmu
So, is there an incompatibility with the "Save" block in an FMU? Any work around to solve this problem is welcome.
Thank you,
Jon
0 Kommentare
Antworten (1)
Avadhoot
am 23 Jan. 2024
Hi Jon,
I understand that you are facing difficulties in saving the data from the FMU into a ".mat" file. In environments outside MATLAB, the functions like "save" may not work as expected as they do not have direct access to the file system. This is the reason behind the problem you are facing. Saving the data directly to a file from the FMU is not straightforward. You need to capture the data in the environment in which h the FMU is run and then save the data to a file from that environment. There are a few workarounds around this.
I hope it helps.
0 Kommentare
Siehe auch
Kategorien
Mehr zu Create Standalone FMU finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!