ModiaSim / Modia3D.jl

Modeling and Simulation of 3D systems
MIT License
74 stars 8 forks source link

DLR Visualization library Community Edition problem with Julia 1.0.1 on Ubuntu 18.04 #3

Closed traversaro closed 3 years ago

traversaro commented 6 years ago

Trying to use the latest version of Modia3D with the DLR Visualization library Community Edition results in the following error:

ERROR: InitError: could not load symbol "SimVis_setTextObject":
/home/straversaro/src/DLR-VIZ-NEW/Visualization 1.5 Community Edition/Visualization/Extras/SimVis/linux/SimVisInterface_CommunityEdition.so: undefined symbol: SimVis_setTextObject
Stacktrace:
 [1] dlsym at /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.0/Libdl/src/Libdl.jl:55 [inlined]
 [2] (::getfield(Modia3D.DLR_Visualization, Symbol("##SimVis_Renderer#1#2")))(::String, ::Int64, ::Bool, ::Type, ::Tuple{String,String,Bool,Bool}) at /home/straversaro/.julia/packages/Modia3D/5m7xO/src/renderer/DLR_Visualization/renderer.jl:46
 [3] Type at ./none:0 [inlined]
 [4] #CommunityEdition#5 at /home/straversaro/.julia/packages/Modia3D/5m7xO/src/renderer/DLR_Visualization/renderer.jl:67 [inlined]
 [5] Type at /home/straversaro/.julia/packages/Modia3D/5m7xO/src/renderer/DLR_Visualization/renderer.jl:67 [inlined]
 [6] __init__() at /home/straversaro/.julia/packages/Modia3D/5m7xO/src/Modia3D.jl:99
 [7] _include_from_serialized(::String, ::Array{Any,1}) at ./loading.jl:630
 [8] macro expansion at ./logging.jl:312 [inlined]
 [9] _require_search_from_serialized(::Base.PkgId, ::String) at ./loading.jl:701
 [10] _require(::Base.PkgId) at ./loading.jl:934
 [11] require(::Base.PkgId) at ./loading.jl:855
 [12] macro expansion at ./logging.jl:311 [inlined]
 [13] require(::Module, ::Symbol) at ./loading.jl:837
during initialization of module Modia3D

checking with nm, indeed the SimVis_setTextObject symbol is not included in the library of the Community Edition.

MartinOtter commented 6 years ago

Sorry, this should not have occured (if the community edition is used, not supported elements should just be ignored for the animation). This will be fixed in the next days.

MartinOtter commented 6 years ago

Fixed with ff0a48593315a3b2ad012d7a6ed1f9a94894ea4e (its strange, but on Windows no error was raised when using the CommunityEdition; unfortunately, it could not be detected by Travis CL as well, because Travis CL is performed without the DLR visualization library).

traversaro commented 6 years ago

Thanks a lot. Even with this fix for some reason the README examples works fine when using NoRenderer, but instead the call to result = ModiaMath.simulate!(simulationModel); hangs indefinitely when using the DLR_Visualizer Community Edition, but it is possible that it is a problem of my setup.

MartinOtter commented 6 years ago

Please, can you give the exact sequence of commands that lead to the problem.

traversaro commented 6 years ago

I will try to replicate it on a clean VM to make sure that is not due to my setup over the weekend. However, the overall steps were the following, if I remember correctly:

material1 = Modia3D.Material(color="LightBlue", transparency=0.3); material2 = Modia3D.Material(color="Red");

@assembly Pendulum(;Lx = 1.0, Ly=0.2Lx, Lz=0.2Lx) begin world = Object3D(Modia3D.CoordinateSystem(0.5Lx)) beam_frame0 = Object3D(Modia3D.Solid(Modia3D.SolidBeam(Lx,Ly,Lz), "Aluminium", material1)) beam_frame1 = Object3D(beam_frame0; r=[-Lx/2, 0.0, 0.0]) cylinder = Object3D(beam_frame1,Modia3D.Cylinder(Ly/2,1.2Ly; material=material2)) revolute = Modia3D.Revolute(world, beam_frame1) end; simulationModel = Modia3D.SimulationModel(Pendulum(Lx=0.8),stopTime=5.0);

* After defining the model, trying to launch the following command hangs with the Julia process taking 100% of one cpu (everything works fine if the `ENV["DLR_VISUALIZATION"] ` line is removed from the `startup.jl`):
~~~julia
result = ModiaMath.simulate!(simulationModel);
traversaro commented 6 years ago

I found the problem. The SimVis executable had no executable permissions.

chmod +x <path-to-library>/Visualization/Extras/SimVis

fixed the issue that I was describing in https://github.com/ModiaSim/Modia3D.jl/issues/3#issuecomment-427105984 . I do not know if this is something that is affecting all Linux users. In that case, I do not know if there is something that can be fixed at the compressed archive level (see https://unix.stackexchange.com/questions/313656/preserving-permissions-while-zipping/313685) or if it is something that should be mentioned in the Modia3D's docs.

MartinOtter commented 6 years ago

Thanks for your findings. I have added your suggestion about execution rights to the README.md file.

Just to make sure: Is the animation of Modia3D now working for you?

traversaro commented 6 years ago

Yes, the animation is now working.

MartinOtter commented 6 years ago

@Thantalos, @GallLeo: Please, check that the distribution of the DLR Visualization library has "executable permissions" for the SimVis executable on Ubuntu. If not, please correct (this might explain the issue above).

AndreaNeumayr commented 3 years ago

Under Linux only the Community Edition of the DLR Visualization library is working. A limited number of shapes is displayed, further not all shapes are displayed supported by the Community Edition, like Text. For further information see https://visualization.ltx.de/

Due a complete redesign of Modia3D this issue is closed.