Skip to content
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

Conveyor & TrackedVehicle example worlds are not working #1662

Closed
jasmeet0915 opened this issue Aug 25, 2022 · 14 comments
Closed

Conveyor & TrackedVehicle example worlds are not working #1662

jasmeet0915 opened this issue Aug 25, 2022 · 14 comments
Assignees
Labels
bug Something isn't working

Comments

@jasmeet0915
Copy link
Contributor

Environment

  • OS Version: Ubuntu 20.04
  • Source or binary build?
    Tested on multiple builds as mentioned below:
    Binary: Fortress v6.10
    Source: Edifice v5.3 & Garden v7.0~pre1

Description

  • Expected behavior: The conveyor.sdf and tracked_vehicle_simple.sdf examples should work using the TrackController plugin.
  • Actual behavior: The examples are not working. The tracks do not move using Keypress or manually publishing values to required topics. Setting <debug> as true does not print any debug messages nor any other error messages are observed. Tested the same on multiple systems and builds but the result is the same.

Output

conveyor

simple_tracked_vehicle

@jasmeet0915 jasmeet0915 added the bug Something isn't working label Aug 25, 2022
@ahcorde
Copy link
Contributor

ahcorde commented Aug 25, 2022

Hi @jasmeet0915,

You need to install this dart from

because you need a specific header which is not available in ubuntu 20.04.

Anyhow I was testing this feature on Garden and I found some issues with the conveyor, can you test it too?

@jasmeet0915
Copy link
Contributor Author

Hi @ahcorde,

Thank you for your answer. I installed the release-6.10 of dart from the source.
The tracked_vehicle_simple.sdf example now seems to work on the Garden source build I had. Should I add those instructions to the comments in the sdf files?
Also, the default conveyor.sdf for Garden seems to be missing the WorldControl GUI plugin. After adding the plugin to the sdf I am able to start the sim and it works as well.
Was this one of the issues you were talking about? Are there any other issues that I might be overlooking? I would be happy to test it out further.

Also, those examples seem to work on the Garden source build but still don't work on the Fortress Binary install as well as the Edifice source install I had. Any ideas about what might be the issue there?

@azeey azeey self-assigned this Sep 26, 2022
@azazdeaz
Copy link

azazdeaz commented Nov 2, 2022

I reproduced this issue on 22.04+Fortress/Garden and Ubuntu20.04+Fortress/Dome. The examples worked on Ubuntu 18.04+Dome.

How can i get these examples working under Ubuntu 22.04?

I tried building https://github.com/gazebo-forks/dart and use it as the --physics-engine but Gazebo complains that it isn't wrapped as an IgnitionPlugin:

Library [/home/azazdeaz/repos/temp/dart/build/lib/libdart.so] does not export any plugins. The symbol [IgnitionPluginHook] is missing, or it is not externally visible.
[Err] [Physics.cc:771] Unable to load the [/home/azazdeaz/repos/temp/dart/build/lib/libdart.so] library.

