Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
53 changes: 53 additions & 0 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
variables:
GIT_SUBMODULE_STRATEGY: "recursive"
GIT_DEPTH: "3"
CCACHE_BASEDIR: "${CI_PROJECT_DIR}"
CCACHE_DIR: "${CI_PROJECT_DIR}/ccache"

cache:
paths:
- ccache

.robotpkg-py-dynamic-graph-tutorial: &robotpkg-py-dynamic-graph-tutorial
except:
- gh-pages
script:
- mkdir -p ccache
- cd /root/robotpkg/wip/py-dynamic-graph-tutorial
- git pull
- make checkout MASTER_REPOSITORY="dir ${CI_PROJECT_DIR}"
- make install
- cd work.$(hostname)/$(make show-var VARNAME=DISTNAME)
- make test

robotpkg-py-dynamic-graph-tutorial-14.04-release:
<<: *robotpkg-py-dynamic-graph-tutorial
image: eur0c.laas.fr:5000/stack-of-tasks/dynamic-graph-tutorial/py-dynamic-graph-tutorial:14.04

robotpkg-py-dynamic-graph-tutorial-16.04-release:
<<: *robotpkg-py-dynamic-graph-tutorial
image: eur0c.laas.fr:5000/stack-of-tasks/dynamic-graph-tutorial/py-dynamic-graph-tutorial:16.04

robotpkg-py-dynamic-graph-tutorial-18.04-release:
<<: *robotpkg-py-dynamic-graph-tutorial
image: eur0c.laas.fr:5000/stack-of-tasks/dynamic-graph-tutorial/py-dynamic-graph-tutorial:18.04

doc-coverage:
<<: *robotpkg-py-dynamic-graph-tutorial
image: eur0c.laas.fr:5000/stack-of-tasks/dynamic-graph-tutorial/py-dynamic-graph-tutorial:16.04
before_script:
- echo -e 'CXXFLAGS+= --coverage\nLDFLAGS+= --coverage\nPKG_DEFAULT_OPTIONS= debug' >> /opt/openrobots/etc/robotpkg.conf
after_script:
- cd /root/robotpkg/wip/py-dynamic-graph-tutorial
- cd work.$(hostname)/$(make show-var VARNAME=DISTNAME)
- make doc
- mv doc/doxygen-html ${CI_PROJECT_DIR}
- mkdir -p ${CI_PROJECT_DIR}/coverage/
- gcovr -r .
- gcovr -r . --html --html-details -o ${CI_PROJECT_DIR}/coverage/index.html
artifacts:
expire_in: 1 day
paths:
- doxygen-html/
- coverage/

1 change: 0 additions & 1 deletion AUTHORS

This file was deleted.

43 changes: 20 additions & 23 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,44 +1,41 @@
#
# Copyright 2010 CNRS
# Copyright 2010, 2018 CNRS
# Author: Florent Lamiraux
#

CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
CMAKE_MINIMUM_REQUIRED(VERSION 2.8)

SET (CXX_DISABLE_WERROR ON)
INCLUDE(cmake/base.cmake)
INCLUDE(cmake/boost.cmake)
INCLUDE(cmake/lapack.cmake)
INCLUDE(cmake/cpack.cmake)
INCLUDE(cmake/test.cmake)
INCLUDE(cmake/python.cmake)

SET(PROJECT_NAME dynamic-graph-tutorial)
project(${PROJECT_NAME})

SET(PROJECT_DESCRIPTION "Tutorial for dynamic-graph")
SET(PROJECT_URL "http://github.com/jrl-umi3218/dynamic-graph-tutorial")

SET(${PROJECT_NAME}_HEADERS
include/dynamic-graph/tutorial/inverted-pendulum.hh
include/dynamic-graph/tutorial/feedback-controller.hh
)
#
# Look for dependencies
#
SET(PROJECT_URL "http://github.com/stack-of-tasks/${PROJECT_NAME}")

SETUP_PROJECT()

#
# Documentation dependency to package dynamic-graph
#

ADD_REQUIRED_DEPENDENCY("dynamic-graph")

#
# Dependency to package dynamic-graph-python
#
ADD_REQUIRED_DEPENDENCY("dynamic-graph-python")
SET(BOOST_COMPONENTS unit_test_framework)

