Giter Club home page Giter Club logo

dynamic-graph's Introduction

dynamic-graph

Building status Coverage report License pre-commit.ci status

This software provides an efficient way to modelize a C++ data-flow.

A dynamic graph data-flow is composed of:

  • entities (graph nodes)
  • signals (input/output of a graph action)

Output signals can then be plugged into input signals to data transmission.

An efficient caching mechanism avoid useless data recomputation and a simple built-in language can be used to control the graph actions.

It is released under the BSD-clause 2 license.

Warning: this repository contains Git submodules. Please clone this repository using the git clone --recursive command. If you already have cloned the repository, you can run git submodule init && git submodule update to retrieve the submodules.

Documentation

To get started with this library, please read the online 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

Support is provided through issues on the github interface.

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)
    • Doxygen
    • Eigen3
    • pthread
  • 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.

Compiling and installing the package

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 recommended to create a separate build directory:

mkdir _build         # (1) Create a build directory
cd _build            # (2) Go to the newly created build directory
cmake [options] ..   # (3) Generate the build files

Options which can be passed to CMake are detailed in the next section.

make                 # (4) Compile the package
make test            # (5) Execute the package tests
make install         # (6) Install the package into the prefix (see step 3)

Options

Additional options can be set on the command line through the following command: -D<option>=<value>.

For instance: cmake -DCMAKE_BUILD_TYPE=RelWithDebInfo .. will set the CMAKE_BUILD_TYPE option to the value RelWithDebInfo.

Available options are:

  • CMAKE_BUILD_TYPE set the build profile that should be used (debug, release, etc.). We recommend RelWithDebInfo as it will provide performances while keeping debugging symbols enabled.
  • CMAKE_INSTALL_PREFIX set the installation prefix (the directory where the software will be copied to after it has been compiled).

Running the test suite

The test suite can be run from your build directory by running:

   make test

Please open a ticket if some tests are failing on your computer, it should not be the case.

Contributing

If you want to contribute, please refer to the CONTRIBUTING.md file

Credits

This package authors are credited in the AUTHORS file.

Available Packages

dynamic-graph's People

Contributors

aclodic avatar andreadelprete avatar corentinberge avatar fbleibel avatar florent-lamiraux avatar francois-keith avatar gergondet avatar jmirabel avatar jviereck avatar ksyy avatar nim65s avatar nmansard avatar olivier-stasse avatar pre-commit-ci[bot] avatar proyan avatar rascof avatar thomas-moulard avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

dynamic-graph's Issues

Error when compiling

I have the following compilation error:

[ 15%] Building CXX object src/CMakeFiles/dynamic-graph.dir/dgraph/interpreter.cpp.o
In file included from /home/bleibel/devel/openrobots/include/boost/integer.hpp:20,
from /home/bleibel/devel/openrobots/include/boost/function/function_base.hpp:21,
from /home/bleibel/devel/openrobots/include/boost/function/detail/prologue.hpp:17,
from /home/bleibel/devel/openrobots/include/boost/function.hpp:24,
from /home/bleibel/devel-src/dynamic-graph/include/dynamic-graph/interpreter.h:40,
from /home/bleibel/devel-src/dynamic-graph/src/dgraph/interpreter.cpp:26:
/home/bleibel/devel/openrobots/include/boost/integer_traits.hpp:164:66: error: use of C99 long long integer constant
/home/bleibel/devel/openrobots/include/boost/integer_traits.hpp:164:77: error: use of C99 long long integer constant
/home/bleibel/devel/openrobots/include/boost/integer_traits.hpp:170:70: error: use of C99 long long integer constant
/home/bleibel/devel/openrobots/include/boost/integer_traits.hpp:170:70: error: use of C99 long long integer constant

Is the introduction of the new stricter compiler options preventing my boost library from compiling?

Tracer real-time for double/int/(more?)

What I noticed:

I noticed that upon tracing a signal of type int or double the output file contains extra endline character.

For example:

1	1

2	1

3	1

Where the first column is the time and the second column is the data.

Potential Solution:

I suspect the tracer to dump an extra end line upon writing data that are not Eigen::Matrix.
I did not look at the tracer code yet.

[tests] Missing file debug-logger-winit in tests in devel branch

I think you forgot to add the test file debug-logger-winit in your last commit :
"[tests] Add tests on sendMsgs without initialization."
You only changed the CMakeList by adding DYNAMIC_GRAPH_TEST(debug-logger-winit) without adding the file, this leads to errors during compilation.

Make DYNAMICGRAPH_FACTORY_ENTITY_PLUGIN robust

The macro DYNAMICGRAPH_FACTORY_ENTITY_PLUGIN does not work
properly outside of the dynamicgraph namespace.

The current implementation:

#define DYNAMICGRAPH_FACTORY_ENTITY_PLUGIN(classType,className)     \
  const std::string classType::CLASS_NAME = className;          \
  extern "C" {                              \
    Entity *EntityMaker_##classType( const std::string& objname )   \
    {                                   \
      return new classType( objname );                  \
    }                                   \
    EntityRegisterer reg##_##classType( className,          \
                    &EntityMaker##_##classType );   \
  }                                 \
  struct e_n_d__w_i_t_h__s_e_m_i_c_o_l_o_n

should be replaced by:

#define DYNAMICGRAPH_FACTORY_ENTITY_PLUGIN(classType,className)     \
  const std::string classType::CLASS_NAME = className;          \
  extern "C" {                              \
    Entity *EntityMaker##_##classType( const std::string& objname ) \
    {                                   \
      return new classType( objname );                  \
    }                                   \
    ::dynamicgraph::EntityRegisterer reg_##classType( className,    \
                    &EntityMaker##_##classType );   \
  }                                 \
  struct e_n_d__w_i_t_h__s_e_m_i_c_o_l_o_n

Note that EntityRegisterer type lookup is now absolute to avoid confusion.
Extra ## has also been removed in EntityMaker_## and reg_##.

All types used in macros should be resolved like this to avoid naming conflicts.

Noetic Ubuntu Focal cannot find library libtracer.so.4.3.1

It looks like dynamic-graph is failing to build in Ubuntu Focal, and that's causing a lack of a debian package for dynamic-graph-python. A fix is needed for it to be included in the next Noetic sync.

https://build.ros.org/view/Nbin_uF64/job/Nbin_uF64__dynamic-graph__ubuntu_focal_amd64__binary/86/consoleFull

23:17:30 make[1]: Entering directory '/tmp/binarydeb/ros-noetic-dynamic-graph-4.3.1'
23:17:30 # In case we're installing to a non-standard location, look for a setup.sh
23:17:30 # in the install tree and source it.  It will set things like
23:17:30 # CMAKE_PREFIX_PATH, PKG_CONFIG_PATH, and PYTHONPATH.
23:17:30 if [ -f "/opt/ros/noetic/setup.sh" ]; then . "/opt/ros/noetic/setup.sh"; fi && \
23:17:30 dh_shlibdeps -l/tmp/binarydeb/ros-noetic-dynamic-graph-4.3.1/debian/ros-noetic-dynamic-graph//opt/ros/noetic/lib/
23:17:30 	dpkg-shlibdeps -Tdebian/ros-noetic-dynamic-graph.substvars -l/tmp/binarydeb/ros-noetic-dynamic-graph-4.3.1/debian/ros-noetic-dynamic-graph//opt/ros/noetic/lib/ debian/ros-noetic-dynamic-graph/opt/ros/noetic/lib/dynamic-graph-plugins/libtracer-real-time.so.4.3.1 debian/ros-noetic-dynamic-graph/opt/ros/noetic/lib/dynamic-graph-plugins/libtracer.so.4.3.1 debian/ros-noetic-dynamic-graph/opt/ros/noetic/lib/libdynamic-graph.so.4.3.1
23:17:31 dpkg-shlibdeps: error: cannot find library libtracer.so.4.3.1 needed by debian/ros-noetic-dynamic-graph/opt/ros/noetic/lib/dynamic-graph-plugins/libtracer-real-time.so.4.3.1 (ELF format: 'elf64-x86-64' abi: '0201003e00000000'; RPATH: '')
23:17:31 dpkg-shlibdeps: error: cannot continue due to the error above
23:17:31 Note: libraries are not searched in other binary packages that do not have any shlibs or symbols file.
23:17:31 To help dpkg-shlibdeps find private libraries, you might need to use -l.
23:17:31 dh_shlibdeps: error: dpkg-shlibdeps -Tdebian/ros-noetic-dynamic-graph.substvars -l/tmp/binarydeb/ros-noetic-dynamic-graph-4.3.1/debian/ros-noetic-dynamic-graph//opt/ros/noetic/lib/ debian/ros-noetic-dynamic-graph/opt/ros/noetic/lib/dynamic-graph-plugins/libtracer-real-time.so.4.3.1 debian/ros-noetic-dynamic-graph/opt/ros/noetic/lib/dynamic-graph-plugins/libtracer.so.4.3.1 debian/ros-noetic-dynamic-graph/opt/ros/noetic/lib/libdynamic-graph.so.4.3.1 returned exit code 2
23:17:31 dh_shlibdeps: error: Aborting due to earlier error
23:17:31 make[1]: *** [debian/rules:52: override_dh_shlibdeps] Error 25
23:17:31 make[1]: Leaving directory '/tmp/binarydeb/ros-noetic-dynamic-graph-4.3.1'
23:17:31 make: *** [debian/rules:22: binary] Error 2
23:17:31 dpkg-buildpackage: error: fakeroot debian/rules binary subprocess returned exit status 2
23:17:31 E: Building failed

Make cast registerer robust

Commit 242f086 in topic/unit-tests enhances
cast-registerer checks.

It exposes several weakness of the current implementation:

  • no error is raised when an invalid string is passed as input
  • standard double cast registerer behaves poorly with special values such as NaN or +/- inf.

Fix that.

Handle unplugged signals

Currently there is no way of handling unplugged signals in dynamic-graph. As a result, if there is any false access request made by any entity, it leads to a segfault. Then depending on the layers above the segfault, the error may be trackable in 1 hour or 3. We need a proper mechanism to address these null pointer accesses in unplugged signals

Incoherence between SignalBase::setReady and needUpdate

SignalBase defines the following methods/

  const bool &getReady() const { return ready; }
  virtual bool needUpdate(const Time &) const { return ready; }
  inline void setReady(const bool sready = true) { ready = sready; }

It is very misleading that signal.getReady() == signal.needUpdate(). From the code, it seems this is only use in SignalTimeDependent and attribute ready is true when the signal is NOT up to date

writeGraph generates wrong graph

When a task (T) in two solvers (A and B), the graph generated by writeGraph is not correct. The graph that is generated looks like:

subgraph "A" {
 T
}
subgraph "B" {
 T
}

T is shown only in one of the solver.

Access specifiers in macros

Macros DECLARE_SIGNAL_OUT:

#define DECLARE_SIGNAL_OUT( name,type ) \
public: \
::dynamicgraph::SignalTimeDependent<type,int> m_##name##SOUT; \
protected: \
type& SIGNAL_OUT_FUNCTION(name)( type&,int )

and DECLARE_SIGNAL_INNER
#define DECLARE_SIGNAL_INNER(name,type) \
public: \
::dynamicgraph::SignalTimeDependent<type,int> m_##name##SINNER;\
protected: \
DECLARE_SIGNAL_INNER_FUNCTION(name,type)

both contain access specifiers, which causes the access to be protected after one of these macros is employed, which is totally unexpected if, for instance, it used to be public.

Is there a reason why we want these functions to be protected? Can't we just leave remove the access specifiers and let the user just make sure everything is public?

Fix errors detected by cppcheck

Cppcheck can be used to easily detect errors in software.

Steps:

# On Ubuntu, cppcheck can be installed through apt:
apt-get install cppcheck

# Run it.
cd dynamic-graph # go to the project source top-level
cppcheck --enable=all include tests src 2> err.txt

Here are the results:

[src/dgraph/interpreter.cpp:295]: (style) The scope of the variable name can be reduced
[src/dgraph/interpreter.cpp:503]: (possible style) Pre-Incrementing variable 'iter' is preferred to Post-Incrementing
[src/dgraph/plugin-loader.cpp:147]: (error) Dangerous iterator usage. After erase the iterator is invalid so dereferencing it or comparing it with another iterator is invalid.
[src/dgraph/pool.cpp:113]: (possible style) Pre-Incrementing variable 'entPtr' is preferred to Post-Incrementing
[src/dgraph/pool.cpp:177]: (possible style) Pre-Incrementing variable 'iter' is preferred to Post-Incrementing
[src/dgraph/pool.cpp:196]: (possible style) Pre-Incrementing variable 'iter' is preferred to Post-Incrementing
[src/dgraph/pool.cpp:224]: (possible style) Pre-Incrementing variable 'iter' is preferred to Post-Incrementing
[src/shell/functions.cpp:375]: (style) The scope of the variable opt can be reduced
[src/shell/functions.cpp:375]: (style) The scope of the variable filename can be reduced
[src/shell/functions.cpp:38]: (style) Function parameter 'cmdLine' is passed by value. It could be passed by reference instead.
[src/shell/functions.cpp:57]: (style) Function parameter 'cmdLine' is passed by value. It could be passed by reference instead.
[src/shell/functions.cpp:79]: (style) Function parameter 'cmdLine' is passed by value. It could be passed by reference instead.
[src/shell/functions.cpp:95]: (style) Function parameter 'cmdLine' is passed by value. It could be passed by reference instead.
[src/shell/functions.cpp:121]: (style) Function parameter 'cmdLine' is passed by value. It could be passed by reference instead.
[src/shell/functions.cpp:135]: (style) Function parameter 'cmdLine' is passed by value. It could be passed by reference instead.
[src/shell/functions.cpp:144]: (style) Function parameter 'cmdLine' is passed by value. It could be passed by reference instead.
[src/shell/functions.cpp:175]: (style) Function parameter 'cmdLine' is passed by value. It could be passed by reference instead.
[src/shell/functions.cpp:205]: (style) Function parameter 'cmdLine' is passed by value. It could be passed by reference instead.
[src/shell/functions.cpp:239]: (style) Function parameter 'cmdLine' is passed by value. It could be passed by reference instead.
[src/shell/functions.cpp:258]: (style) Function parameter 'cmdLine' is passed by value. It could be passed by reference instead.
[src/shell/functions.cpp:289]: (style) Function parameter 'cmdLine' is passed by value. It could be passed by reference instead.
[src/shell/functions.cpp:317]: (style) Function parameter 'cmdLine' is passed by value. It could be passed by reference instead.
[src/shell/functions.cpp:366]: (style) Function parameter 'cmdLine' is passed by value. It could be passed by reference instead.
[src/shell/functions.cpp:399]: (style) Function parameter 'cmdLine' is passed by value. It could be passed by reference instead.
[src/shell/functions.cpp:418]: (style) Function parameter 'cmdLine' is passed by value. It could be passed by reference instead.
[src/shell/functions.cpp:442]: (style) Function parameter 'cmdLine' is passed by value. It could be passed by reference instead.
[src/shell/functions.cpp:455]: (style) Function parameter 'cmdLine' is passed by value. It could be passed by reference instead.
[src/traces/tracer-real-time.cpp:55]: (style) Redundant condition. It is safe to deallocate a NULL pointer
[src/traces/tracer-real-time.cpp:64]: (style) Redundant condition. It is safe to deallocate a NULL pointer
[src/traces/tracer-real-time.cpp:109]: (style) Function parameter 'n' is passed by value. It could be passed by reference instead.
[src/traces/tracer.cpp:41]: (style) Function parameter 'n' is passed by value. It could be passed by reference instead.
[tests/custom-entity.cpp:37]: (style) Function parameter 'n' is passed by value. It could be passed by reference instead.

Fix plug-in loader leak

Plug-in loader does not free the memory correctly. Fix that.

This problem is revealed by running the "interpreter" test (for now in topic/tests):

==32373== 
==32373== HEAP SUMMARY:
==32373==     in use at exit: 197 bytes in 3 blocks
==32373==   total heap usage: 999 allocs, 996 frees, 107,988 bytes allocated
==32373== 
==32373== Searching for pointers to 3 not-freed blocks
==32373== Checked 168,572 bytes
==32373== 
==32373== 20 bytes in 1 blocks are still reachable in loss record 1 of 3
==32373==    at 0x402425F: calloc (vg_replace_malloc.c:467)
==32373==    by 0x420C105: _dlerror_run (dlerror.c:142)
==32373==    by 0x420BB40: dlopen@@GLIBC_2.1 (dlopen.c:88)
==32373==    by 0x4094253: dynamicgraph::PluginLoader::loadPlugins() (in /home/thomas/profiles/laas/src/unstable/sot/dynamic-graph/_build/lib/libdynamic-graph.so.1.1-106-g8ed2a-dirty)
==32373==    by 0x4083F6F: dynamicgraph::Interpreter::cmdLoadPlugin(std::string const&, std::basic_istringstream, std::allocator >&, std::ostream&) (in /home/thomas/profiles/laas/src/unstable/sot/dynamic-graph/_build/lib/libdynamic-graph.so.1.1-106-g8ed2a-dirty)
==32373==    by 0x4090211: boost::_mfi::mf3, std::allocator >&, std::ostream&>::operator()(dynamicgraph::Interpreter*, std::string const&, std::basic_istringstream, std::allocator >&, std::ostream&) const (in /home/thomas/profiles/laas/src/unstable/sot/dynamic-graph/_build/lib/libdynamic-graph.so.1.1-106-g8ed2a-dirty)
==32373==    by 0x408EAE7: void boost::_bi::list4, boost::arg<1>, boost::arg<2>, boost::arg<3> >::operator(), std::allocator >&, std::ostream&>, boost::_bi::list3, std::allocator >&, std::ostream&> >(boost::_bi::type, boost::_mfi::mf3, std::allocator >&, std::ostream&>&, boost::_bi::list3, std::allocator >&, std::ostream&>&, int) (in /home/thomas/profiles/laas/src/unstable/sot/dynamic-graph/_build/lib/libdynamic-graph.so.1.1-106-g8ed2a-dirty)
==32373==    by 0x408CC28: void boost::_bi::bind_t, std::allocator >&, std::ostream&>, boost::_bi::list4, boost::arg<1>, boost::arg<2>, boost::arg<3> > >::operator(), std::allocator >, std::ostream>(std::string const&, std::basic_istringstream, std::allocator >&, std::ostream&) (in /home/thomas/profiles/laas/src/unstable/sot/dynamic-graph/_build/lib/libdynamic-graph.so.1.1-106-g8ed2a-dirty)
==32373==    by 0x4089F07: boost::detail::function::void_function_obj_invoker3, std::allocator >&, std::ostream&>, boost::_bi::list4, boost::arg<1>, boost::arg<2>, boost::arg<3> > >, void, std::string const&, std::basic_istringstream, std::allocator >&, std::ostream&>::invoke(boost::detail::function::function_buffer&, std::string const&, std::basic_istringstream, std::allocator >&, std::ostream&) (in /home/thomas/profiles/laas/src/unstable/sot/dynamic-graph/_build/lib/libdynamic-graph.so.1.1-106-g8ed2a-dirty)
==32373==    by 0x4087939: boost::function3, std::allocator >&, std::ostream&>::operator()(std::string const&, std::basic_istringstream, std::allocator >&, std::ostream&) const (in /home/thomas/profiles/laas/src/unstable/sot/dynamic-graph/_build/lib/libdynamic-graph.so.1.1-106-g8ed2a-dirty)
==32373==    by 0x4085262: dynamicgraph::Interpreter::cmd(std::string const&, std::basic_istringstream, std::allocator >&, std::ostream&) (in /home/thomas/profiles/laas/src/unstable/sot/dynamic-graph/_build/lib/libdynamic-graph.so.1.1-106-g8ed2a-dirty)
==32373==    by 0x8053ECA: cmd_loadPlugin::test_method() (in /home/thomas/profiles/laas/src/unstable/sot/dynamic-graph/_build/tests/interpreter)
==32373== 
==32373== 73 bytes in 1 blocks are still reachable in loss record 2 of 3
==32373==    at 0x4025016: realloc (vg_replace_malloc.c:525)
==32373==    by 0x43C4181: vasprintf (vasprintf.c:86)
==32373==    by 0x43AB21A: asprintf (asprintf.c:37)
==32373==    by 0x420C335: dlerror (dlerror.c:100)
==32373==    by 0x40942F3: dynamicgraph::PluginLoader::loadPlugins() (in /home/thomas/profiles/laas/src/unstable/sot/dynamic-graph/_build/lib/libdynamic-graph.so.1.1-106-g8ed2a-dirty)
==32373==    by 0x4083F6F: dynamicgraph::Interpreter::cmdLoadPlugin(std::string const&, std::basic_istringstream, std::allocator >&, std::ostream&) (in /home/thomas/profiles/laas/src/unstable/sot/dynamic-graph/_build/lib/libdynamic-graph.so.1.1-106-g8ed2a-dirty)
==32373==    by 0x4090211: boost::_mfi::mf3, std::allocator >&, std::ostream&>::operator()(dynamicgraph::Interpreter*, std::string const&, std::basic_istringstream, std::allocator >&, std::ostream&) const (in /home/thomas/profiles/laas/src/unstable/sot/dynamic-graph/_build/lib/libdynamic-graph.so.1.1-106-g8ed2a-dirty)
==32373==    by 0x408EAE7: void boost::_bi::list4, boost::arg<1>, boost::arg<2>, boost::arg<3> >::operator(), std::allocator >&, std::ostream&>, boost::_bi::list3, std::allocator >&, std::ostream&> >(boost::_bi::type, boost::_mfi::mf3, std::allocator >&, std::ostream&>&, boost::_bi::list3, std::allocator >&, std::ostream&>&, int) (in /home/thomas/profiles/laas/src/unstable/sot/dynamic-graph/_build/lib/libdynamic-graph.so.1.1-106-g8ed2a-dirty)
==32373==    by 0x408CC28: void boost::_bi::bind_t, std::allocator >&, std::ostream&>, boost::_bi::list4, boost::arg<1>, boost::arg<2>, boost::arg<3> > >::operator(), std::allocator >, std::ostream>(std::string const&, std::basic_istringstream, std::allocator >&, std::ostream&) (in /home/thomas/profiles/laas/src/unstable/sot/dynamic-graph/_build/lib/libdynamic-graph.so.1.1-106-g8ed2a-dirty)
==32373==    by 0x4089F07: boost::detail::function::void_function_obj_invoker3, std::allocator >&, std::ostream&>, boost::_bi::list4, boost::arg<1>, boost::arg<2>, boost::arg<3> > >, void, std::string const&, std::basic_istringstream, std::allocator >&, std::ostream&>::invoke(boost::detail::function::function_buffer&, std::string const&, std::basic_istringstream, std::allocator >&, std::ostream&) (in /home/thomas/profiles/laas/src/unstable/sot/dynamic-graph/_build/lib/libdynamic-graph.so.1.1-106-g8ed2a-dirty)
==32373==    by 0x4087939: boost::function3, std::allocator >&, std::ostream&>::operator()(std::string const&, std::basic_istringstream, std::allocator >&, std::ostream&) const (in /home/thomas/profiles/laas/src/unstable/sot/dynamic-graph/_build/lib/libdynamic-graph.so.1.1-106-g8ed2a-dirty)
==32373==    by 0x4085262: dynamicgraph::Interpreter::cmd(std::string const&, std::basic_istringstream, std::allocator >&, std::ostream&) (in /home/thomas/profiles/laas/src/unstable/sot/dynamic-graph/_build/lib/libdynamic-graph.so.1.1-106-g8ed2a-dirty)
==32373== 
==32373== 104 bytes in 1 blocks are still reachable in loss record 3 of 3
==32373==    at 0x4024F20: malloc (vg_replace_malloc.c:236)
==32373==    by 0x401193F: add_to_global (dl-open.c:107)
==32373==    by 0x4011E2C: dl_open_worker (dl-open.c:468)
==32373==    by 0x400D7E5: _dl_catch_error (dl-error.c:178)
==32373==    by 0x40115E5: _dl_open (dl-open.c:554)
==32373==    by 0x420BC0A: dlopen_doit (dlopen.c:67)
==32373==    by 0x400D7E5: _dl_catch_error (dl-error.c:178)
==32373==    by 0x420C09B: _dlerror_run (dlerror.c:164)
==32373==    by 0x420BB40: dlopen@@GLIBC_2.1 (dlopen.c:88)
==32373==    by 0x4094253: dynamicgraph::PluginLoader::loadPlugins() (in /home/thomas/profiles/laas/src/unstable/sot/dynamic-graph/_build/lib/libdynamic-graph.so.1.1-106-g8ed2a-dirty)
==32373==    by 0x4083F6F: dynamicgraph::Interpreter::cmdLoadPlugin(std::string const&, std::basic_istringstream, std::allocator >&, std::ostream&) (in /home/thomas/profiles/laas/src/unstable/sot/dynamic-graph/_build/lib/libdynamic-graph.so.1.1-106-g8ed2a-dirty)
==32373==    by 0x4090211: boost::_mfi::mf3, std::allocator >&, std::ostream&>::operator()(dynamicgraph::Interpreter*, std::string const&, std::basic_istringstream, std::allocator >&, std::ostream&) const (in /home/thomas/profiles/laas/src/unstable/sot/dynamic-graph/_build/lib/libdynamic-graph.so.1.1-106-g8ed2a-dirty)
==32373== 
==32373== LEAK SUMMARY:
==32373==    definitely lost: 0 bytes in 0 blocks
==32373==    indirectly lost: 0 bytes in 0 blocks
==32373==      possibly lost: 0 bytes in 0 blocks
==32373==    still reachable: 197 bytes in 3 blocks
==32373==         suppressed: 0 bytes in 0 blocks
==32373== 
==32373== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 45 from 11)
--32373-- 
--32373-- used_suppression:     45 dl-hack3-cond-1
==32373== 
==32373== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 45 from 11)

Compiling errors on macOS

Compiling the tests on macOS, I ran into the following two kinds of error messages:

~/dev/dynamic_graph/tests/factory.cpp:55:1: error: empty macro arguments are a C99 feature [-Werror,-Wc99-extensions]
BOOST_AUTO_TEST_CASE(constructor)
^
/usr/local/include/boost/test/unit_test_suite.hpp:208:5: note: expanded from macro 'BOOST_AUTO_TEST_CASE'
    BOOST_TEST_INVOKE_IF_N_ARGS( 1,                                     \
    ^
/usr/local/include/boost/test/detail/pp_variadic.hpp:37:28: note: expanded from macro 'BOOST_TEST_INVOKE_IF_N_ARGS'
            BOOST_PP_EQUAL(BOOST_PP_VARIADIC_SIZE(__VA_ARGS__), N), \
                           ^
/usr/local/include/boost/preprocessor/variadic/size.hpp:25:329: note: expanded from macro 'BOOST_PP_VARIADIC_SIZE'
  ...37, 36, 35, 34, 33, 32, 31, 30, 29, 28, 27, 26, 25, 24, 23, 22, 21, 20, 19, 18, 17, 16, 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1,)

and

~/dev/dynamic_graph/include/dynamic-graph/signal-ptr.h:146:18: error: 'dynamicgraph::SignalPtr<double, int>::addDependency' hides
      overloaded virtual function [-Werror,-Woverloaded-virtual]
    virtual void addDependency () {}
                 ^
/Users/jviereck/dev/dynamic_graph/tests/signal-ptr.cpp:33:25: note: in instantiation of template class 'dynamicgraph::SignalPtr<double, int>'
      requested here
  SignalPtr<double,int> sigPtrA(NULL,"sigPtrA"),sigPtrB(NULL,"sigPtrB");
                        ^
/Users/jviereck/dev/dynamic_graph/include/dynamic-graph/signal-base.h:91:18: note: hidden overloaded virtual function
      'dynamicgraph::SignalBase<int>::addDependency' declared here: different number of parameters (1 vs 0)
    virtual void addDependency (const SignalBase<Time>&)
                 ^

After modifing the CXX flags as follows

CMAKE_CXX_FLAGS                  -Wno-c99-extensions -Wno-overloaded-virtual

the project compiles and all tests pass.

BSD License v2

Dear all,
We will soon switch to BSD License v2.0 to ease our collaborations.
Let me know if there is a problem with this.
Cheers,
Olivier.

Import error is displayed twice

When importing a non existing file, the error is displayed twice.

A debug cout should remain somewhere and should be removed.

Pushing v3

Dear all,
@proyan has done a tremendous job in porting eigen in the SoT.
Therefore I will push his developments in the devel parts across all our packages.
Please let me know if this a problem.
Soon enough, we will merge this devel branch in master.
Best Regards,
Olivier.

Improve plug-in loading to deal with multiple installation prefixes

A stack of plug-in libraries should be added in the sot language
as it is currently the case with import so that we can deal with cases
where sot-openhrp-scripts, dynamic-graph and sot-core do not share the
same installation prefix.

I.e. we should allow:

# Load toto.so from default directory.
importPlugin toto
# Add/remove default directories:
pushDefaultPluginPaths /tmp
popDefaultPluginPaths

Important modifications

I open this issue in this package since this is the upstream package,
but the issue concerns the following packages:

  • dynamic-graph,
  • dynamic-graph-python,
  • sot-core,
  • sot-dynamic-pinocchio,
  • dynamic_graph_bridge,
  • roscontrol_sot,
  • sot-universal-robot.

I have made important modifications in these packages that I will submit in several pull requests and I suggest to include these modifications in a version 5 of the software.

Motivation and first modifications

The first motivation came from the observation that initializing a robot in a
ROS environment was difficult since two models of the robot coexist:

  • one in DynamicPinocchio that reads a URDF string from
    robot_description parameter,
  • one in Device that reads some ROS parameter to known which joints are
    actuated via roscontrol.

The two models do not necessarily have the same dimension. For example, Franka
robot have 7 joints controlled via roscontrol and 2 gripper joints controlled
via ros actions.

Following a long discussion among users of the software, and in order
to make initialization more general, I first extracted the integration of the
velocity from the Device and created a special entity called Integrator.

The second motivation came from the observation that on some robots, the
control loop is not regularly called as it should be, but the time since last
call is passed to the controller (https://github.com/stack-of-tasks/sot-core/blob/d49cab80bc8160dcb9da10afdd6a8e1f51e37553/include/sot/core/abstract-sot-external-interface.hh#L59).

The problem was to pass this time to the new integrator. I decided to use the
signal time to do so, converting the period into microseconds. Between two
evaluations of the integrator output, the time is now incremented by a number
much bigger than 1 (as previously).

The modifications described here are merged in the devel branches, but not
yet released. I think we should not release them.

Further modifications

Then I realized that the type for signal time (int) is encoded on 32bits. I naively thought that the size of int had changed to 64bits on modern CPUs. As a
result, everything worked fine for 35 minutes and then the time was overflown.

To fix the overflow issue, I then changed the signal type into long int
(or int64_t). This change modifies most of the API and I think we should switch
to version 5 since the overall modifications is important.

Mainly,

  • I defined a typedef dynamicgraph::size_type as Eigen Index type,
  • I defined a typedef dynamicgraph::int64_t sigtime_t,
  • I changed most occurences of int to size_type,
  • I changed most occurences of unsigned int to std::size_t,
  • I simplified SignalPtr class: it is not anymore possible to plug a
    Signal<A> into a SignalPtr<B> if B is not A (formerly, A could
    derive from B). This feature is not anymore used.

SEND_MSG IS FAILING !!!

When doing test on sot-talos-balance the call to SEND_MSG is crashing.
This should have been detected through unit tests.

Documentation main page is broken

The documentation main page does not compile currently (54e5e6e).

/home/thomas/profiles/laas/src/unstable/sot/dynamic-graph/doc/additionalDoc/package.h:184: warning: reached end of file while inside a f$ block!

Fix it.

In the branch topic/submodule, Doxygen produces doc/doxygen.log.
It would be nice to fix all the errors it contains.

Here is the full transcript of this file as it is produces on my computer:

warning: source /home/thomas/profiles/laas/src/unstable/sot/dynamic-graph/tests is not a readable file or directory... skipping.
/home/thomas/profiles/laas/src/unstable/sot/dynamic-graph/include/dynamic-graph/time-dependency.t.cpp:72: Warning: include file dynamic-graph/debug.h not found, perhaps you forgot to add its directory to INCLUDE_PATH?
/home/thomas/profiles/laas/src/unstable/sot/dynamic-graph/doc/additionalDoc/package.h:184: warning: reached end of file while inside a f$ block!
The command that should end the block seems to be missing!

/home/thomas/profiles/laas/src/unstable/sot/dynamic-graph/doc/additionalDoc/dgshell_doc.h:12: warning: unable to resolve reference to `scriptingabout' for \ref command
/home/thomas/profiles/laas/src/unstable/sot/dynamic-graph/doc/additionalDoc/tracerdoc.h:3: warning: Unsupported xml/html tag  found
/home/thomas/profiles/laas/src/unstable/sot/dynamic-graph/include/dynamic-graph/interpreter-helper.h:135: warning: Unsupported xml/html tag  found
/home/thomas/profiles/laas/src/unstable/sot/dynamic-graph/include/dynamic-graph/interpreter-helper.h:135: warning: Unsupported xml/html tag  found
/home/thomas/profiles/laas/src/unstable/sot/dynamic-graph/include/dynamic-graph/interpreter-helper.h:96: warning: argument 'obj1.' of command @param is not found in the argument list of dynamicgraph::InterpreterHelper::cmdPlug(const std::string &obj1, const std::string &signame1, const std::string &obj2, const std::string &signame2, std::ostream &os)
/home/thomas/profiles/laas/src/unstable/sot/dynamic-graph/include/dynamic-graph/interpreter-helper.h:96: warning: argument 'obj2.' of command @param is not found in the argument list of dynamicgraph::InterpreterHelper::cmdPlug(const std::string &obj1, const std::string &signame1, const std::string &obj2, const std::string &signame2, std::ostream &os)
/home/thomas/profiles/laas/src/unstable/sot/dynamic-graph/include/dynamic-graph/interpreter-helper.h:96: warning: The following parameters of dynamicgraph::InterpreterHelper::cmdPlug(const std::string &obj1, const std::string &signame1, const std::string &obj2, const std::string &signame2, std::ostream &os) are not documented:
  parameter 'obj1'
  parameter 'obj2'
  parameter 'os'
/home/thomas/profiles/laas/src/unstable/sot/dynamic-graph/include/dynamic-graph/interpreter.h:155: warning: Unsupported xml/html tag  found
/home/thomas/profiles/laas/src/unstable/sot/dynamic-graph/include/dynamic-graph/interpreter.h:155: warning: Unsupported xml/html tag  found
/home/thomas/profiles/laas/src/unstable/sot/dynamic-graph/include/dynamic-graph/pool.h:118: warning: expected whitespace after b command
/home/thomas/profiles/laas/src/unstable/sot/dynamic-graph/include/dynamic-graph/pool.h:120: warning: end of comment block while expecting command 

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.