Is there any documentationtutorial i can follow to get this working? (I found things like this, but they didn't get me closer)

@liushuya7
Copy link

liushuya7 commented Nov 10, 2022

I am having the same issue on Ubuntu 22.04 + Garden. I noticed that gazebo uses DART by default and libdart-dev is already installed in the system.

$ gz sim -h

  --physics-engine [arg]       Gazebo Physics engine plugin to load.            
                               Gazebo will use DART by default.                 
                               (gz-physics-dartsim-plugin)                
                               Make sure custom plugins are in                  
                               GZ_SIM_PHYSICS_ENGINE_PATH. 

However, nothing is happening with the example. Do we need to define all the System Parameters as described in TrackController Class Reference

The example in this repo only set the link parameter:

<plugin filename="gz-sim-track-controller-system"
name="gz::sim::systems::TrackController">
<link>base_link</link>
<!--debug>true</debug-->
</plugin>

Can anyone provide a working example?

@jrutgeer
Copy link
Contributor

jrutgeer commented Mar 27, 2023

To prevent anyone else from loosing a lot of time on this:

You need to install [...] dart6.10
because you need a specific header which is not available in ubuntu 20.04.

I wrongly interpreted this as "You need dart6.10 and Ubuntu 20.04 has an older version which lacks a specific header."
As Ubuntu 22.04 ships with dart6.12 I thought this was ok, which obviously it isn't.
What actually is meant, is that you need a specific patched version. This patch has not yet been merged in dart6.12 but it has in in dart6.13, see the release info and corresponding PR.

So once I realized this, I got it working by:

  • Uninstalling libdart 6.12:
    • sudo apt remove libdart*
    • As the gazebo/ignition packages have a dependency on this, these also needed to be uninstalled,
    • Not sure if it is possible to reinstall these after installing dart 6.13.
  • Per these instructions add the PPA's and install libdart-dev.
    • I installed "all": sudo apt-get install libdart6-all-dev
  • Per these instructions install Gazebo Garden from source
    • dart6.13 should be found automatically. You can check this: build/gz-physics6/CMakeCache.txt will contain DART_HAS_CONTACT_SURFACE_HEADER:INTERNAL=1
    • There was a compile error about a missing file included from #include <dart/utils/utils.hpp> in src/gz-physics/test/plugins/DARTDoublePendulum.cc
      • I just commented out that line (//#include <dart/utils/utils.hpp>) and/or I compiled the second time with tests disabled colcon build --cmake-args -DBUILD_TESTING=OFF --merge-install
  • Finally bash complained that gz could not be found in install/gz-tools2/bin/ but that was resolved by restarting the xterm and sourcing install/setup.bash.

@ahcorde

Anyhow I was testing this feature on Garden and I found some issues with the conveyor, can you test it too?

What issues? If I start the simulation, the cube drops onto the conveyor and if I press 'w' it starts moving.

The only thing I assume is that belt velocities are instantaneously set, whereas the acceleration of the object on the belt is probably limited by the maximum friction force between belt and object.

@Bi0T1N
Copy link
Contributor

Bi0T1N commented Mar 28, 2023

I also tried to get it working without knowing that you replied but my steps are similar to yours. I used Ignition Fortress instead of Gazebo Garden on Ubuntu 22.04. However, these are my findings you didn't mentioned:

  1. The following command from the source install instruction will install libdart from the Ubuntu repository. Thus I edited the corresponding packages.apt inside the .github/ci/ folder (rename to libdart6 for the PPA version). This may not be necessary as CMake prefers the newer version anyway as it seems to work just fine with your approach.
sudo apt -y install \
  $(sort -u $(find . -iname 'packages-'`lsb_release -cs`'.apt' -o -iname 'packages.apt' | grep -v '/\.git/') | sed '/ignition\|sdf/d' | tr '\n' ' ')
  1. I directly used colcon build --cmake-args -DBUILD_TESTING=OFF --merge-install so can't say if my approach will result in a compilation error

Anyhow I was testing this feature on Garden and I found some issues with the conveyor, can you test it too?

What issues? If I start the simulation, the cube drops onto the conveyor and if I press 'w' it starts moving.

For me it works fine. w for forward, s for stop and x for backwards. Just make sure it doesn't leave the conveyor belt because then it's gone forever (restart simulation required).
However, the tracked_vehicle_simple.sdf example still won't work for me. It doesn't load the simulation but that might be something on my environment (have to retest in a container to rule this out). Can you confirm that it works for you?

@jrutgeer
Copy link
Contributor

@Bi0T1N

The following command from the source install instruction will install libdart from the Ubuntu repository.

Indeed, I had installed Garden from source first, and then lateron removed libdart, installed dart 6.13 and recompiled Garden. So I didn't run the apt -y install command a second time.


However, the tracked_vehicle_simple.sdf example still won't work for me.

I tried the conveyor.sdf, track_drive.sdf and tracked_vehicle_simple.sdf demos and all work fine. I hadn't run the tracked vehicle examples before and they are strangely cool, actually. #boyswillbeboys ;-)

@Bi0T1N
Copy link
Contributor

Bi0T1N commented Mar 30, 2023

However, the tracked_vehicle_simple.sdf example still won't work for me.

I tried the conveyor.sdf, track_drive.sdf and tracked_vehicle_simple.sdf demos and all work fine. I hadn't run the tracked vehicle examples before and they are strangely cool, actually. #boyswillbeboys ;-)

After I tested it again, it also worked perfectly for me.

Anyhow, I think this shows some major issues:

  1. All the examples that are shipped with Gazebo (starting points for beginners!) should have strong tests running within the CI pipeline to detect problems like this immediately. However, for the ones mentioned in this issue there is one that tests tracked_vehicle_simple.sdf and conveyor.sdf (note that the used SDF files are different than those in examples/worlds folder that a user would see in his installation).
  2. The simulation tests are passing on e.g. the Focal CI while it fails on a normal installation which shouldn't occur if the CI would use the same steps/environment that are written on the Binary Ubuntu Install page.
          Start 211: INTEGRATION_tracked_vehicle_system
  211/235 Test #211: INTEGRATION_tracked_vehicle_system .....................   Passed    1.34 sec
          Start 212: check_INTEGRATION_tracked_vehicle_system
  212/235 Test #212: check_INTEGRATION_tracked_vehicle_system ...............   Passed    0.02 sec
  1. Either the official libdart-* packages in Ubuntu Focal and Jammy get updated to 6.13 or the install instructions should advice to use the PPA repository and thus the packages.apt files need to be adapted to use libdart6-* packages.

@benmalenfant
Copy link

Is there a recommanded install procedure for the new dart lib? I'm trying to install the new dart from the PPA with the ros release of gazebo fortress ros-humble-ros-gz however, when I try to install ros-humble-ros-gz with apt (after installing dart-dev from the PPA), I seem to create a conflict and basically brick apt... A colleague managed to make it work building gazebo from source in a docker but it'd be nice to have a easier way to do it in the future with apt

@azeey
Copy link
Contributor

azeey commented Dec 13, 2023

gz-harmonic is shipped with DART 6.13, so the Conveyer and TrackedVehicle work without compiling DART from source.

@azeey azeey closed this as completed Dec 13, 2023
@peci1
Copy link
Contributor

peci1 commented Feb 26, 2024

This issue is not solved on 20.04/Fortress. The system DART does not support tracked vehicles at all (it has even many more missing features as it is DART 6.9 and not the 6.10 relied upon during SubT when the tracked vehicles support was added).

For reference, this is a short guide to what I did to get it working without breaking Gazebo 11 and keeping most of Fortress installed from binary (except physics-dartsim-plugin):

# Install DART 6.10
sudo mkdir -p /usr/local/lib
git clone https://github.com/gazebo-forks/dart -b release-6.10
mkdir dart/build
cd dart/build
sudo apt install coinor-libipopt-dev libnlopt-cxx-dev
cmake .. -DCMAKE_INSTALL_PREFIX=/opt/dart6.10 -DCMAKE_BUILD_TYPE=Release
make -j12 && sudo make -j12 install
for f in dart dart-collision-bullet dart-collision-ode dart-external-odelcpsolver; do sudo ln -s /opt/dart6.10/lib/lib${f}.so.6.10 /usr/local/lib/lib${f}.so.6.10; done;
sudo ldconfig

# Install ign-physics5
cd ../..
git clone https://github.com/gazebosim/gz-physics -b ign-physics5
mkdir gz-physics/build
cd gz-physics/build
CMAKE_PREFIX_PATH=/opt/dart6.10/share/dart/cmake:$CMAKE_PREFIX_PATH cmake .. -DCMAKE_INSTALL_PREFIX=/opt/ign-physics5 -DCMAKE_BUILD_TYPE=RelWithDebInfo -DBUILD_DOCS=OFF -DBUILD_TESTING=OFF -DSKIP_bullet=ON -DSKIP_tpe=ON
make -j12 && sudo make -j12 install
# Now this is ugly hack but there is no way to convince gz::common::SystemPaths to prefer a custom engine named the same as a preinstalled one.
sudo ln -sf /opt/ign-physics5/lib/ign-physics-5/engine-plugins/libignition-physics-dartsim-plugin.so /usr/lib/$(uname -m)-linux-gnu/ign-physics-5/engine-plugins/libignition-physics-dartsim-plugin.so

To disable the ugly hack and use stock ign-physics, do:

sudo ln -sf libignition-physics5-dartsim-plugin.so /usr/lib/$(uname -m)-linux-gnu/ign-physics-5/engine-plugins/libignition-physics-dartsim-plugin.so

@azeey If there's a better way to run a custom build of ign-physics without building ign-gazebo from source, please tell me.

@pucciland95
Copy link

Hi, as of today the example does not work using Gazebo Fortress.

Do I really need to build from source Gazebo to make the example work?

@benmalenfant
Copy link

benmalenfant commented Jul 16, 2024

I'd recommend moving to a later version of gazebo, the solution we ended up with was to use harmonic and build ros_gz from source with the correct version flag

@pucciland95
Copy link

Yes, with Gazebo Harmonic works. However, I have now broken everything related to ros2_control with Gazebo since I cannot find the related plugins. Do any of you guys have experience with this? Do I need to compile from source also ros2 control?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Archived in project
Development

No branches or pull requests

10 participants