OPTION (BUILD_PYTHON_INTERFACE "Build the python binding" ON)
IF(BUILD_PYTHON_INTERFACE)
ADD_REQUIRED_DEPENDENCY("dynamic-graph-python")
FINDPYTHON()
STRING(REGEX REPLACE "-" "_" PY_NAME ${PROJECT_NAME})
SET(BOOST_COMPONENTS ${BOOST_COMPONENTS} python)
INCLUDE_DIRECTORIES(${PYTHON_INCLUDE_DIRS})
ENDIF(BUILD_PYTHON_INTERFACE)

SEARCH_FOR_BOOST()
INCLUDE_DIRECTORIES(${Boost_INCLUDE_DIRS})

ADD_SUBDIRECTORY(include/dynamic-graph/tutorial)
ADD_SUBDIRECTORY(src)
ADD_SUBDIRECTORY(doc)
ADD_SUBDIRECTORY(tests)

SETUP_PROJECT_FINALIZE()
15 changes: 0 additions & 15 deletions COPYING

This file was deleted.

1 change: 0 additions & 1 deletion ChangeLog

This file was deleted.

21 changes: 0 additions & 21 deletions INSTALL

This file was deleted.

1 change: 0 additions & 1 deletion NEWS

This file was deleted.

9 changes: 7 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
[![License](https://img.shields.io/badge/License-BSD%202--Clause-orange.svg)](https://opensource.org/licenses/BSD-2-Clause)
# dynamic-graph-tutorial

[![License](https://img.shields.io/badge/License-BSD%202--Clause-orange.svg)](https://opensource.org/licenses/BSD-2-Clause)
[![Building Status](https://travis-ci.org/stack-of-tasks/dynamic-graph-tutorial.svg?branch=master)](https://travis-ci.org/stack-of-tasks/dynamic-graph-tutorial)
[![Pipeline status](https://gepgitlab.laas.fr/stack-of-tasks/dynamic-graph-tutorial/badges/master/pipeline.svg)](https://gepgitlab.laas.fr/stack-of-tasks/dynamic-graph-tutorial/commits/master)
[![Coverage report](https://gepgitlab.laas.fr/stack-of-tasks/dynamic-graph-tutorial/badges/master/coverage.svg?job=doc-coverage)](http://projects.laas.fr/stack-of-tasks/doc/stack-of-tasks/dynamic-graph-tutorial/master/coverage/)


See INSTALL for installation instruction.

The documentation is available here:
[http://stack-of-tasks.github.io/dynamic-graph-tutorial/](http://stack-of-tasks.github.io/dynamic-graph-tutorial/)
[http://stack-of-tasks.github.io/dynamic-graph-tutorial/](http://stack-of-tasks.github.io/dynamic-graph-tutorial/)
3 changes: 0 additions & 3 deletions autogen.sh

This file was deleted.

13 changes: 0 additions & 13 deletions dg-tutorial.pc.cmake

This file was deleted.

9 changes: 9 additions & 0 deletions include/dynamic-graph/tutorial/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
SET(${PROJECT_NAME}_HEADERS}
inverted-pendulum.hh
feedback-controller.hh
)

INSTALL(FILES
${${PROJECT_NAME}_HEADERS}
DESTINATION include/${PROJECT_NAME}
)
40 changes: 15 additions & 25 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2010, Florent Lamiraux, CNRS
# Copyright 2010, 2018, Florent Lamiraux, CNRS
#
# This file is part of sot-core.
# sot-core is free software: you can redistribute it and/or
Expand All @@ -13,33 +13,23 @@
# received a copy of the GNU Lesser General Public License along with
# dynamic-graph-tutorial. If not, see <http://www.gnu.org/licenses/>.

# Libraries DEFINITIONS and INCLUDES

INCLUDE(../cmake/python.cmake)

SET(LIBRARY_NAME ${PROJECT_NAME})

INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/include)

# provide path to dependency libraries
LINK_DIRECTORIES(${DYNAMIC_GRAPH_PYTHON_LIBRARY_DIRS} ${PYTHON_LIBRARY_DIRS})

ADD_LIBRARY(${LIBRARY_NAME}
SHARED
inverted-pendulum.cc
feedback-controller.cc
SET(${PROJECT_NAME}_SOURCES
inverted-pendulum
feedback-controller
)

SET_TARGET_PROPERTIES(${LIBRARY_NAME}
PROPERTIES
SOVERSION ${PROJECT_VERSION}
INSTALL_RPATH ${CMAKE_INSTALL_PREFIX}/lib)
SET(${PY_NAME}_PYTHON
simu.py
)

# Add dynamic-graph-python compilation flags and link to dependency libraries
PKG_CONFIG_USE_DEPENDENCY(${PROJECT_NAME} dynamic-graph-python)
ADD_LIBRARY(${PROJECT_NAME} SHARED ${${PROJECT_NAME}_SOURCES})
PKG_CONFIG_USE_DEPENDENCY(${PROJECT_NAME} dynamic-graph)

INSTALL(TARGETS ${LIBRARY_NAME}
DESTINATION ${CMAKE_INSTALL_PREFIX}/lib)
IF(BUILD_PYTHON_INTERFACE)
PKG_CONFIG_USE_DEPENDENCY(${PROJECT_NAME} dynamic-graph-python)
DYNAMIC_GRAPH_PYTHON_MODULE("tutorial" ${PROJECT_NAME} wrap)
INSTALL(FILES ${${PY_NAME}_PYTHON} DESTINATION "${PYTHON_SITELIB}/dynamic-graph/tutorial/")
ENDIF(BUILD_PYTHON_INTERFACE)

# Create a python module containing new Python entity classes
DYNAMIC_GRAPH_PYTHON_MODULE("tutorial" ${LIBRARY_NAME} wrap)
INSTALL(TARGETS ${PROJECT_NAME} DESTINATION lib)
File renamed without changes.
File renamed without changes.
9 changes: 9 additions & 0 deletions tests/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
ADD_DEFINITIONS(-DBOOST_TEST_DYN_LINK -DBOOST_TEST_MAIN)

ADD_UNIT_TEST(pendulum pendulum)
TARGET_LINK_LIBRARIES(pendulum ${PROJECT_NAME} ${Boost_UNIT_TEST_FRAMEWORK_LIBRARY})
PKG_CONFIG_USE_DEPENDENCY(pendulum dynamic-graph)

ADD_UNIT_TEST(controller controller)
TARGET_LINK_LIBRARIES(controller ${PROJECT_NAME} ${Boost_UNIT_TEST_FRAMEWORK_LIBRARY})
PKG_CONFIG_USE_DEPENDENCY(controller dynamic-graph)
12 changes: 12 additions & 0 deletions tests/controller.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#include <boost/test/unit_test.hpp>

#include "dynamic-graph/tutorial/feedback-controller.hh"

BOOST_AUTO_TEST_SUITE ( BOOST_TEST_MODULE )

BOOST_AUTO_TEST_CASE(test_controller)
{
dynamicgraph::tutorial::FeedbackController controller("test controller");
}

BOOST_AUTO_TEST_SUITE_END()
18 changes: 18 additions & 0 deletions tests/pendulum.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#include <boost/test/unit_test.hpp>

#include "dynamic-graph/tutorial/inverted-pendulum.hh"

BOOST_AUTO_TEST_SUITE ( BOOST_TEST_MODULE )

BOOST_AUTO_TEST_CASE(test_pendulum)
{
dynamicgraph::tutorial::InvertedPendulum pendulum("test pendulum");
pendulum.setCartMass(1.2);
BOOST_CHECK(pendulum.getCartMass() == 1.2);
pendulum.setPendulumMass(0.6);
BOOST_CHECK(pendulum.getPendulumMass() == 0.6);
pendulum.setPendulumLength(1.8);
BOOST_CHECK(pendulum.getPendulumLength() == 1.8);
}

BOOST_AUTO_TEST_SUITE_END()
24 changes: 0 additions & 24 deletions unitTesting/CMakeLists.txt

This file was deleted.

10 changes: 0 additions & 10 deletions unitTesting/main.cc

This file was deleted.

11 changes: 0 additions & 11 deletions unitTesting/sot-tutorial-test.cc

This file was deleted.

24 changes: 0 additions & 24 deletions unitTesting/sot-tutorial-test.hh

This file was deleted.