Skip to content

Commit

Permalink
Merge pull request #383 from robotology/feature/fortress
Browse files Browse the repository at this point in the history
Bump Ignition distribution to Fortress
  • Loading branch information
diegoferigo committed Sep 29, 2021
2 parents 2e83839 + 7608b5c commit f974456
Show file tree
Hide file tree
Showing 12 changed files with 113 additions and 30 deletions.
2 changes: 1 addition & 1 deletion .docker/cicd-devel.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ RUN pip3 install vcstool colcon-common-extensions &&\
rm -r $HOME/.cache/pip

ARG CMAKE_BUILD_TYPE="Release"
ARG ignition_codename="edifice"
ARG ignition_codename="fortress"
ARG IGNITION_DEFAULT_CHANNEL="stable"

RUN echo "deb http://packages.osrfoundation.org/gazebo/ubuntu-${IGNITION_DEFAULT_CHANNEL} `lsb_release -cs` main" > \
Expand Down
2 changes: 1 addition & 1 deletion .docker/cicd-master.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ ARG from=diegoferigo/gym-ignition:base
FROM ${from}

# Install ignition gazebo
ARG ignition_codename="edifice"
ARG ignition_codename="fortress"
RUN echo "deb http://packages.osrfoundation.org/gazebo/ubuntu-stable `lsb_release -cs` main" \
> /etc/apt/sources.list.d/gazebo-stable.list &&\
wget http://packages.osrfoundation.org/gazebo.key -O - | apt-key add - &&\
Expand Down
4 changes: 2 additions & 2 deletions .docker/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ services:
build:
args:
from: diegoferigo/gym-ignition:base
ignition_codename: edifice
ignition_codename: fortress
CMAKE_BUILD_TYPE: Debug
context: .
dockerfile: cicd-devel.Dockerfile
Expand All @@ -50,7 +50,7 @@ services:
build:
args:
from: diegoferigo/gym-ignition:base
ignition_codename: edifice
ignition_codename: fortress
CMAKE_BUILD_TYPE: Release
context: .
dockerfile: cicd-devel.Dockerfile
Expand Down
16 changes: 8 additions & 8 deletions .github/workflows/cicd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ jobs:
matrix:
ignition:
# - dome
- edifice
# - fortress
# - edifice
- fortress
env:
CCACHE_DIR: ${{ github.workspace }}/.ccache
steps:
Expand Down Expand Up @@ -133,8 +133,8 @@ jobs:
- Developer
ignition:
# - dome
- edifice
# - fortress
# - edifice
- fortress
python:
- 3.8
- 3.9
Expand Down Expand Up @@ -250,13 +250,13 @@ jobs:

# User installation
- name: '[👤|user] Create wheel (default ignition)'
if: matrix.type == 'User' && matrix.ignition == 'edifice'
if: matrix.type == 'User' && matrix.ignition == 'fortress'
shell: bash -i -e {0}
run: pip wheel --use-feature=in-tree-build -v -w dist/ ./scenario
# Note: Calling "pip wheel" with "--global-option" forces all dependencies to be built from their sdist.
# Since it's very slow, we create the wheel from setup.py without isolation (requires system deps).
- name: '[👤|user] Create wheel (custom ignition)'
if: matrix.type == 'User' && matrix.ignition != 'edifice'
if: matrix.type == 'User' && matrix.ignition != 'fortress'
shell: bash -i -e {0}
run: |
pip install wheel setuptools-scm cmake-build-extension
Expand Down Expand Up @@ -331,7 +331,7 @@ jobs:

- name: '⬆️ Upload artifacts'
uses: actions/upload-artifact@v2
if: matrix.type == 'User' && matrix.ignition == 'edifice'
if: matrix.type == 'User' && matrix.ignition == 'fortress'
with:
path: dist/*
name: dist
Expand Down Expand Up @@ -371,7 +371,7 @@ jobs:
- name: '⬆️ Upload website folder'
uses: actions/upload-artifact@v2
if: matrix.type == 'User' && matrix.ignition == 'edifice' && contains(matrix.os, 'ubuntu')
if: matrix.type == 'User' && matrix.ignition == 'fortress' && contains(matrix.os, 'ubuntu')
with:
path: build/html
name: website
Expand Down
2 changes: 1 addition & 1 deletion docs/sphinx/info/faq.rst
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ On GNU/Linux distributions that ship an old OpenGL version, the GUI could fail t
error like *Unable to create the rendering window*.
The reason is that Ignition Gazebo has `ogre-next <https://github.com/OGRECave/ogre-next>`_
(also known as ogre2) as default rendering engine, and it requires OpenGL greater than 3.3.
You can find more details `here <https://github.com/ignitionrobotics/docs/blob/master/edifice/troubleshooting.md#unable-to-create-the-rendering-window>`_.
You can find more details `here <https://github.com/ignitionrobotics/docs/blob/master/fortress/troubleshooting.md#unable-to-create-the-rendering-window>`_.

The workaround we recommend is modifying the file ``~/.ignition/gazebo/gui.config`` as follows:

Expand Down
16 changes: 8 additions & 8 deletions docs/sphinx/installation/support_policy.rst
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,16 @@ We do not yet provide official support to other operating systems.

The table below recaps the project requirements of the :ref:`Stable <installation_stable>` and :ref:`Nightly <installation_nightly>` channels:

+-------------+-----------------+--------+---------------------+----------+------------+---------+
| Channel | C++ | Python | Ignition | Ubuntu | macOS [*]_ | Windows |
+=============+=================+========+=====================+==========+============+=========+
| **Stable** | >= gcc8, clang6 | >= 3.8 | `Dome`_ (binary) | >= 20.04 | No | No |
+-------------+-----------------+--------+---------------------+----------+------------+---------+
| **Nightly** | >= gcc8, clang6 | >= 3.8 | `Edifice`_ (source) | >= 20.04 | No | No |
+-------------+-----------------+--------+---------------------+----------+------------+---------+
+-------------+-----------------+--------+----------------------+----------+------------+---------+
| Channel | C++ | Python | Ignition | Ubuntu | macOS [*]_ | Windows |
+=============+=================+========+======================+==========+============+=========+
| **Stable** | >= gcc8, clang6 | >= 3.8 | `Dome`_ (binary) | >= 20.04 | No | No |
+-------------+-----------------+--------+----------------------+----------+------------+---------+
| **Nightly** | >= gcc8, clang6 | >= 3.8 | `Fortress`_ (source) | >= 20.04 | No | No |
+-------------+-----------------+--------+----------------------+----------+------------+---------+

.. _`Dome`: https://ignitionrobotics.org/docs/dome/install
.. _`Edifice`: https://ignitionrobotics.org/docs/edifice/install
.. _`Fortress`: https://ignitionrobotics.org/docs/fortress/install

.. [*] Ignition officially supports macOS and also ``gym-ignition`` could be installed on this platform.
However, we do not currently test this configuration and we cannot guarantee support.
Expand Down
6 changes: 5 additions & 1 deletion scenario/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,11 @@ add_install_rpath_support(
if(NOT IGNITION_DISTRIBUTION)

include(FindIgnitionDistribution)
set(SUPPORTED_IGNITION_DISTRIBUTIONS "Edifice" "Dome" "Citadel")
set(SUPPORTED_IGNITION_DISTRIBUTIONS
"Fortress"
"Edifice"
"Dome"
"Citadel")

foreach(distribution IN LISTS SUPPORTED_IGNITION_DISTRIBUTIONS)

Expand Down
1 change: 1 addition & 0 deletions scenario/cmake/FindIgnitionDistribution.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
set(IGNITION-GAZEBO_CITADEL_VER 3)
set(IGNITION-GAZEBO_DOME_VER 4)
set(IGNITION-GAZEBO_EDIFICE_VER 5)
set(IGNITION-GAZEBO_FORTRESS_VER 6)

macro(find_ignition_distribution)

Expand Down
73 changes: 73 additions & 0 deletions scenario/cmake/ImportTargetsFortress.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
include(AliasImportedTarget)

# https://ignitionrobotics.org/docs/fortress/install#fortress-libraries

alias_imported_target(
PACKAGE_ORIG sdformat12
PACKAGE_DEST sdformat
TARGETS_ORIG sdformat12
TARGETS_DEST sdformat
NAMESPACE_ORIG sdformat12
NAMESPACE_DEST sdformat
REQUIRED TRUE
)

alias_imported_target(
PACKAGE_ORIG ignition-gazebo6
PACKAGE_DEST ignition-gazebo
TARGETS_ORIG ignition-gazebo6 core
TARGETS_DEST ignition-gazebo core
NAMESPACE_ORIG ignition-gazebo6
NAMESPACE_DEST ignition-gazebo
REQUIRED TRUE
)

alias_imported_target(
PACKAGE_ORIG ignition-common4
PACKAGE_DEST ignition-common
TARGETS_ORIG ignition-common4
TARGETS_DEST ignition-common
NAMESPACE_ORIG ignition-common4
NAMESPACE_DEST ignition-common
REQUIRED TRUE
)

alias_imported_target(
PACKAGE_ORIG ignition-sensors6-all
PACKAGE_DEST ignition-sensors-all
TARGETS_ORIG ignition-sensors6-all
TARGETS_DEST ignition-sensors-all
NAMESPACE_ORIG ignition-sensors6
NAMESPACE_DEST ignition-sensors
REQUIRED TRUE
)

alias_imported_target(
PACKAGE_ORIG ignition-rendering6
PACKAGE_DEST ignition-rendering
TARGETS_ORIG ignition-rendering6
TARGETS_DEST ignition-rendering
NAMESPACE_ORIG ignition-rendering6
NAMESPACE_DEST ignition-rendering
REQUIRED TRUE
)

alias_imported_target(
PACKAGE_ORIG ignition-gazebo6-rendering
PACKAGE_DEST ignition-gazebo-rendering
TARGETS_ORIG ignition-gazebo6-rendering
TARGETS_DEST ignition-gazebo-rendering
NAMESPACE_ORIG ignition-gazebo6
NAMESPACE_DEST ignition-gazebo
REQUIRED TRUE
)

alias_imported_target(
PACKAGE_ORIG ignition-physics5
PACKAGE_DEST ignition-physics
TARGETS_ORIG ignition-physics5
TARGETS_DEST ignition-physics
NAMESPACE_ORIG ignition-physics5
NAMESPACE_DEST ignition-physics
REQUIRED TRUE
)
1 change: 0 additions & 1 deletion scenario/src/gazebo/src/World.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,6 @@ class World::Impl

{
// Check that the model name is correct
assert(modelSdfRoot->ModelCount() == 1);
std::string modelNameSDF = modelSdfRoot->Model()->Name();
std::string modelNameEntity = utils::getExistingComponentData< //
ignition::gazebo::components::Name>(world.m_ecm, modelEntity);
Expand Down
10 changes: 7 additions & 3 deletions tests/test_scenario/test_pid_controllers.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,15 +45,19 @@ def test_position_pid(default_world: Tuple[scenario.GazeboSimulator, scenario.Wo
assert world.insert_model(panda_urdf)
assert "panda" in world.model_names()

# Get the model and cast it to Gazebo
panda = world.get_model("panda").to_gazebo()

# Disable any velocity and torque limits of the model
_ = [j.set_velocity_limit(np.finfo(float).max) for j in panda.joints()]
_ = [j.set_max_generalized_force(np.finfo(float).max) for j in panda.joints()]

# Show the GUI
# import time
# gazebo.gui()
# gazebo.run(paused=True)
# time.sleep(3)

# Get the model and cast it to Gazebo
panda = world.get_model("panda").to_gazebo()

# Reset joint1 to its middle position
joint1 = panda.get_joint("panda_joint1").to_gazebo()
joint1_range = np.abs(joint1.position_limit().max - joint1.position_limit().min)
Expand Down
10 changes: 6 additions & 4 deletions tests/test_scenario/test_velocity_direct.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,11 @@ def test_velocity_direct(
# Get the model and cast it to Gazebo
pendulum = world.get_model("pendulum").to_gazebo()

# Disable any velocity (and torque) limits of the model, otherwise the velocity
# cannot change too abruptly
_ = [j.set_velocity_limit(np.finfo(float).max) for j in pendulum.joints()]
_ = [j.set_max_generalized_force(np.finfo(float).max) for j in pendulum.joints()]

# Add some friction
assert pendulum.get_joint("pivot").to_gazebo().set_coulomb_friction(value=0.01)
assert pendulum.get_joint("pivot").to_gazebo().set_viscous_friction(value=0.2)
Expand Down Expand Up @@ -76,12 +81,9 @@ def test_velocity_direct(
# Check again
assert pivot.velocity() == pytest.approx(np.pi)

# Change direction abruptly.
# Due to existing joint velocity limits, it takes two steps to reach the target.
# Note: even by increasing the limit to its maximum value, two steps are necessary.
# Change direction abruptly
assert pivot.set_velocity_target(velocity=-np.pi)
assert gazebo.run()
assert gazebo.run()
assert pivot.velocity() == pytest.approx(-np.pi)

# Go in idle and make it swing
Expand Down

0 comments on commit f974456

Please sign in to comment.