robotology / gazebo-fmi

FMI import plugins for the Gazebo Simulator.
GNU Lesser General Public License v3.0
23 stars 5 forks source link

unable to test and launch gazebo world in Actuator damped pendulum example with Gazebo 11 #67

Open sandeepparameshwara opened 3 years ago

sandeepparameshwara commented 3 years ago

Hello, I have installed the plugin and also open Modelica compiler(OpenModelica 1.16.0) is in my path. I have installed and added omc to my path in bash file like this:

omc=/usr/bin/omc:/usr/lib/x86_64-linux-gnu/omc:/usr/lib/omc:/usr/include/omc:/usr/share/omc
PATH=$PATH:$omc

When I try to run the example as per the instructions by typing gazebo -u -e simbody damped_pendulum.world, nothing happens! Gazebo doesn't open and also no error is printed! The command is not executed and it exits that line in the terminal! After running with verbose I got this:

gazebo -u -e simbody damped_pendulum.world --verbose
Gazebo multi-robot simulator, version 11.1.0
Copyright (C) 2012 Open Source Robotics Foundation.
Released under the Apache 2 License.
http://gazebosim.org

[Msg] Waiting for master.
Gazebo multi-robot simulator, version 11.1.0
Copyright (C) 2012 Open Source Robotics Foundation.
Released under the Apache 2 License.
http://gazebosim.org

[Msg] Waiting for master.
[Msg] Connected to gazebo master @ http://127.0.0.1:11345
[Msg] Publicized address: 192.168.0.201
[Err] [RTShaderSystem.cc:476] Unable to find shader lib. Shader generating will fail.[Err] [SimbodyJoint.cc:488] Not implement in Simbody
[Err] [SimbodyJoint.cc:488] Not implement in Simbody
[Err] [SimbodyJoint.cc:383] SimbodyJoint::SetAnchor:  Not implement in Simbody. Anchor is set during joint construction in SimbodyPhysics.cc
[Dbg] [SimbodyHingeJoint.cc:57] SetAxis: setting axis is not yet implemented.  The axis are set  during joint construction in SimbodyPhysics.cc for now.
[Err] [Joint.cc:550] GetParam unrecognized parameter [friction]
[Err] [SimbodyJoint.cc:383] SimbodyJoint::SetAnchor:  Not implement in Simbody. Anchor is set during joint construction in SimbodyPhysics.cc
[Dbg] [SimbodyHingeJoint.cc:57] SetAxis: setting axis is not yet implemented.  The axis are set  during joint construction in SimbodyPhysics.cc for now.
[Err] [Joint.cc:550] GetParam unrecognized parameter [friction]
[Wrn] [FMIActuatorPlugin.cc:235] Actuator loaded: upper_joint_actuator
sandeep@sandeep-G3-3579:~$ 

Damper.fmu is created properly. Can someone kindly explain what's the problem here? Also, to test the plugin, I regenerated the package like this

cmake -BUILD_TESTING=ON ..
make
sudo make install

When I later try running ctest [-VV] I get the following output

Test project /home/sandeep/gazebo-fmi/build
No tests were found!!!

Something wrong with FMI Library here? Is it affecting my gazebo simulation aswell? I have built the FMILibrary as a normal Cmake project. Its not clear to me how I should add the installation to CMAKE_PREFIX_PATH

Thank you

traversaro commented 3 years ago

Hi @sandeepparameshwara, which operating system are you using for your tests?

sandeepparameshwara commented 3 years ago

Hi @sandeepparameshwara, which operating system are you using for your tests?

Hi, I am using Ubuntu 20.04 with ROS Noetic distribution.

traversaro commented 3 years ago

Gazebo doesn't open and also no error is printed!

If you try to open Gazebo without loding any world, it opens correctly?

sandeepparameshwara commented 3 years ago

Yes,it opens correctly. Also,I can open other standard world files provided with gazebo

traversaro commented 3 years ago

Unable to find shader lib. Shader generating will fail.

This error sounds like that GAZEBO_RESOURCE_PATH is set to some value without sourcing the Gazebo setup.sh script before, see https://github.com/osrf/gazebo/issues/2044 . For the missing tests, can you provide the CMakeCache.txt in the build directory of gazebo-fmi ?

sandeepparameshwara commented 3 years ago

shader lib error is gone now but simbody errors are still there. Here's the CMakeCache.txt file CMakeCache.txt

traversaro commented 3 years ago

shader lib error is gone now but simbody errors are still there.

The Simbody errors should not impact the correct functionality of the simulation, does the Gazebo windows open now?

For what regards the test, as it is possible to see from the CMakeCache.txt, the BUILD_TESTING variable is set to OFF, and that is the reason why no tests are generated.

