-
Notifications
You must be signed in to change notification settings - Fork 5
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
Investigate OpenModelica FMU segfaults in model with dampers #5
Comments
Apparently the problem is with models with dampers: model CompliantTransmission
Modelica.Blocks.Interfaces.RealInput actuatorInput annotation(
Placement(visible = true, transformation(origin = {-120, 0}, extent = {{-20, -20}, {20, 20}}, rotation = 0), iconTransformation(origin = {-120, 0}, extent = {{-20, -20}, {20, 20}}, rotation = 0)));
Modelica.Blocks.Interfaces.RealInput jointPosition annotation(
Placement(visible = true, transformation(origin = {120, -60}, extent = {{-20, -20}, {20, 20}}, rotation = 180), iconTransformation(origin = {120, -60}, extent = {{-20, -20}, {20, 20}}, rotation = 180)));
Modelica.Blocks.Interfaces.RealInput jointVelocity annotation(
Placement(visible = true, transformation(origin = {118, 0}, extent = {{-20, -20}, {20, 20}}, rotation = 180), iconTransformation(origin = {118, 0}, extent = {{-20, -20}, {20, 20}}, rotation = 180)));
Modelica.Blocks.Interfaces.RealOutput jointTorque annotation(
Placement(visible = true, transformation(origin = {110, 60}, extent = {{-10, -10}, {10, 10}}, rotation = 0), iconTransformation(origin = {110, 60}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
Modelica.Mechanics.Rotational.Components.AngleToTorqueAdaptor angleToTorqueAdaptor1(use_a = false, use_w = true) annotation(
Placement(visible = true, transformation(origin = {41, 0}, extent = {{-21, -20}, {21, 20}}, rotation = 180)));
Modelica.Mechanics.Rotational.Sources.Torque torque1 annotation(
Placement(visible = true, transformation(origin = {-76, 0}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
Modelica.Blocks.Math.Gain invertSign(k = -1) annotation(
Placement(visible = true, transformation(origin = {70, 16}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
Modelica.Mechanics.Rotational.Components.Spring spring1(c = 10) annotation(
Placement(visible = true, transformation(origin = {4, 0}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
Modelica.Mechanics.Rotational.Components.Inertia inertia annotation(
Placement(visible = true, transformation(origin = {-46, 0}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
Modelica.Mechanics.Rotational.Components.Damper damper1 annotation(
Placement(visible = true, transformation(origin = {-20, 0}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
equation
connect(damper1.flange_a, inertia.flange_b) annotation(
Line(points = {{-30, 0}, {-36, 0}, {-36, 0}, {-36, 0}}));
connect(damper1.flange_b, spring1.flange_a) annotation(
Line(points = {{-10, 0}, {-6, 0}, {-6, 0}, {-6, 0}}));
connect(torque1.flange, inertia.flange_a) annotation(
Line(points = {{-66, 0}, {-56, 0}}));
connect(spring1.flange_b, angleToTorqueAdaptor1.flange) annotation(
Line(points = {{14, 0}, {36, 0}, {36, 0}, {36, 0}}));
connect(invertSign.y, jointTorque) annotation(
Line(points = {{82, 16}, {90, 16}, {90, 60}, {110, 60}, {110, 60}}, color = {0, 0, 127}));
connect(angleToTorqueAdaptor1.tau, invertSign.u) annotation(
Line(points = {{48, 16}, {58, 16}, {58, 16}, {58, 16}}, color = {0, 0, 127}));
connect(actuatorInput, torque1.tau) annotation(
Line(points = {{-120, 0}, {-88, 0}}, color = {0, 0, 127}));
connect(jointPosition, angleToTorqueAdaptor1.phi) annotation(
Line(points = {{120, -60}, {80.5, -60}, {80.5, -16}, {49, -16}}, color = {0, 0, 127}));
connect(jointVelocity, angleToTorqueAdaptor1.w) annotation(
Line(points = {{118, 0}, {79.5, 0}, {79.5, -6}, {49, -6}}, color = {0, 0, 127}));
annotation(
uses(Modelica(version = "3.2.2")));
end CompliantTransmission; |
@triccyx If you get some similar problem, check this issue. |
I have a crash. But I suspect it is not the same. I don't use dumpers.
The stack doesn't show anything after the last gazebo::physics::World::RunLoop(). |
Which version of OpenModelica are you using? In my case, it was easy to reproduce the crash also using the |
I'm using OMEdit 1.12.0. |
Can you verify if it also fails with |
Ok for FMPy.
For generating I used the gui with platforms = {\"static\"} and fmuType="Model
exchange and cosimulation", I can revert to your option that I guess is
fmuType="cosimulation only"
For my problem, I suspect I have problems locating the fmu files from
gzserver command line. I'm investigating
…On Thu, 19 Jul 2018 at 10:34, Silvio Traversaro ***@***.***> wrote:
Can you verify if it also fails with FMPy ? In that way we can identify
that the problem is in OpenModelica. Which option did you use for
converting the Model in FMU? In the tests I used the options
buildModelFMU(${_OCM_MODEL_NAME}, fmuType = \"cs\", platforms =
{\"static\"}); (see
https://github.com/robotology/gazebo-fmi/blob/master/cmake/FMIUtils.cmake#L65)
.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#5 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AIsv-z_xCLmBB8t-0BOZMq0p1OmPUNcJks5uIESbgaJpZM4VQRni>
.
|
You should add the directory containing the FMUs in |
yes all right with the file but still crash.
…On Thu, 19 Jul 2018 at 10:44, Silvio Traversaro ***@***.***> wrote:
For my problem, I suspect I have problems locating the fmu files from
gzserver command line. I'm investigating
You should add the directory containing the FMUs in GAZEBO_RESOURCE_PATH .
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#5 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AIsv--KWRKZe5SprDOkKtkfVtxKTA8_Oks5uIEcCgaJpZM4VQRni>
.
|
Problems in using FMPy: python -m fmpy.gui |
However |
In this case gdb can't help as the command fmpy is not an exe |
Yes, |
Ok but before I want to try with a very simple fmu |
As B plan ... for next week |
I guess JModelica.org, but I never tried it. |
buildModelFMU(Gazebo,"2","cs","",{"static","x86_64-linux-gnu"},true) but with dynamic linkage is much better:
at least do something.
|
Now I will remove the gear that usually gives problems |
Unexpected behaviour. |
Going back to the fmu with motor we have a problem (similar to the dumper?)
and then crash. Perhaps the problem is due to wrong inputs to the motor. We can try to change the gain in PID |
@triccyx I replied on that specific model on Redmine. |
I had similar problem with a simple FMU that I prepared to test #17 . The Modelica model is the following: model StiffTransmission
Modelica.Blocks.Interfaces.RealInput actuatorInput annotation(
Placement(visible = true, transformation(origin = {-120, 0}, extent = {{-20, -20}, {20, 20}}, rotation = 0), iconTransformation(origin = {-120, 0}, extent = {{-20, -20}, {20, 20}}, rotation = 0)));
Modelica.Blocks.Interfaces.RealInput jointPosition annotation(
Placement(visible = true, transformation(origin = {120, -60}, extent = {{-20, -20}, {20, 20}}, rotation = 180), iconTransformation(origin = {120, -60}, extent = {{-20, -20}, {20, 20}}, rotation = 180)));
Modelica.Blocks.Interfaces.RealInput jointVelocity annotation(
Placement(visible = true, transformation(origin = {120, -20}, extent = {{-20, -20}, {20, 20}}, rotation = 180), iconTransformation(origin = {120, -20}, extent = {{-20, -20}, {20, 20}}, rotation = 180)));
Modelica.Blocks.Interfaces.RealOutput jointTorque annotation(
Placement(visible = true, transformation(origin = {110, 60}, extent = {{-10, -10}, {10, 10}}, rotation = 0), iconTransformation(origin = {110, 60}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
Modelica.Mechanics.Rotational.Components.AngleToTorqueAdaptor angleToTorqueAdaptor1(use_a = true, use_w = true) annotation(
Placement(visible = true, transformation(origin = {41, 0}, extent = {{-21, -20}, {21, 20}}, rotation = 180)));
Modelica.Mechanics.Rotational.Sources.Torque torque1 annotation(
Placement(visible = true, transformation(origin = {-76, 0}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
Modelica.Blocks.Math.Gain invertSign(k = -1) annotation(
Placement(visible = true, transformation(origin = {70, 60}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
Modelica.Mechanics.Rotational.Components.Inertia inertia(J = 0.01) annotation(
Placement(visible = true, transformation(origin = {-10, 0}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
Modelica.Blocks.Interfaces.RealInput jointAcceleration annotation(
Placement(visible = true, transformation(origin = {120, 20}, extent = {{-20, -20}, {20, 20}}, rotation = 180), iconTransformation(origin = {120, 20}, extent = {{-20, -20}, {20, 20}}, rotation = 180)));
equation
connect(inertia.flange_b, angleToTorqueAdaptor1.flange) annotation(
Line(points = {{0, 0}, {36, 0}}));
connect(torque1.flange, inertia.flange_a) annotation(
Line(points = {{-66, 0}, {-20, 0}}));
connect(jointAcceleration, angleToTorqueAdaptor1.a) annotation(
Line(points = {{120, 20}, {80, 20}, {80, 6}, {50, 6}, {50, 6}}, color = {0, 0, 127}));
connect(angleToTorqueAdaptor1.tau, invertSign.u) annotation(
Line(points = {{48, 16}, {53, 16}, {53, 60}, {58, 60}}, color = {0, 0, 127}));
connect(invertSign.y, jointTorque) annotation(
Line(points = {{81, 60}, {110, 60}}, color = {0, 0, 127}));
connect(jointVelocity, angleToTorqueAdaptor1.w) annotation(
Line(points = {{120, -20}, {83.5, -20}, {83.5, -6}, {49, -6}}, color = {0, 0, 127}));
connect(actuatorInput, torque1.tau) annotation(
Line(points = {{-120, 0}, {-88, 0}}, color = {0, 0, 127}));
connect(jointPosition, angleToTorqueAdaptor1.phi) annotation(
Line(points = {{120, -60}, {80.5, -60}, {80.5, -16}, {49, -16}}, color = {0, 0, 127}));
annotation(
uses(Modelica(version = "3.2.2")));
end StiffTransmission; With OpenModelica 1.12, the FMU was segfaulting with this backtrace (obtained with valgrind):
With the nightly OpenModelica 1.13.0~dev-1195-g6d891ea , everything works fine, so I guess that the fixes mentioned in https://trac.openmodelica.org/OpenModelica/ticket/4135 were effective in this case. I guess for the time being we should just document that OpenModelica >= 1.13 is required to avoid stability issues in generated FMUs . |
While developing the transmission for the examples, for several Modelica models the relative FMU generated by OpenModelica 1.12 was segfault, both if used through the FMILibrary of through FMPy .
I guess this problem was connected to https://trac.openmodelica.org/OpenModelica/ticket/4135 .
The text was updated successfully, but these errors were encountered: