Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
  • ostasse/dynamic-graph-python
  • gsaurel/dynamic-graph-python
  • stack-of-tasks/dynamic-graph-python
3 results
Show changes
Commits on Source (106)
Showing
with 265 additions and 251 deletions
# pre-commit run -a (Guilhem Saurel, 2022-07-27)
db4d991c9d727b8454695ce8d88948b948c6b36f
[submodule "cmake"]
path = cmake
url = git://github.com/jrl-umi3218/jrl-cmakemodules.git
[submodule ".travis"]
path = .travis
url = git://github.com/jrl-umi3218/jrl-travis
url = https://github.com/jrl-umi3218/jrl-cmakemodules.git
exclude: tests/test_python-syntax_error.py
ci:
autoupdate_branch: 'devel'
repos:
- repo: https://github.com/pre-commit/mirrors-clang-format
rev: v14.0.6
hooks:
- id: clang-format
args: [--style=Google]
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.3.0
hooks:
- id: check-added-large-files
- id: check-ast
- id: check-executables-have-shebangs
- id: check-json
- id: check-merge-conflict
- id: check-symlinks
- id: check-toml
- id: check-yaml
- id: debug-statements
- id: destroyed-symlinks
- id: detect-private-key
- id: end-of-file-fixer
- id: fix-byte-order-marker
- id: mixed-line-ending
- id: trailing-whitespace
- repo: https://github.com/psf/black
rev: 22.8.0
hooks:
- id: black
- repo: https://github.com/PyCQA/flake8
rev: 5.0.4
hooks:
- id: flake8
- repo: https://github.com/cheshirekow/cmake-format-precommit
rev: v0.6.13
hooks:
- id: cmake-format
Subproject commit cbc92f81bdd0dcfd7fc1eae56801d8111267937d
language: cpp
sudo: required
compiler:
- gcc
- clang
env:
global:
- secure: "ECiHIh0aT5ml/MdKifvFIM2UpDWiPsJPEZpafLYM8U0VAPYThSfUe8JWhMsky8amOwm38akbSbr6C7iBKVpzjAqpgNdOdufO1RUZ6pUvtlVXiXTw2KlqPqbDVlD3QroVDhnX/rIRcg5ezEHAIb594uEaHdf8tlikhjdTc3aAgMA="
- APT_DEPENDENCIES="doxygen doxygen-latex libboost-all-dev libeigen3-dev liblapack-dev libblas-dev gfortran python-dev python-sphinx"
- GIT_DEPENDENCIES="stack-of-tasks/dynamic-graph"
- LCOV_IGNORE_RULES="*unitTesting*"
allow_failures:
- compiler: clang
notifications:
email:
- hpp-source@laas.fr
branches:
only:
- master
- devel
script: ./.travis/run build
script: ./travis_custom/build_custom
after_success: ./.travis/run after_success
after_failure: ./.travis/run after_failure
before_install: ./travis_custom/custom_before_install
matrix:
allow_failures:
- compiler: clang
# Copyright 2010-2020, Florent Lamiraux, Thomas Moulard, Olivier Stasse, Guilhem Saurel, JRL, CNRS/AIST, LAAS-CNRS
# Copyright 2010-2020, Florent Lamiraux, Thomas Moulard, Olivier Stasse, Guilhem
# Saurel, JRL, CNRS/AIST, LAAS-CNRS
CMAKE_MINIMUM_REQUIRED(VERSION 3.1)
cmake_minimum_required(VERSION 3.1)
# Project properties
SET(PROJECT_ORG stack-of-tasks)
SET(PROJECT_NAME dynamic-graph-python)
SET(PROJECT_DESCRIPTION "Dynamic graph library Python bindings")
SET(PROJECT_URL "https://github.com/${PROJECT_ORG}/${PROJECT_NAME}")
set(PROJECT_ORG stack-of-tasks)
set(PROJECT_NAME dynamic-graph-python)
set(PROJECT_DESCRIPTION "Dynamic graph library Python bindings")
set(PROJECT_URL "https://github.com/${PROJECT_ORG}/${PROJECT_NAME}")
# Project options
OPTION(SUFFIX_SO_VERSION "Suffix library name with its version" ON)
option(SUFFIX_SO_VERSION "Suffix library name with its version" ON)
# Project configuration
SET(PROJECT_USE_CMAKE_EXPORT TRUE)
SET(CUSTOM_HEADER_DIR "dynamic-graph/python")
SET(CXX_DISABLE_WERROR TRUE)
SET(DOXYGEN_USE_MATHJAX YES)
set(PROJECT_USE_CMAKE_EXPORT TRUE)
set(CUSTOM_HEADER_DIR "dynamic-graph/python")
set(CXX_DISABLE_WERROR TRUE)
set(DOXYGEN_USE_MATHJAX YES)
# JRL-cmakemodule setup
INCLUDE(cmake/base.cmake)
INCLUDE(cmake/boost.cmake)
INCLUDE(cmake/python.cmake)
include(cmake/base.cmake)
include(cmake/boost.cmake)
# Project definition
COMPUTE_PROJECT_ARGS(PROJECT_ARGS LANGUAGES CXX)
PROJECT(${PROJECT_NAME} ${PROJECT_ARGS})
compute_project_args(PROJECT_ARGS LANGUAGES CXX)
project(${PROJECT_NAME} ${PROJECT_ARGS})
check_minimal_cxx_standard(14 ENFORCE)
# Project dependencies
FINDPYTHON()
ADD_PROJECT_DEPENDENCY(dynamic-graph REQUIRED PKG_CONFIG_REQUIRES dynamic-graph)
ADD_PROJECT_DEPENDENCY(eigenpy REQUIRED PKG_CONFIG_REQUIRES eigenpy)
SEARCH_FOR_BOOST_PYTHON(REQUIRED)
IF(BUILD_TESTING)
FIND_PACKAGE(Boost REQUIRED COMPONENTS unit_test_framework)
ENDIF(BUILD_TESTING)
set(PYTHON_COMPONENTS Interpreter Development NumPy)
add_project_dependency(dynamic-graph 4.4.0 REQUIRED)
add_project_dependency(eigenpy 2.7.10 REQUIRED)
set(PYTHON_EXPORT_DEPENDENCY_MACROS
"list(APPEND PYTHON_COMPONENTS ${PYTHON_COMPONENTS})\n${PYTHON_EXPORT_DEPENDENCY_MACROS}"
)
if(BUILD_TESTING)
find_package(Boost REQUIRED COMPONENTS unit_test_framework)
endif(BUILD_TESTING)
if(Boost_VERSION GREATER 107299 OR Boost_VERSION_MACRO GREATER 107299)
# Silence a warning about a deprecated use of boost bind by boost >= 1.73
# without dropping support for boost < 1.73
add_definitions(-DBOOST_BIND_GLOBAL_PLACEHOLDERS)
endif()
# Main Library
SET(${PROJECT_NAME}_HEADERS
include/${CUSTOM_HEADER_DIR}/api.hh
include/${CUSTOM_HEADER_DIR}/convert-dg-to-py.hh
include/${CUSTOM_HEADER_DIR}/dynamic-graph-py.hh
include/${CUSTOM_HEADER_DIR}/interpreter.hh
include/${CUSTOM_HEADER_DIR}/module.hh
include/${CUSTOM_HEADER_DIR}/python-compat.hh
include/${CUSTOM_HEADER_DIR}/signal.hh
include/${CUSTOM_HEADER_DIR}/signal-wrapper.hh
)
SET(${PROJECT_NAME}_SOURCES
src/interpreter.cc
src/dynamic_graph/python-compat.cc
src/dynamic_graph/entity-py.cc
src/dynamic_graph/convert-dg-to-py.cc
)
ADD_LIBRARY(${PROJECT_NAME} SHARED
${${PROJECT_NAME}_SOURCES} ${${PROJECT_NAME}_HEADERS})
TARGET_INCLUDE_DIRECTORIES(${PROJECT_NAME} SYSTEM PUBLIC ${PYTHON_INCLUDE_DIR})
TARGET_INCLUDE_DIRECTORIES(${PROJECT_NAME} PUBLIC $<INSTALL_INTERFACE:include>)
TARGET_LINK_LIBRARIES(${PROJECT_NAME} PUBLIC ${PYTHON_LIBRARY}
dynamic-graph::dynamic-graph)
TARGET_LINK_BOOST_PYTHON(${PROJECT_NAME} PRIVATE)
IF(SUFFIX_SO_VERSION)
SET_TARGET_PROPERTIES(${PROJECT_NAME} PROPERTIES SOVERSION ${PROJECT_VERSION})
ENDIF(SUFFIX_SO_VERSION)
TARGET_COMPILE_DEFINITIONS(${PROJECT_NAME} PRIVATE PYTHON_LIBRARY="${PYTHON_LIBRARY}")
INSTALL(TARGETS ${PROJECT_NAME} EXPORT ${TARGETS_EXPORT_NAME} DESTINATION lib)
ADD_SUBDIRECTORY(src)
IF(BUILD_TESTING)
ADD_SUBDIRECTORY(tests)
ENDIF(BUILD_TESTING)
PKG_CONFIG_APPEND_LIBS(${PROJECT_NAME})
INSTALL(FILES package.xml DESTINATION share/${PROJECT_NAME})
set(${PROJECT_NAME}_HEADERS
include/${CUSTOM_HEADER_DIR}/api.hh
include/${CUSTOM_HEADER_DIR}/convert-dg-to-py.hh
include/${CUSTOM_HEADER_DIR}/dynamic-graph-py.hh
include/${CUSTOM_HEADER_DIR}/fwd.hh
include/${CUSTOM_HEADER_DIR}/interpreter.hh
include/${CUSTOM_HEADER_DIR}/module.hh
include/${CUSTOM_HEADER_DIR}/python-compat.hh
include/${CUSTOM_HEADER_DIR}/signal.hh
include/${CUSTOM_HEADER_DIR}/signal-wrapper.hh)
set(${PROJECT_NAME}_SOURCES
src/interpreter.cc src/dynamic_graph/python-compat.cc
src/dynamic_graph/entity-py.cc src/dynamic_graph/convert-dg-to-py.cc)
add_library(${PROJECT_NAME} SHARED ${${PROJECT_NAME}_SOURCES}
${${PROJECT_NAME}_HEADERS})
target_include_directories(${PROJECT_NAME} PUBLIC $<INSTALL_INTERFACE:include>)
target_link_libraries(${PROJECT_NAME} PUBLIC dynamic-graph::dynamic-graph)
modernize_target_link_libraries(
${PROJECT_NAME}
SCOPE
PUBLIC
TARGETS
Python${PYTHON_VERSION_MAJOR}::Python
LIBRARIES
${PYTHON_LIBRARIES}
INCLUDE_DIRS
${PYTHON_INCLUDE_DIRS})
target_link_boost_python(${PROJECT_NAME} PUBLIC)
if(SUFFIX_SO_VERSION)
set_target_properties(${PROJECT_NAME} PROPERTIES SOVERSION ${PROJECT_VERSION})
endif(SUFFIX_SO_VERSION)
target_compile_definitions(${PROJECT_NAME}
PRIVATE PYTHON_LIBRARY="${PYTHON_LIBRARY}")
install(
TARGETS ${PROJECT_NAME}
EXPORT ${TARGETS_EXPORT_NAME}
DESTINATION lib)
add_subdirectory(src)
if(BUILD_TESTING)
add_subdirectory(tests)
endif(BUILD_TESTING)
install(FILES package.xml DESTINATION share/${PROJECT_NAME})
dynamic-graph-python
====================
# dynamic-graph-python
[![Building Status](https://travis-ci.org/stack-of-tasks/dynamic-graph-python.svg?branch=master)](https://travis-ci.org/stack-of-tasks/dynamic-graph-python)
[![Pipeline status](https://gitlab.laas.fr/stack-of-tasks/dynamic-graph-python/badges/master/pipeline.svg)](https://gitlab.laas.fr/stack-of-tasks/dynamic-graph-python/commits/master)
[![Coverage report](https://gitlab.laas.fr/stack-of-tasks/dynamic-graph-python/badges/master/coverage.svg?job=doc-coverage)](http://projects.laas.fr/stack-of-tasks/doc/stack-of-tasks/dynamic-graph-python/master/coverage/)
[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)
[![pre-commit.ci status](https://results.pre-commit.ci/badge/github/stack-of-tasks/dynamic-graph-python/master.svg)](https://results.pre-commit.ci/latest/github/stack-of-tasks/dynamic-graph-python)
Python bindings for dynamic-graph.
......@@ -14,52 +15,19 @@ submodules][git-submodules]. Please clone this repository using the
repository, you can run `git submodule init && git submodule update`
to retrieve the submodules.
## Documentation
Documentation
-------------
[Online](https://gepettoweb.laas.fr/doc/stack-of-tasks/dynamic-graph-python/master/doxygen-html/)
To get started with this library, please read the [online Doxygen
documentation][doxygen-documentation].
It can also be generated locally by running the `make doc`
command. After the package is installed, the documentation will be
located in the `$prefix/share/doc/dynamic-graph` directoy where
`$prefix` is your installation prefix (`/usr/local` by default).
Getting Help
------------
## Getting Help
Support is provided through:
* the HPP mailing-list: hpp@laas.fr
* the following HipChat room: http://www.hipchat.com/gh4wQrZeV
How can I install dynamic-graph?
--------------------------------
### Installing dependencies
The matrix abstract layer depends on several packages which
have to be available on your machine.
- Libraries:
- [Boost][] (>= 1.40)
Its detection is controled by the `BOOST_ROOT` variable, see next section
for more information.
- [Lapack][] library
Use the generic purpose `CMAKE_CXX_FLAGS` and `CMAKE_EXE_LINKER_FLAGS`
to insert the flags required for the compiler to find your Lapack library
if it is installed in a non-standard directory.
- [jrl-mal][] library
- [dynamic-graph][] library
- System tools:
- [CMake][] (>=2.6)
- [pkg-config][]
- usual compilation tools (GCC/G++, make, etc.)
If you are using Ubuntu, these tools are gathered in the `build-essential` package.
* the [issue tracker](https://github.com/stack-of-tasks/dynamic-graph-python/issues)
* the matrix room [#stack-of-tasks:laas.fr](https://matrix.to/#/#stack-of-tasks:laas.fr)
## How can I install dynamic-graph?
### Compiling and installing the package
......@@ -68,24 +36,21 @@ The manual compilation requires two steps:
1. configuration of the build and generation of the build files
2. compilation of the sources and installation of the package
dynamic-graph uses [CMake][] to generate build files. It is
dynamic-graph uses CMake to generate build files. It is
recommended to create a separate build directory:
```sh
mkdir _build # (1) Create a build directory
cd _build # (2) Go to the newly created build directory
cmake [options] .. # (3) Generate the build files
mkdir build
cd build
cmake ..
```
Options which can be passed to CMake are detailed in the next section.
```sh
make # (4) Compile the package
make test # (5) Execute the package tests
make install # (6) Install the package into the prefix (see step 3)
make
make test
make install
```
### Options
Additional options can be set on the command line through the
......@@ -109,13 +74,8 @@ Available options are:
The test suite can be run from your build directory by running:
```sh
make test
make test
```
Please open a ticket if some tests are failing on your computer, it
should not be the case.
Credits
-------
This package authors are credited in the [AUTHORS](AUTHORS) file.
Subproject commit 91f97c1c31608f48d697a6b11037f13e878b9837
Subproject commit 08c2c18b9033c2f0a86b885b589f4fa63a163caf
......@@ -8,4 +8,3 @@
</center>
</body>
</head>
......@@ -4,4 +4,3 @@
<LINK HREF="package.css" REL="stylesheet" TYPE="text/css">
</HEAD>
<BODY>
......@@ -45,8 +45,8 @@ a:link {
color:#0066CC
}
a:hover, a:active {
text-decoration: underline;
a:hover, a:active {
text-decoration: underline;
color: #3C9A35;
}
......@@ -57,7 +57,7 @@ a:visited {
}
DIV.memitem
{
{
spacing: 10px;
width:100%;
background:#FFFFFF;
......@@ -70,7 +70,7 @@ DIV.memitem
}
DIV.memproto
{
{
width:100%;
background:#F0F0F0;
font-size:100%;
......@@ -82,7 +82,7 @@ DIV.memproto
}
DIV.memdoc
{
{
padding: 10px;
width:100%;
font-size:100%;
......@@ -189,7 +189,7 @@ DIV.nav
}
DIV.groupHeader
{
{
padding-top: 30px;
padding-bottom: 20px;
background : none;
......@@ -201,23 +201,23 @@ DIV.groupHeader
color:#0066CC;
}
.directory p
{
margin: 0px;
white-space: nowrap;
.directory p
{
margin: 0px;
white-space: nowrap;
font-family: 'Lucida Grande','Lucida Sans Unicode',Verdana,Sans-Serif;
font-size: 10pt;
font-weight: normal;
}
.directory h3
{
.directory h3
{
font-family: 'Lucida Grande','Lucida Sans Unicode',Verdana,Sans-Serif;
margin: 0px;
margin-top: 1em;
margin: 0px;
margin-top: 1em;
padding-bottom: 20px;
font-size: 12pt;
font-size: 12pt;
font-variant: small-caps;
text-align: center;
}
......@@ -227,4 +227,3 @@ DIV.groupHeader
text-decoration: none;
color:#0066CC
}
......@@ -23,8 +23,8 @@ ABBREVIATE_BRIEF = "The $name class" \
ALWAYS_DETAILED_SEC = YES
INLINE_INHERITED_MEMB = NO
FULL_PATH_NAMES = NO
STRIP_FROM_PATH =
STRIP_FROM_INC_PATH =
STRIP_FROM_PATH =
STRIP_FROM_INC_PATH =
SHORT_NAMES = NO
JAVADOC_AUTOBRIEF = YES
MULTILINE_CPP_IS_BRIEF = NO
......@@ -50,7 +50,7 @@ SORT_MEMBER_DOCS = YES
SORT_BRIEF_DOCS = NO
SORT_BY_SCOPE_NAME = NO
MAX_INITIALIZER_LINES = 30
FILE_VERSION_FILTER =
FILE_VERSION_FILTER =
#---------------------------------------------------------------------------
# configuration options related to warning and progress messages
#---------------------------------------------------------------------------
......@@ -60,18 +60,18 @@ WARN_IF_UNDOCUMENTED = YES
WARN_IF_DOC_ERROR = YES
WARN_NO_PARAMDOC = NO
WARN_FORMAT = "$file:$line: $text"
WARN_LOGFILE =
WARN_LOGFILE =
#---------------------------------------------------------------------------
# configuration options related to the input files
#---------------------------------------------------------------------------
RECURSIVE = YES
EXCLUDE =
EXCLUDE =
EXCLUDE_SYMLINKS = NO
EXAMPLE_PATH =
EXAMPLE_PATH =
EXAMPLE_PATTERNS = *
EXAMPLE_RECURSIVE = NO
INPUT_FILTER =
FILTER_PATTERNS =
INPUT_FILTER =
FILTER_PATTERNS =
FILTER_SOURCE_FILES = NO
#---------------------------------------------------------------------------
# configuration options related to source browsing
......@@ -81,7 +81,7 @@ FILTER_SOURCE_FILES = NO
#---------------------------------------------------------------------------
ALPHABETICAL_INDEX = NO
COLS_IN_ALPHA_INDEX = 5
IGNORE_PREFIX =
IGNORE_PREFIX =
#---------------------------------------------------------------------------
# configuration options related to the HTML output
#---------------------------------------------------------------------------
......@@ -89,8 +89,8 @@ GENERATE_HTML = YES
HTML_FILE_EXTENSION = .html
HTML_ALIGN_MEMBERS = YES
GENERATE_HTMLHELP = NO
CHM_FILE =
HHC_LOCATION =
CHM_FILE =
HHC_LOCATION =
GENERATE_CHI = NO
BINARY_TOC = NO
TOC_EXPAND = YES
......@@ -106,8 +106,8 @@ LATEX_CMD_NAME = latex
MAKEINDEX_CMD_NAME = makeindex
COMPACT_LATEX = NO
PAPER_TYPE = a4wide
EXTRA_PACKAGES =
LATEX_HEADER =
EXTRA_PACKAGES =
LATEX_HEADER =
PDF_HYPERLINKS = NO
USE_PDFLATEX = NO
LATEX_BATCHMODE = NO
......@@ -118,8 +118,8 @@ LATEX_HIDE_INDICES = NO
RTF_OUTPUT = rtf
COMPACT_RTF = NO
RTF_HYPERLINKS = NO
RTF_STYLESHEET_FILE =
RTF_EXTENSIONS_FILE =
RTF_STYLESHEET_FILE =
RTF_EXTENSIONS_FILE =
#---------------------------------------------------------------------------
# configuration options related to the man page output
#---------------------------------------------------------------------------
......@@ -130,8 +130,8 @@ MAN_LINKS = NO
# configuration options related to the XML output
#---------------------------------------------------------------------------
XML_OUTPUT = xml
XML_SCHEMA =
XML_DTD =
XML_SCHEMA =
XML_DTD =
XML_PROGRAMLISTING = YES
#---------------------------------------------------------------------------
# configuration options for the AutoGen Definitions output
......@@ -142,20 +142,20 @@ GENERATE_AUTOGEN_DEF = NO
#---------------------------------------------------------------------------
PERLMOD_LATEX = NO
PERLMOD_PRETTY = YES
PERLMOD_MAKEVAR_PREFIX =
PERLMOD_MAKEVAR_PREFIX =
#---------------------------------------------------------------------------
# Configuration options related to the preprocessor
# Configuration options related to the preprocessor
#---------------------------------------------------------------------------
ENABLE_PREPROCESSING = YES
MACRO_EXPANSION = YES
EXPAND_ONLY_PREDEF = YES
SEARCH_INCLUDES = YES
INCLUDE_PATH =
INCLUDE_FILE_PATTERNS =
EXPAND_AS_DEFINED =
INCLUDE_PATH =
INCLUDE_FILE_PATTERNS =
EXPAND_AS_DEFINED =
SKIP_FUNCTION_MACROS = YES
#---------------------------------------------------------------------------
# Configuration::additions related to external references
# Configuration::additions related to external references
#---------------------------------------------------------------------------
TAGFILES = \
${DYNAMIC_GRAPH_DOCDIR}/html/dynamic-graph.doxytag=${DYNAMIC_GRAPH_DOCDIR}/html
......@@ -164,10 +164,10 @@ ALLEXTERNALS = NO
EXTERNAL_GROUPS = YES
PERL_PATH = /usr/bin/perl
#---------------------------------------------------------------------------
# Configuration options related to the dot tool
# Configuration options related to the dot tool
#---------------------------------------------------------------------------
#---------------------------------------------------------------------------
# Configuration::additions related to the search engine
# Configuration::additions related to the search engine
#---------------------------------------------------------------------------
SEARCHENGINE = NO
......@@ -196,7 +196,7 @@ GENERATE_TODOLIST = YES
GENERATE_TESTLIST = NO
GENERATE_BUGLIST = NO
GENERATE_DEPRECATEDLIST= YES
ENABLED_SECTIONS =
ENABLED_SECTIONS =
SHOW_USED_FILES = NO
SHOW_DIRECTORIES = NO
#---------------------------------------------------------------------------
......@@ -206,7 +206,7 @@ SHOW_DIRECTORIES = NO
# configuration options related to the input files
#---------------------------------------------------------------------------
FILE_PATTERNS = *.hh *.idl
EXCLUDE_PATTERNS =
EXCLUDE_PATTERNS =
INPUT = ${${PROJECT_NAME}_SOURCE_DIR}/include \
${CMAKE_CURRENT_SOURCE_DIR}/additionalDoc
......@@ -260,13 +260,13 @@ GENERATE_AUTOGEN_DEF = NO
#---------------------------------------------------------------------------
GENERATE_PERLMOD = NO
#---------------------------------------------------------------------------
# Configuration options related to the preprocessor
# Configuration options related to the preprocessor
#---------------------------------------------------------------------------
#---------------------------------------------------------------------------
# Configuration::additions related to external references
# Configuration::additions related to external references
#---------------------------------------------------------------------------
#---------------------------------------------------------------------------
# Configuration options related to the dot tool
# Configuration options related to the dot tool
#---------------------------------------------------------------------------
CLASS_DIAGRAMS = YES
HIDE_UNDOC_RELATIONS = YES
......@@ -282,8 +282,8 @@ CALL_GRAPH = NO
GRAPHICAL_HIERARCHY = YES
DIRECTORY_GRAPH = YES
DOT_IMAGE_FORMAT = png
DOT_PATH =
DOTFILE_DIRS =
DOT_PATH =
DOTFILE_DIRS =
MAX_DOT_GRAPH_DEPTH = 1000
DOT_TRANSPARENT = NO
DOT_MULTI_TARGETS = YES
......
// Copyright 2010, Florent Lamiraux, Thomas Moulard, LAAS-CNRS.
#include <boost/python.hpp>
#include <dynamic-graph/linear-algebra.h>
#include <dynamic-graph/value.h>
#include <boost/python.hpp>
namespace dynamicgraph {
namespace python {
namespace convert {
command::Value toValue(boost::python::object o, const command::Value::Type& type);
command::Value toValue(boost::python::object o,
const command::Value::Type& type);
boost::python::object fromValue(const command::Value& value);
} // namespace convert
......
#ifndef DYNAMIC_GRAPH_PY
#define DYNAMIC_GRAPH_PY
#include <iostream>
#include <sstream>
#include <boost/python.hpp>
#include <dynamic-graph/debug.h>
#include <dynamic-graph/exception-factory.h>
#include <dynamic-graph/signal-base.h>
#include <boost/python.hpp>
#include <boost/python/stl_iterator.hpp>
#include <iostream>
#include <sstream>
#include "dynamic-graph/python/signal-wrapper.hh"
namespace bp = boost::python;
......@@ -32,14 +32,16 @@ inline bp::tuple to_py_tuple(Iterator begin, Iterator end) {
template <typename T>
inline std::vector<T> to_std_vector(const bp::object& iterable) {
return std::vector<T>(bp::stl_input_iterator<T>(iterable), bp::stl_input_iterator<T>());
return std::vector<T>(bp::stl_input_iterator<T>(iterable),
bp::stl_input_iterator<T>());
}
void exposeSignals();
// Declare functions defined in other source files
namespace signalBase {
SignalBase<int>* createSignalWrapper(const char* name, const char* type, bp::object object);
SignalBase<int>* createSignalWrapper(const char* name, const char* type,
bp::object object);
} // namespace signalBase
namespace entity {
......
/*
* Copyright CNRS 2021
*
* Author: Florent Lamiraux
*
* This file is part of sot-core.
*/
#ifndef DYNAMIC_GRAPH_PYTHON_FWD_HH
#define DYNAMIC_GRAPH_PYTHON_FWD_HH
#include <dynamic-graph/fwd.hh>
namespace dynamicgraph {
namespace python {
class Interpreter;
typedef shared_ptr<Interpreter> InterpreterPtr_t;
} // namespace python
} // namespace dynamicgraph
#endif // DYNAMIC_GRAPH_PYTHON_FWD_HH
......@@ -6,11 +6,10 @@
#undef _POSIX_C_SOURCE
#undef _XOPEN_SOURCE
#include "dynamic-graph/python/api.hh"
#include "dynamic-graph/python/deprecated.hh"
#include <dynamic-graph/python/fwd.hh>
#include "dynamic-graph/python/python-compat.hh"
#include "dynamic-graph/python/api.hh"
#include "dynamic-graph/python/python-compat.hh"
namespace dynamicgraph {
namespace python {
......@@ -26,11 +25,13 @@ class DYNAMIC_GRAPH_PYTHON_DLLAPI Interpreter {
/// \brief Method to start python interperter.
/// \param command string to execute
/// Method deprecated, you *SHOULD* handle error messages.
DYNAMIC_GRAPH_PYTHON_DEPRECATED std::string python(const std::string& command);
[[deprecated("you *SHOULD* handle error messages")]] std::string python(
const std::string& command);
/// \brief Method to start python interperter.
/// \param command string to execute, result, stdout, stderr strings
void python(const std::string& command, std::string& result, std::string& out, std::string& err);
void python(const std::string& command, std::string& result, std::string& out,
std::string& err);
/// \brief Method to exectue a python script.
/// \param filename the filename
......
......@@ -6,10 +6,11 @@
#include <pinocchio/fwd.hpp>
#endif
#include <boost/python.hpp>
#include <boost/mpl/for_each.hpp>
#include <dynamic-graph/entity.h>
#include <boost/mpl/for_each.hpp>
#include <boost/mpl/vector.hpp>
#include <boost/python.hpp>
#include <dynamic-graph/python/dynamic-graph-py.hh>
namespace dynamicgraph {
......@@ -42,14 +43,17 @@ bp::object makeEntity2() {
/// If some commands or signals are added or removed dynamiccally, then
/// it is better to disable the default behaviour and handle it
/// specifically.
template <typename T, typename bases = boost::python::bases<dynamicgraph::Entity>,
template <typename T,
typename bases = boost::python::bases<dynamicgraph::Entity>,
int Options = AddCommands | AddSignals>
inline auto exposeEntity() {
// std::string hiddenClassName ("_" + T::CLASS_NAME);
std::string hiddenClassName(T::CLASS_NAME);
namespace bp = boost::python;
bp::class_<T, bases, boost::noncopyable> obj(hiddenClassName.c_str(), bp::init<std::string>());
/* TODO at the moment, I couldn't easily find a way to define a Python constructor
bp::class_<T, bases, boost::noncopyable> obj(hiddenClassName.c_str(),
bp::init<std::string>());
/* TODO at the moment, I couldn't easily find a way to define a Python
constructor
* that would create the entity via the factory and then populate the
* python object with its commands.
* This is achieved with a factory function of the same name.
......@@ -63,7 +67,8 @@ inline auto exposeEntity() {
std::cout << "foo" << std::endl;
assert(dynamic_cast<T*>(ent) != NULL);
self = bp::object(bp::ptr(static_cast<T*>(ent)));
//dynamicgraph::Entity& unused = bp::extract<dynamicgraph::Entity&>(self);
//dynamicgraph::Entity& unused =
bp::extract<dynamicgraph::Entity&>(self);
//entity::addCommands(self);
})
;
......
......@@ -4,11 +4,13 @@
#ifndef DGPY_SIGNAL_WRAPPER
#define DGPY_SIGNAL_WRAPPER
#include <boost/python.hpp>
#include <dynamic-graph/entity.h>
#include <dynamic-graph/linear-algebra.h>
#include <dynamic-graph/signal.h>
#include <dynamic-graph/entity.h>
#include <boost/bind.hpp>
#include <boost/python.hpp>
#include "dynamic-graph/python/python-compat.hh"
namespace dynamicgraph {
......@@ -33,7 +35,8 @@ class SignalWrapper : public Signal<T, Time> {
static bool checkCallable(pyobject c, std::string& error);
SignalWrapper(std::string name, pyobject callable) : parent_t(name), callable(callable) {
SignalWrapper(std::string name, pyobject callable)
: parent_t(name), callable(callable) {
typedef boost::function2<T&, T&, Time> function_t;
function_t f = boost::bind(&SignalWrapper::call, this, _1, _2);
this->setFunction(f);
......
// Copyright 2020, Joseph Mirabel, LAAS-CNRS.
#include <sstream>
#include <boost/python.hpp>
#include <dynamic-graph/signal-base.h>
#include <dynamic-graph/signal-ptr.h>
#include <dynamic-graph/signal-time-dependent.h>
#include <dynamic-graph/signal.h>
#include <boost/python.hpp>
#include <sstream>
#include "dynamic-graph/python/signal-wrapper.hh"
namespace dynamicgraph {
......
<?xml version="1.0"?>
<package format="3">
<name>dynamic-graph-python</name>
<version>3.5.3</version>
<description>
Dynamic graph library Python bindings
</description>
<maintainer email="ostasse@laas.fr">Olivier Stasse</maintainer>
<license>BSD</license>
<url>http://github.com/stack-of-tasks/dynamic-graph-python</url>
<version>4.0.11</version>
<description>Dynamic graph library Python bindings</description>
<maintainer email="guilhem.saurel@laas.fr">Guilhem Saurel</maintainer>
<author>Nicolas Mansard</author>
<author>Olivier Stasse</author>
<license>BSD</license>
<url type="website">https://github.com/stack-of-tasks/dynamic-graph-python</url>
<build_depend>git</build_depend>
<build_depend>doxygen</build_depend>
<doc_depend>doxygen</doc_depend>
<!-- The following tags are recommended by REP-136 -->
<!-- The following tag is recommended by REP-136 -->
<exec_depend condition="$ROS_VERSION == 1">catkin</exec_depend>
<exec_depend condition="$ROS_VERSION == 2">ament_cmake</exec_depend>
<depend>dynamic-graph</depend>
<depend>roscpp</depend>
<depend condition="$ROS_PYTHON_VERSION == 2">python</depend>
<depend condition="$ROS_PYTHON_VERSION == 3">python3</depend>
<depend condition="$ROS_PYTHON_VERSION == 2">python-numpy</depend>
<depend condition="$ROS_PYTHON_VERSION == 3">python3-numpy</depend>
<depend>eigen</depend>
<depend>boost</depend>
<depend>eigenpy</depend>
<depend>dynamic-graph</depend>
<buildtool_depend>cmake</buildtool_depend>
<export>
<build_type>cmake</build_type>
</export>
</package>