sandeepparameshwara commented 3 years ago

Hi, The gazebo is not opening yet. Regards to tests, I changed BUILD_TESTING to ON in CMakeCache.txt directly and tried to regenerate the project. Got the following error while executing make command

[ 73%] Linking CXX executable ../../../bin/FMIActuatorPluginPositionRegulationTest
/usr/bin/ld: /usr/lib/x86_64-linux-gnu/libgazebo_sensors.so: undefined reference to symbol '_ZTVN5boost6detail16thread_data_baseE'
/usr/bin/ld: /usr/lib/x86_64-linux-gnu/libboost_thread.so.1.71.0: error adding symbols: DSO missing from command line
collect2: error: ld returned 1 exit status
make[2]: *** [plugins/actuator/test/CMakeFiles/FMIActuatorPluginPositionRegulationTest.dir/build.make:138: bin/FMIActuatorPluginPositionRegulationTest] Error 1
make[1]: *** [CMakeFiles/Makefile2:499: plugins/actuator/test/CMakeFiles/FMIActuatorPluginPositionRegulationTest.dir/all] Error 2
make: *** [Makefile:141: all] Error 2
traversaro commented 3 years ago

Hi, The gazebo is not opening yet.

Can you please post the output of the env of the terminal in which you are trying to run Gazebo, and double check if indeed Gazebo on its own without passing any world is running correctly? The "Unable to find shader lib. Shader generating will fail." error you had before is something that is not related at all with the loaded world, so I am a bit dubious that Gazebo started corrected in that terminal even without passing our world.

Regards to tests, I changed BUILD_TESTING to ON in CMakeCache.txt directly and tried to regenerate the project. Got the following error while executing make command

I just added the same error, it seems something related to Ubuntu 20.04 that we did not catch in the tests as those were running only on Ubuntu 16.04 and 18.04 . I will open a separate issue to track it, thanks!

sandeepparameshwara commented 3 years ago

Yes, just typing gazebo on terminal opens the Gazebo. Typing env gives this output

sandeep@sandeep-G3-3579:~$ env
SHELL=/bin/bash
ROS_VERSION=1
SESSION_MANAGER=local/sandeep-G3-3579:@/tmp/.ICE-unix/1886,unix/sandeep-G3-3579:/tmp/.ICE-unix/1886
QT_ACCESSIBILITY=1
COLORTERM=truecolor
XDG_CONFIG_DIRS=/etc/xdg/xdg-ubuntu:/etc/xdg
XDG_MENU_PREFIX=gnome-
GNOME_DESKTOP_SESSION_ID=this-is-deprecated
CONDA_EXE=/home/sandeep/anaconda3/bin/conda
_CE_M=
PKG_CONFIG_PATH=/opt/ros/noetic/lib/pkgconfig
ROS_PYTHON_VERSION=3
LANGUAGE=en_US:en
LC_ADDRESS=de_DE.UTF-8
GNOME_SHELL_SESSION_MODE=ubuntu
LC_NAME=de_DE.UTF-8
SSH_AUTH_SOCK=/run/user/1000/keyring/ssh
XMODIFIERS=@im=ibus
DESKTOP_SESSION=ubuntu
LC_MONETARY=de_DE.UTF-8
SSH_AGENT_PID=1843
ROS_PACKAGE_PATH=/opt/ros/noetic/share
GTK_MODULES=gail:atk-bridge
ROSLISP_PACKAGE_DIRECTORIES=
PWD=/home/sandeep
LOGNAME=sandeep
XDG_SESSION_DESKTOP=ubuntu
XDG_SESSION_TYPE=x11
GPG_AGENT_INFO=/run/user/1000/gnupg/S.gpg-agent:0:1
XAUTHORITY=/run/user/1000/gdm/Xauthority
omc=/usr/bin/omc:/usr/lib/x86_64-linux-gnu/omc:/usr/lib/omc:/usr/include/omc:/usr/share/omc
WINDOWPATH=2
HOME=/home/sandeep
USERNAME=sandeep
IM_CONFIG_PHASE=1
LC_PAPER=de_DE.UTF-8
LANG=en_US.UTF-8
ROS_ETC_DIR=/opt/ros/noetic/etc/ros
LS_COLORS=rs=0:di=01;34:ln=01;36:mh=00:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=40;31;01:mi=00:su=37;41:sg=30;43:ca=30;41:tw=30;42:ow=34;42:st=37;44:ex=01;32:*.tar=01;31:*.tgz=01;31:*.arc=01;31:*.arj=01;31:*.taz=01;31:*.lha=01;31:*.lz4=01;31:*.lzh=01;31:*.lzma=01;31:*.tlz=01;31:*.txz=01;31:*.tzo=01;31:*.t7z=01;31:*.zip=01;31:*.z=01;31:*.dz=01;31:*.gz=01;31:*.lrz=01;31:*.lz=01;31:*.lzo=01;31:*.xz=01;31:*.zst=01;31:*.tzst=01;31:*.bz2=01;31:*.bz=01;31:*.tbz=01;31:*.tbz2=01;31:*.tz=01;31:*.deb=01;31:*.rpm=01;31:*.jar=01;31:*.war=01;31:*.ear=01;31:*.sar=01;31:*.rar=01;31:*.alz=01;31:*.ace=01;31:*.zoo=01;31:*.cpio=01;31:*.7z=01;31:*.rz=01;31:*.cab=01;31:*.wim=01;31:*.swm=01;31:*.dwm=01;31:*.esd=01;31:*.jpg=01;35:*.jpeg=01;35:*.mjpg=01;35:*.mjpeg=01;35:*.gif=01;35:*.bmp=01;35:*.pbm=01;35:*.pgm=01;35:*.ppm=01;35:*.tga=01;35:*.xbm=01;35:*.xpm=01;35:*.tif=01;35:*.tiff=01;35:*.png=01;35:*.svg=01;35:*.svgz=01;35:*.mng=01;35:*.pcx=01;35:*.mov=01;35:*.mpg=01;35:*.mpeg=01;35:*.m2v=01;35:*.mkv=01;35:*.webm=01;35:*.ogm=01;35:*.mp4=01;35:*.m4v=01;35:*.mp4v=01;35:*.vob=01;35:*.qt=01;35:*.nuv=01;35:*.wmv=01;35:*.asf=01;35:*.rm=01;35:*.rmvb=01;35:*.flc=01;35:*.avi=01;35:*.fli=01;35:*.flv=01;35:*.gl=01;35:*.dl=01;35:*.xcf=01;35:*.xwd=01;35:*.yuv=01;35:*.cgm=01;35:*.emf=01;35:*.ogv=01;35:*.ogx=01;35:*.aac=00;36:*.au=00;36:*.flac=00;36:*.m4a=00;36:*.mid=00;36:*.midi=00;36:*.mka=00;36:*.mp3=00;36:*.mpc=00;36:*.ogg=00;36:*.ra=00;36:*.wav=00;36:*.oga=00;36:*.opus=00;36:*.spx=00;36:*.xspf=00;36:
XDG_CURRENT_DESKTOP=ubuntu:GNOME
VTE_VERSION=6003
CMAKE_PREFIX_PATH=/opt/ros/noetic
GNOME_TERMINAL_SCREEN=/org/gnome/Terminal/screen/e9d8fdb4_a946_4bfd_b527_1eb66958f747
INVOCATION_ID=847ba0d6679f46eb8d08b094cea59489
MANAGERPID=1642
LESSCLOSE=/usr/bin/lesspipe %s %s
XDG_SESSION_CLASS=user
PYTHONPATH=/opt/ros/noetic/lib/python3/dist-packages
TERM=xterm-256color
LC_IDENTIFICATION=de_DE.UTF-8
_CE_CONDA=
LESSOPEN=| /usr/bin/lesspipe %s
USER=sandeep
GNOME_TERMINAL_SERVICE=:1.422
CONDA_SHLVL=0
DISPLAY=:0
SHLVL=1
LC_TELEPHONE=de_DE.UTF-8
ROS_MASTER_URI=http://localhost:11311
QT_IM_MODULE=ibus
LC_MEASUREMENT=de_DE.UTF-8
CONDA_PYTHON_EXE=/home/sandeep/anaconda3/bin/python
LD_LIBRARY_PATH=/opt/ros/noetic/lib
XDG_RUNTIME_DIR=/run/user/1000
LC_TIME=de_DE.UTF-8
JOURNAL_STREAM=9:41663
XDG_DATA_DIRS=/usr/share/ubuntu:/usr/local/share/:/usr/share/:/var/lib/snapd/desktop
PATH=/home/sandeep/anaconda3/condabin:/opt/ros/noetic/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/usr/bin/omc:/usr/lib/x86_64-linux-gnu/omc:/usr/lib/omc:/usr/include/omc:/usr/share/omc
GDMSESSION=ubuntu
DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/1000/bus
ROS_ROOT=/opt/ros/noetic/share/ros
ROS_DISTRO=noetic
LC_NUMERIC=de_DE.UTF-8
_=/usr/bin/env
traversaro commented 3 years ago

There is nothing strange at the first glance. If you try to launch the world without specifying the Simbody physics engine, does Gazebo starts correctly? What is the output with --verbose in that case?

