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

[v1.0beta2] devel -> master #144

Merged
merged 172 commits into from
Feb 18, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
172 commits
Select commit Hold shift + click to select a range
e34895f
Merge remote-tracking branch 'origin/master' into devel
diegoferigo Oct 21, 2019
84dde03
Merge branch 'master' into devel
diegoferigo Oct 30, 2019
9180940
New base link methods in gympp::Robot interface
diegoferigo Nov 5, 2019
c4e8ca2
Implement base link methods in IgnitionRobot class
diegoferigo Nov 5, 2019
6b6549f
Allow inserting runtime robots with a fixed base
diegoferigo Nov 5, 2019
f246ce2
Update RobotBaseFrame interface
diegoferigo Nov 5, 2019
e6aec2b
New RobotInitialState interface
diegoferigo Nov 5, 2019
32cf2ca
Implement in GazeboRobot the RobotBaseFrame and RobotInitialState ifaces
diegoferigo Nov 5, 2019
9496f6d
Implement GazeboRobot.dofs() method
diegoferigo Nov 5, 2019
34528bc
Implement in PyBulletRobot the RobotBaseFrame and RobotInitialState
diegoferigo Nov 5, 2019
b686412
Bind the std::array<double, 6> type
diegoferigo Nov 5, 2019
ecde0f8
Fix how CMake exposes to users shared / static compilation
diegoferigo Nov 7, 2019
d34440d
Insert pybullet robots in the simulation in their __init__ method
diegoferigo Nov 5, 2019
b0dff1f
Insert gazebo robot in the simulation in their __init__ method
diegoferigo Nov 5, 2019
bb85d94
Initialize all base classes of Robot implementations
diegoferigo Nov 5, 2019
24ec355
Remove empty __init__ methods
diegoferigo Nov 5, 2019
92fcb7a
Update Cartpole and Pendulum models
diegoferigo Nov 5, 2019
a55f594
Configure the base of python Robots objects during initialization
diegoferigo Nov 5, 2019
a6a3432
Add Python test to check robot base features
diegoferigo Nov 5, 2019
24ffb84
Merge pull request #96 from diegoferigo/feature/insert-model-fixed-pose
diegoferigo Nov 7, 2019
9eb728f
Merge branch 'master' into devel
diegoferigo Nov 17, 2019
c540b8f
Add dofs and joint control mode support to C++ Robot classes
diegoferigo Nov 16, 2019
8d0fd6a
Implement set and get joint control mode for GazeboRobot
diegoferigo Nov 16, 2019
147ae7d
Refactor PID support of IgnitionRobot
diegoferigo Nov 23, 2019
8d0936b
Return a PID Python object from a gazebo robot
diegoferigo Dec 17, 2019
5217320
Add utils.py file for python tests
diegoferigo Nov 17, 2019
a7df5e2
Fix and refactor test_rates
diegoferigo Nov 23, 2019
551bd20
Fix GHA
diegoferigo Dec 17, 2019
c9de481
Merge pull request #104 from diegoferigo/feature/controlmode_and_dofs
diegoferigo Dec 19, 2019
15be24e
Improve performance
diegoferigo Dec 17, 2019
3262d38
Update git in PyPI GHA
diegoferigo Dec 19, 2019
2f75833
Merge pull request #106 from diegoferigo/fix/performance_regression
diegoferigo Dec 19, 2019
8e3da2a
Add Robot::initialJointPositions method
diegoferigo Nov 23, 2019
1cc8fc9
Add Robot::jointPositionLimits method
diegoferigo Nov 23, 2019
c89a5e7
Get and set initial joint position and velocity from Python
diegoferigo Dec 17, 2019
e2c689b
Add new Runtime.timestamp() method
diegoferigo Dec 19, 2019
07534e8
Merge pull request #105 from diegoferigo/feature/joint_limits_and_ini…
diegoferigo Dec 19, 2019
9a815ff
Minor edits
diegoferigo Dec 19, 2019
dae886d
Removed duplicate space creation and seeding in demo tasks
diegoferigo Dec 19, 2019
91eed43
Fix CMake variable name
diegoferigo Dec 19, 2019
dbcc131
Minor changes in Python tests
diegoferigo Dec 19, 2019
c5d7de4
Allow models without joints
diegoferigo Dec 19, 2019
5f15341
Add missing interface in all-robot-features dummy class
diegoferigo Dec 19, 2019
3e01bfa
New method GazeboWrapper::getSimulatedTime()
diegoferigo Dec 19, 2019
d5b1184
Implement timestamp method in GazeboRuntime
diegoferigo Dec 19, 2019
5afa959
Implement timestamp method in PyBulletRuntime
diegoferigo Dec 19, 2019
42fde42
Merge pull request #109 from diegoferigo/feature/minor_fixes_and_cleanup
diegoferigo Dec 19, 2019
bf8eb46
Merge pull request #108 from diegoferigo/feature/runtime_timestamp
diegoferigo Dec 19, 2019
26851e7
Import PyBullet lazily
diegoferigo Dec 19, 2019
900d026
Merge pull request #110 from diegoferigo/feature/import_pybullet_lazily
diegoferigo Dec 20, 2019
137e89a
Fix locking a mutex in the first Gazebo simulation step
diegoferigo Dec 20, 2019
afc23ac
Do not pass the SDF content during IgnitionRobot configuration
diegoferigo Dec 20, 2019
f2470c5
Do not modify the ECM in Each() calls during IgnitionRobot configuration
diegoferigo Dec 20, 2019
88cb351
Fix PyPI GHA
diegoferigo Dec 20, 2019
0911ac6
Merge pull request #113 from diegoferigo/fix/gha_bdist
diegoferigo Dec 20, 2019
e7121c3
Merge pull request #112 from diegoferigo/fix/robot_new_ecm_components
diegoferigo Dec 20, 2019
33ee2f0
Merge pull request #111 from diegoferigo/fix/lock
diegoferigo Dec 20, 2019
0f4bc1a
Update Pendulum model
diegoferigo Dec 20, 2019
31b4d80
Update CartPole model
diegoferigo Dec 20, 2019
03aca56
Use a recent sdformat to convert iCubGazeboV2_5 original urdf
diegoferigo Dec 20, 2019
23bf11b
Remove unsupported sensor plugins from iCubGazeboV2_5 model
diegoferigo Dec 20, 2019
deaa871
Update icub-gazebo model.config
diegoferigo Dec 20, 2019
53f556d
Update DefaultEmptyWorld
diegoferigo Dec 20, 2019
3efb761
Fetch all the git history before pushing to PyPI
diegoferigo Dec 20, 2019
b1ed6b6
Remove all the references in the code of the removed sdf models
diegoferigo Dec 20, 2019
381451e
Add a contact sensor to each link when inserting models in Gazebo
diegoferigo Dec 20, 2019
a4aa411
Add contact methods to C++ Robot interface
diegoferigo Dec 17, 2019
45ac300
Add new contact methods to IgnitionRobot class
diegoferigo Dec 17, 2019
51af611
Updated SWIG file with contact struct
diegoferigo Dec 17, 2019
f79c83c
Python robot contact interface
diegoferigo Dec 17, 2019
49f19db
Implement the Python contact interface in GazeboRobot
diegoferigo Dec 17, 2019
73084fe
New pytest test_contacts
diegoferigo Dec 21, 2019
04cd814
Remove the Contact system from DefaultEmptyWorld
diegoferigo Dec 20, 2019
01a5123
Merge pull request #115 from diegoferigo/fix/gha_clone
diegoferigo Dec 21, 2019
5b5bc5f
Merge pull request #114 from diegoferigo/update_models
diegoferigo Dec 22, 2019
354d247
Merge pull request #116 from diegoferigo/feature/contacts
diegoferigo Dec 23, 2019
b0d9e7f
Improved main CMakeLists.txt
diegoferigo Jan 24, 2020
2dd9c45
Update to ignitionrobotics citadel
diegoferigo Jan 24, 2020
ac7cf1e
Updated docker images to citadel
diegoferigo Jan 24, 2020
9ae60b3
Remove build dependency ninja
diegoferigo Jan 24, 2020
d9883f4
Update forward declaration
diegoferigo Jan 24, 2020
715b923
Update deprecated calls
diegoferigo Jan 26, 2020
4ef5912
Fix using namespace
diegoferigo Jan 26, 2020
a0518f7
Update ci gha after test failure
diegoferigo Jan 26, 2020
004472f
Use lazy access to gazebo server everywhere in GazeboWrapper
diegoferigo Jan 26, 2020
720901f
Use gcc7 in gha
diegoferigo Jan 26, 2020
f5e2b98
Merge pull request #122 from diegoferigo/citadel
diegoferigo Jan 26, 2020
eafccdb
New C++ Robot methods for links quantities
diegoferigo Dec 30, 2019
6f467be
Add pose and vector conversion helpers
diegoferigo Dec 27, 2019
38a9795
Remove usage of temporary buffer
diegoferigo Dec 27, 2019
09f77dc
Create components to read link data
diegoferigo Dec 27, 2019
625100d
Implement link methods of IgnitionRobot
diegoferigo Dec 27, 2019
aaa3575
New components to set the world velocity of the model
diegoferigo Dec 30, 2019
822816b
Update base frame methods of IgnitionRobot
diegoferigo Dec 30, 2019
90ed009
Set model base velocity from the Physics system
diegoferigo Dec 30, 2019
9d30e35
Fix documentation typo
diegoferigo Dec 27, 2019
c1fe1e7
Links interface documentation
diegoferigo Dec 30, 2019
2574c53
Implement RobotLinks interface in GazeboRobot class
diegoferigo Dec 30, 2019
852639f
Implement base velocity methods in GazeboRobot class
diegoferigo Dec 30, 2019
6fa894b
Fix velocity calculation in IgnitionRobot class
diegoferigo Jan 26, 2020
186f418
Fix velocity calculation in Physics class
diegoferigo Jan 26, 2020
dfb5567
Update link velocity and acceleration documentation
diegoferigo Jan 27, 2020
3d15fa4
Merge pull request #117 from diegoferigo/feature/robot_links
diegoferigo Jan 27, 2020
7292f50
Fix PyPI workflow
diegoferigo Jan 27, 2020
42b612c
New Robot::addExternalWrench method
diegoferigo Jan 26, 2020
4afdb85
Implement IgnitionRobot::addExternalWrench
diegoferigo Jan 27, 2020
885a90b
New RobotLinks.apply_external_force method
diegoferigo Jan 27, 2020
9f3badd
Implement GazeboRobot.apply_external_force
diegoferigo Jan 27, 2020
c018d97
Move Cube robot to utils test package
diegoferigo Jan 27, 2020
af4c9d7
New test_externalforce test
diegoferigo Jan 27, 2020
3262574
Merge pull request #124 from diegoferigo/feature/external-forces
diegoferigo Jan 27, 2020
6559172
New Robot::jointType method
diegoferigo Jan 27, 2020
939606f
Implement IgnitionRobot::JointType method
diegoferigo Jan 27, 2020
89839de
Add new joint types in Python robot_joint interface
diegoferigo Jan 27, 2020
2b6696f
Implement GazeboRobot.joint_type() method
diegoferigo Jan 28, 2020
5ee8e5b
Update PyBulletRobot.joint_type() method
diegoferigo Jan 27, 2020
fb40fd1
Merge pull request #125 from diegoferigo/feature/joint_type
diegoferigo Jan 28, 2020
9bb70d0
Fix PID controllers update
diegoferigo Feb 6, 2020
62bcd01
Use reference in Robot::update method
diegoferigo Feb 6, 2020
f368769
New helper to convert PID from gympp to ignition math
diegoferigo Feb 6, 2020
d4b7f12
Clean buffer in IgnitionRobot when changing control mode
diegoferigo Feb 6, 2020
64ee04a
Convert if to assert
diegoferigo Feb 6, 2020
12a4e66
Merge pull request #131 from diegoferigo/fix/pids
diegoferigo Feb 6, 2020
ce5174e
Add Panda robot
diegoferigo Feb 11, 2020
ba6cca3
Add robot removal warning message
diegoferigo Feb 11, 2020
409bf8e
Add dummy step between model removal and insertion
diegoferigo Feb 11, 2020
290a5cb
Merge pull request #135 from diegoferigo/feature/panda
diegoferigo Feb 11, 2020
eb21d8f
Add NLP Inverse Kinematics class
diegoferigo Feb 11, 2020
9645203
New inverse kinematics test
diegoferigo Feb 11, 2020
d7c41b0
Explicitly enable IPOPT for iDynTree in Docker images
diegoferigo Feb 11, 2020
f5951ff
Merge pull request #137 from diegoferigo/feature/ik
diegoferigo Feb 11, 2020
5112c0e
Merge pull request #138 from diegoferigo/fix/hard-reset
diegoferigo Feb 12, 2020
e0aea4d
Updated Physics system with upstream
diegoferigo Feb 12, 2020
10d0abe
Merge pull request #140 from diegoferigo/feature/update-physics-system
diegoferigo Feb 12, 2020
cb73ea9
Import bindings always from the gym_ignition package
diegoferigo Feb 12, 2020
150df2b
Improve how dlopen flags are handled in Python
diegoferigo Feb 12, 2020
8afe68f
Merge pull request #142 from diegoferigo/fix/flaky-test
diegoferigo Feb 12, 2020
d5d1497
Store the joint force in the JointForce component
diegoferigo Feb 12, 2020
d964a18
Add new Robot::jointForce() method
diegoferigo Feb 12, 2020
a156194
Implement IgnitionRobot::jointForce() method
diegoferigo Feb 12, 2020
83dbc2e
Add new RobotJoints.joint_force() method
diegoferigo Feb 12, 2020
ef298ed
Implement GazeboRobot.joint_force() method
diegoferigo Feb 12, 2020
8192e7c
Implement dummy PyBulletRobot.joint_force() method
diegoferigo Feb 12, 2020
99a894b
New test_joint_force.py test
diegoferigo Feb 12, 2020
d933ecb
Merge pull request #141 from diegoferigo/feature/extract-applied-join…
diegoferigo Feb 12, 2020
d2ad58e
Install virtualenv in Dockerfiles from repos
diegoferigo Feb 12, 2020
7a94eec
Install eigen3 explicitly in Docker images
diegoferigo Feb 13, 2020
da14e1b
Merge pull request #143 from diegoferigo/fix/docker-images
diegoferigo Feb 13, 2020
5f47ae4
Update README
diegoferigo Feb 13, 2020
64e2461
Fix rocker command for intel GPUs
diegoferigo Feb 13, 2020
b67be2f
Update docker workflow for Citadel
diegoferigo Feb 13, 2020
2301461
Update colab
diegoferigo Feb 13, 2020
0063704
Always unshallow git tree in GHA
diegoferigo Feb 13, 2020
96ac407
Update example
diegoferigo Feb 13, 2020
1e6a0a4
Clean setup.py
diegoferigo Feb 13, 2020
a2af085
Cache joint names in gazebo robot
diegoferigo Feb 13, 2020
179377d
Save the seed in the Task class
diegoferigo Feb 13, 2020
ee8e39d
Store the agent_rate in the Task class
diegoferigo Feb 13, 2020
3137386
Update runtimes to pass the agent_rate option
diegoferigo Feb 13, 2020
3906b7a
Update tasks to accept the agent_rate option
diegoferigo Feb 13, 2020
c16b100
Load pybullet lazily
diegoferigo Feb 13, 2020
a3ae387
Merge pull request #146 from diegoferigo/feature/cache-join-names
diegoferigo Feb 13, 2020
9395cbd
Merge pull request #148 from diegoferigo/feature/save-the-seed
diegoferigo Feb 13, 2020
6a34e3b
Merge pull request #149 from diegoferigo/feature/load-pybullet-lazily
diegoferigo Feb 13, 2020
b146a53
Merge pull request #150 from diegoferigo/feature/store-agent-rate-in-…
diegoferigo Feb 13, 2020
6249a35
Update cartpole and pendulum to use models from gym-ignition-models
diegoferigo Feb 13, 2020
4917eb2
Update test_robot_base to use logic from utils package
diegoferigo Feb 13, 2020
07127bb
Disabled test_robot_base.test_robot_floating_base test
diegoferigo Feb 13, 2020
b726e50
Move model_file logic to the CubeGazeboRobot class in utils test package
diegoferigo Feb 13, 2020
6eb2291
Merge pull request #147 from diegoferigo/feature/use-gym-ignition-models
diegoferigo Feb 14, 2020
a73ccbe
Merge pull request #145 from diegoferigo/update-readme
diegoferigo Feb 14, 2020
715d89a
Update README
diegoferigo Feb 14, 2020
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions .docker/Dockerfile.ci
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,13 @@ RUN apt-get update &&\
python3.7 \
libpython3.6-dev \
libpython3.7-dev \
virtualenv \
swig \
&&\
rm -rf /var/lib/apt/lists/*

# Install ignition robotics
ARG ignition_codename="blueprint"
ARG ignition_codename="citadel"
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 All @@ -49,7 +50,7 @@ RUN echo "deb http://packages.osrfoundation.org/gazebo/ubuntu-stable `lsb_releas

# Install idyntree
RUN apt-get update &&\
apt-get install -y --no-install-recommends python3-numpy libxml2-dev coinor-libipopt-dev &&\
apt-get install -y --no-install-recommends python3-numpy libxml2-dev coinor-libipopt-dev libeigen3-dev &&\
rm -rf /var/lib/apt/lists/* &&\
git clone --depth 1 -b feature/numpy-and-ik https://github.com/diegoferigo/idyntree /tmp/idyntree &&\
mkdir -p /tmp/idyntree/build && cd /tmp/idyntree/build &&\
Expand All @@ -60,6 +61,7 @@ RUN apt-get update &&\
-DPython_ADDITIONAL_VERSIONS=3.6 \
-DIDYNTREE_USES_PYTHON_VERSION=3.6 \
-DPYTHON_NUMPY_INCLUDE_DIR:PATH=/usr/lib/python3/dist-packages/numpy/core/include \
-DIDYNTREE_USES_IPOPT:BOOL=ON \
&&\
cmake --build . --target install &&\
rm -r /tmp/idyntree
Expand Down
3 changes: 2 additions & 1 deletion .docker/Dockerfile.latest
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,12 @@ RUN apt-get update &&\
python3-pip \
python3.6 \
libpython3.6-dev \
virtualenv \
&&\
rm -rf /var/lib/apt/lists/*

# Install ignition gazebo
ARG ignition_codename="blueprint"
ARG ignition_codename="citadel"
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
6 changes: 4 additions & 2 deletions .docker/Dockerfile.pypi
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,14 @@ RUN apt-get update &&\
python3-pip \
python3.6 \
libpython3.6-dev \
virtualenv \
swig \
rename \
&&\
rm -rf /var/lib/apt/lists/*

# Install ignition robotics
ARG ignition_codename="blueprint"
ARG ignition_codename="citadel"
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 All @@ -42,7 +43,7 @@ RUN echo "deb http://packages.osrfoundation.org/gazebo/ubuntu-stable `lsb_releas

# Install idyntree (statically compiled)
RUN apt-get update &&\
apt-get install -y --no-install-recommends python3-numpy libxml2-dev coinor-libipopt-dev &&\
apt-get install -y --no-install-recommends python3-numpy libxml2-dev coinor-libipopt-dev libeigen3-dev &&\
rm -rf /var/lib/apt/lists/* &&\
git clone --depth 1 -b feature/numpy-and-ik https://github.com/diegoferigo/idyntree /tmp/idyntree &&\
mkdir -p /tmp/idyntree/build && cd /tmp/idyntree/build &&\
Expand All @@ -54,6 +55,7 @@ RUN apt-get update &&\
-DIDYNTREE_USES_PYTHON_VERSION=3.6 \
-DPYTHON_NUMPY_INCLUDE_DIR:PATH=/usr/lib/python3/dist-packages/numpy/core/include \
-DBUILD_SHARED_LIBS:BOOL=OFF \
-DIDYNTREE_USES_IPOPT:BOOL=ON \
&&\
cmake --build . --target install &&\
rm -r /tmp/idyntree
Expand Down
3 changes: 0 additions & 3 deletions .docker/setup_virtualenv.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,6 @@ if [ ! -x $(type -P ${PYTHON_EXE}) ] ; then
exit 1
fi

# Install virtualenv
pip3 install virtualenv

# Create an empty virtualenv and enable it by default
virtualenv -p $PYTHON_EXE ${VIRTUAL_ENV}

Expand Down
31 changes: 22 additions & 9 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,16 +13,24 @@ jobs:
python: [3.6]
build_type: [Debug]
compiler:
- gcc8
- clang7
- clang8
- gcc7
#- gcc8
#- clang7
#- clang8
container:
image: diegoferigo/gym-ignition:ci-master
env:
PYTHON_VERSION: ${{ matrix.python }}

steps:
- name: Update git
run: |
add-apt-repository ppa:git-core/ppa
apt update
apt install -y git

- uses: actions/checkout@master
- run: git fetch --prune --unshallow

# The entrypoint is not called because it is overridden by GH Actions.
# Even using the 'jobs.<job_id>.container.options' does not work because the
Expand Down Expand Up @@ -71,8 +79,7 @@ jobs:
run: |
pip3 install colour-valgrind
cd tests/python
valgrind --log-file=/tmp/valgrind.log pytest -v -s
colour-valgrind -t /tmp/valgrind.log
valgrind --log-file=/tmp/valgrind.log pytest -v -s || colour-valgrind -t /tmp/valgrind.log

user:
name: User installation
Expand All @@ -87,11 +94,18 @@ jobs:
image: diegoferigo/gym-ignition:ci-master
env:
PYTHON_VERSION: ${{ matrix.python }}
CC: gcc-8
CXX: g++-8
CC: gcc-7
CXX: g++-7

steps:
- name: Update git
run: |
add-apt-repository ppa:git-core/ppa
apt update
apt install -y git

- uses: actions/checkout@master
- run: git fetch --prune --unshallow

# The entrypoint is not called because it is overridden by GH Actions.
# Even using the 'jobs.<job_id>.container.options' does not work because the
Expand All @@ -117,5 +131,4 @@ jobs:
run: |
pip3 install colour-valgrind
cd tests/python
valgrind --log-file=/tmp/valgrind.log pytest -v -s
colour-valgrind -t /tmp/valgrind.log
valgrind --log-file=/tmp/valgrind.log pytest -v -s || colour-valgrind -t /tmp/valgrind.log
6 changes: 1 addition & 5 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,9 @@ jobs:
- latest
- nightly
include:
- tag: ci-devel
extra_docker_options: --build-arg ignition_codename='blueprint'
- tag: pypi-devel
extra_docker_options: --build-arg ignition_codename='blueprint'
- tag: nightly
extra_docker_options: |
--build-arg pypi_package='gym-ignition-nightly' --build-arg ignition_codename='blueprint' --build-arg branch='devel' \
--build-arg pypi_package='gym-ignition-nightly' --build-arg branch='devel' \

steps:
- uses: actions/checkout@master
Expand Down
46 changes: 33 additions & 13 deletions .github/workflows/pypi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,19 @@ jobs:
# setup with ignition robotics installed from the official ppa
image: diegoferigo/gym-ignition:ci-master
env:
CC: gcc-8
CXX: g++-8
CC: gcc-7
CXX: g++-7
PYTHON_VERSION: ${{ matrix.python_version }}

steps:
- uses: actions/checkout@master
- name: Update git
run: |
add-apt-repository ppa:git-core/ppa
apt update
apt install -y git

- uses: actions/checkout@v2
- run: git fetch --prune --unshallow

# The entrypoint is not called because it is overridden by GH Actions.
# Even using the 'jobs.<job_id>.container.options' does not work because the
Expand All @@ -53,7 +60,7 @@ jobs:
- name: Python tests
run: |
cd tests/python
pytest
pytest -v

# ========================
# TEST BDIST_WHEEL PACKAGE
Expand All @@ -72,14 +79,21 @@ jobs:
runs-on: ${{ matrix.os }}

steps:
- uses: actions/checkout@master
- name: Update git
run: |
sudo add-apt-repository ppa:git-core/ppa
sudo apt update
sudo apt install -y git

- uses: actions/checkout@v2
- run: git fetch --prune --unshallow

# Workaround to export environment variables that persist in next steps
# https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps
- name: Setup Environment
run: |
echo "::set-env name=CC::gcc-8"
echo "::set-env name=CXX::g++-8"
echo "::set-env name=CC::gcc-7"
echo "::set-env name=CXX::g++-7"
echo "::set-env name=PYTHON_VERSION::${{ matrix.python_version }}"
env

Expand All @@ -103,16 +117,15 @@ jobs:
docker run \
-d -i --name test -e PYTHON_VERSION=$PYTHON_VERSION \
-v $(pwd)/dist:/dist \
-v $(pwd)/tests:/tests \
diegoferigo/gym-ignition:ci-master bash
sleep 15

- name: Install bdist
run: docker exec -i -w /dist test sh -c 'pip install *.whl'

- name: Python tests
run: |
docker exec -i test sh -c "git clone https://github.com/robotology/gym-ignition"
docker exec -i test sh -c "cd gym-ignition/tests/python && pytest -v"
run: docker exec -i -w /tests/python test sh -c 'pytest -v'

# =============
# PUSH PACKAGES
Expand All @@ -132,12 +145,19 @@ jobs:
container:
image: diegoferigo/gym-ignition:ci-master
env:
CC: gcc-8
CXX: g++-8
CC: gcc-7
CXX: g++-7
PYTHON_VERSION: ${{ matrix.python_version }}

steps:
- uses: actions/checkout@master
- name: Update git
run: |
add-apt-repository ppa:git-core/ppa
apt update
apt install -y git

- uses: actions/checkout@v2
- run: git fetch --prune --unshallow

# Validate the last tag accordingly to PEP440
# From https://stackoverflow.com/a/37972030/12150968
Expand Down
48 changes: 28 additions & 20 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# GNU Lesser General Public License v2.1 or any later version.

cmake_minimum_required(VERSION 3.12)
project(Gympp VERSION 0.1)
project(GymIgnition VERSION 0.1)

# C++ standard
set(CMAKE_CXX_STANDARD 17)
Expand All @@ -18,31 +18,35 @@ if(NOT CMAKE_CONFIGURATION_TYPES)
set(CMAKE_BUILD_TYPE "Release" CACHE STRING
"Choose the type of build, recommended options are: Debug or Release" FORCE)
endif()
set(GYMPP_BUILD_TYPES "Debug" "Release" "MinSizeRel" "RelWithDebInfo")
set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS ${GYMPP_BUILD_TYPES})
set(GYMIGNITION_BUILD_TYPES "Debug" "Release" "MinSizeRel" "RelWithDebInfo")
set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS ${GYMIGNITION_BUILD_TYPES})
endif()

# This new build mode configures the CMake project to be compatible with the pipeline to
# create the PyPI linux wheel
include(cmake/AddNewBuildMode.cmake)
add_new_build_mode(NAME "PyPI" TEMPLATE "Release")

if(CMAKE_BUILD_TYPE STREQUAL "PyPI")
# Expose shared or static compilation
set(GYMIGNITION_BUILD_SHARED_LIBRARY TRUE
CACHE BOOL "Compile libraries as shared libraries")

if(NOT ${CMAKE_BUILD_TYPE} STREQUAL "PyPI")
# Apply the user choice
set(BUILD_SHARED_LIBS ${GYMIGNITION_BUILD_SHARED_LIBRARY})
else()
# Check that is Linux
if(NOT (UNIX AND NOT APPLE))
message(FATAL_ERROR "PyPI packages can be only created for Linux at the moment")
endif()

# Compile libraries as static, if possible
set(GYMPP_BUILD_SHARED_LIBRARY FALSE
CACHE BOOL "Compile libraries as shared libraries" FORCE)
else()
set(GYMPP_BUILD_SHARED_LIBRARY TRUE BOOL
CACHE BOOL "Compile libraries as shared libraries")
endif()
if(${GYMIGNITION_BUILD_SHARED_LIBRARY})
message(WARNING "Enabling static compilation, required by the PyPI build mode")
endif()

# Set the final option for shared / static libraries
set(BUILD_SHARED_LIBS ${GYMPP_BUILD_SHARED_LIBRARY})
# Force static compilation
set(BUILD_SHARED_LIBS FALSE)
endif()

# Use -fPIC even if statically compiled
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
Expand All @@ -64,8 +68,8 @@ set(CMAKE_LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/${CMAKE_INSTALL_LIBDIR}"
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/${CMAKE_INSTALL_LIBDIR}")

# Get include-what-you-use information when compiling
option(USE_IWYU "Get the output of include-what-you-use" OFF)
if(USE_IWYU)
option(GYMIGNITION_USE_IWYU "Get the output of include-what-you-use" OFF)
if(GYMIGNITION_USE_IWYU)
find_program(IWYU_PATH NAMES include-what-you-use iwyu)
if(IWYU_PATH)
set(CMAKE_CXX_INCLUDE_WHAT_YOU_USE ${IWYU_PATH})
Expand Down Expand Up @@ -106,12 +110,16 @@ add_subdirectory(deps)
# Add the C++ sources subdirectory
add_subdirectory(gympp)

# This target is not found automatically when searching for 'all' components and
# ign-gazebo is statically compiled. Adding this find_package here solves the problem.
find_package(ignition-gazebo2-gui)
# ========
# IGNITION
# ========

find_package(ignition-gazebo3 COMPONENTS all)
option(GYMIGNITION_USE_IGNITION
"Build C++ code depending on Ignition Robotics" ${ignition-gazebo3_FOUND})

find_package(ignition-gazebo2 COMPONENTS all)
if(ignition-gazebo2_FOUND)
# Add the targets depending on Ignition Robotics
if(${GYMIGNITION_USE_IGNITION})
add_subdirectory(ignition)
add_subdirectory(plugins)
add_subdirectory(gym_ignition_data)
Expand Down
Loading