sandeepparameshwara commented 3 years ago

In this case, Gazebo opens, but I dont see any pendulums

sandeep@sandeep-G3-3579:~$ gazebo -u -e damped_pendulum.world --verbose
Gazebo multi-robot simulator, version 11.1.0
Copyright (C) 2012 Open Source Robotics Foundation.
Released under the Apache 2 License.
http://gazebosim.org

[Msg] Waiting for master.
Gazebo multi-robot simulator, version 11.1.0
Copyright (C) 2012 Open Source Robotics Foundation.
Released under the Apache 2 License.
http://gazebosim.org

[Msg] Waiting for master.
[Msg] Connected to gazebo master @ http://127.0.0.1:11345
[Msg] Publicized address: 192.168.0.201
[Err] [Server.cc:453] Unregistered physics engine [damped_pendulum.world], the default will be used instead.
[Msg] Connected to gazebo master @ http://127.0.0.1:11345
[Msg] Publicized address: 192.168.0.201
[Wrn] [Event.cc:61] Warning: Deleting a connection right after creation. Make sure to save the ConnectionPtr from a Connect call
traversaro commented 3 years ago

I think the error in this case is quite clear:

[Err] [Server.cc:453] Unregistered physics engine [damped_pendulum.world], the default will be used instead.

To specify a world, it needs either to be present in the current working directory, or if it needs to be in one of the directory specified in the GAZEBO_RESOURCE_PATH env variable, see http://gazebosim.org/tutorials?tut=components&cat=get_started for more info. Remember to source the appropriate gazebo setup script with source <install_path>/share/gazebo/setup.sh, otherwise you will get the Unable to find shader lib. Shader generating will fail. error that you got before.

sandeepparameshwara commented 3 years ago

Sorry, I didn't understand you. By running, setup-examples.sh , I am updating the GAZEBO_PLUGIN_PATH. So, what am I missing here?

sandeep@sandeep-G3-3579:~$ source /usr/share/gazebo/setup.sh 
sandeep@sandeep-G3-3579:~$ source /usr/local/share/gazebo-fmi/examples/setup-examples.sh 
sandeep@sandeep-G3-3579:~$ gazebo -u -e simbody damped_pendulum.world
sandeep@sandeep-G3-3579:~$ gazebo -u -e  damped_pendulum.world
sandeep@sandeep-G3-3579:~$ echo $GAZEBO_RESOURCE_PATH
/usr/share/gazebo-11::/usr/local/share/gazebo-fmi/examples
sandeep@sandeep-G3-3579:~$ 
traversaro commented 3 years ago

Ah, sorry, as you did not mentioned that you were using the setup-example.sh, I did not understand what is going on, and I am able to reproduce your issue.

traversaro commented 3 years ago

I think the issue is in Gazebo11, as indeed also the tests are failing when using Gazebo11. Our Continuous Integration until now has tested with Gazebo 7, 8 and 9, so I guess that you could try with those version, thanks!

sandeepparameshwara commented 3 years ago

Ok, thanks a lot for your time. I will try with earlier releases of Gazebo. Meanwhile, I am curious to understand one thing. I have a FMU (from Dymola) of a quadcopter. By using the plugin, will I be able to see the actual Multibody of the model in Gazebo? Is it possible to really 'fly' the drone in Gazebo? Sorry for deviating from the topic, I am very new to this and I wanted to know. I am interested in using the actual geometry of the Drone in my simulation.

traversaro commented 3 years ago

Ok, thanks a lot for your time. I will try with earlier releases of Gazebo. Meanwhile, I am curious to understand one thing. I have a FMU (from Dymola) of a quadcopter. By using the plugin, will I be able to see the actual Multibody of the model in Gazebo? Is it possible to really 'fly' the drone in Gazebo? Sorry for deviating from the topic, I am very new to this and I wanted to know. I am interested in using the actual geometry of the Drone in my simulation.

Hi @sandeepparameshwara, the current plugins support using FMU for limited use, for now "1-dof actuator models" (see https://github.com/robotology/gazebo-fmi/blob/master/plugins/actuator/doc/modelica-actuator.md for an example of the interface that the loaded FMU needs to respect) and "single body fluid dynamics interaction" (see https://github.com/robotology/gazebo-fmi/blob/master/plugins/single-body-fluid-dynamics/doc/modelica-single-body-fluid-dynamics.md). If you have a different use case (that it may be the case, but I am not sure what you mean by "By using the plugin, will I be able to see the actual Multibody of the model in Gazebo? Is it possible to really 'fly' the drone in Gazebo?") depending of the specific use case it may be possible, but probably will requiring writing a new C++ Gazebo plugin to implement the "glue" between the FMU model and the Gazebo simulation.