Code Monkey home page Code Monkey logo

ecto's Introduction

Ecto

Ecto is a hybrid C++/Python development framework for constructing and maintaining pipelines. In Ecto, pipelines are constructed in terms of processing units, Cells, connected by data paths, Tendrils, that form Directed Acyclic Graphs, Plasms. Cells are typically written in C++, tendrils may be any type, and the plasm may be executed in a variety of clever ways. Python is uses as a the graph DSL.

Ecto may be found useful in domains such as perception, audio, or robotics.

To get started see the online docs at http://plasmodic.github.io/ecto/

Get and Build Ecto

These instructions are useful if you wish to work with Ecto from source, as a standalone library.

source

We use git for our source control. You can get a copy of our repo by doing the following:

git clone git://github.com/plasmodic/ecto.git

dependencies

Ecto requires

  • CMake
    CMake is used for our build system, and you will need a version >= 2.8
  • Boost
    Anything over 1.40 http://www.boost.org
  • Python
    Ecto should work with 2.6 and up. You should have the development libraries. If you are bellow 2.7 you should install the argparse library
  • optional Sphinx
    Docs are built with sphinx, >= v1.0.7
  • optional gtest
    http://code.google.com/p/googletest

On ubuntu you can get most of these through apt:

sudo apt-get install cmake libboost-all-dev python-dev python-argparse python-yaml libgtest-dev

To build the docs, you should use a very recent version of Sphinx:

sudo easy_install -U sphinx

build

To build you should just follow a normal cmake recipe:

cd ecto
mkdir -p build
cd build
cmake ..
make

test

To validate ecto using our test suite, you may:

cd ecto/build
make
ctest

This should report zero test errors. If it does report an error, please tell us about it here: https://github.com/plasmodic/ecto/issues/new

docs

To create the latest documentation for Ecto:

sudo pip install -U catkin_sphinx
sphinx-build -b html ./doc/source/ ./doc/build

To build documentation for the kitchen:

sphinx-build -b html ./doc/kitchen/ ./doc/build/

Then you can open up ecto/build/doc/html/index.html locally.

install

To install Ecto on your machine:

cd ecto/build
make install

use

See the documentation (http://plasmodic.github.io/ecto/) for detailed usage instructions.

ecto's People

Contributors

awesomebytes avatar cottsay avatar dgossow avatar drmateo avatar edgarriba avatar ethanrublee avatar jihoonl avatar po-jen avatar stonier avatar straszheim avatar tcavallari avatar v4hn avatar vrabaud avatar wjwwood 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  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  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  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

ecto's Issues

fps monitoring

want to know if we're operating at camera speed

may want to instrument things in other ways... where are the hotspots, Hz rate for individual nodes... try to be flexible

FOR MOLD SPORE:

simply be able to demonstrate that we're running at camera speed

sphinx theme

borrow the sphinx theme from ros-cmake, make it greenish with awesome ecto logo

idiom for interfaces

Come up with an ecto interface definition idiom.

e.g. static functions that declare io names/types for a face detector, or tracker, etc...

exception bug

I'm getting

Traceback (most recent call last):
File "./test/scripts/test_metrics.py", line 50, in
incdelay=float(sys.argv[4])
File "./test/scripts/test_metrics.py", line 29, in test_plasm
sched.execute(nthreads, niter)
RuntimeError: std::exception

when what is actually throwing is

throw except::ValueNone("The python value is None, will not copy!.");

generalization of nodes that receive data via exogenous callback

Seems that the pattern

ecto_ros_subscriber<InputType, OutputType, ConverterType>

might be further generalizable... if I'm a JACK audio client then I also register a callback and spin. Maybe better,

AsyncInput<InputType, OutputType, ConverterType, SubscribeAndSpinType>

e.g. something like

AsyncInput<common_msgs::Image, cv::Mat, Img2MatConverter, ROSSubscriber>

make python dependency optional (?)

need (I think)

  • cmake switch to disable python
  • tests that construct graphs and run them via means other than python script (dot reader? yaml?)
  • pythonless factory pattern for dlopening libraries containing ectomodules and looking up available module types

but it is late right now and I don't recall what we discussed about this...

strands in declaration

I want to be able to do something like:

  ecto::strand static_strand = ecto::strand();
  ecto::wrap<imshow>("imshow", "Shows an image in a named window.").set_strand(static_strand);

So that all imshow's are guaranteed to run in same thread, as this is an inherently thread unsafe module.

multiplasms/multischedulers

several here:

  • two plasms that contain the same node N. N might be called by two different schedulers with two different sets of inputs.
  • two plasms, one scheduler. maybe the capabilities here are scheduler-dependent. How important is it to keep a consistent interface across schedulers?

probably the same issues are here as do in 'black box' cases... strands? locks?

strand test is failing

12/19 Test #12: test_strands .....................***Failed 0.64 sec

12: Traceback (most recent call last):
12:   File "/home/erublee/workspace_ecto/ecto/test/scripts/test_strands.py", line 65, in <module>
12:     shouldfail()
12:   File "/home/erublee/workspace_ecto/ecto/test/scripts/test_strands.py", line 61, in shouldfail
12:     assert False, "that should have thrown"
12: AssertionError: that should have thrown

semantic definitions

Come up with hard constraints and documentation for different use cases, and the semantics of ecto.

  • Are inputs const?
  • Is data copied?
  • Are pointers allowed?
  • How to share some global storage between all nodes ( is this outside the scope of ecto )
  • Types of parallelism, pipelining versus parallel DAG exectution

reconfigure

Need to implement the reconfiguration callback logic.

void configure(tendrils& params)
{
  params.register_callback(boost::bind(reconfigure, this,_1)); //global parameter change callback
  value_ = params.get<float>("value");
  params.at<std::string>("not_validated").register_callback(boost::bind(str_cb, this, _1));
  params.at<std::string>("validated").register_callback(boost::bind(str_cb_validated, this, _1));
}

straszheim or ethanrublee may pick this up and claim it.

python packaging

What is the right way to install the ecto python modules and files so that they can support versioning?

can't passthrough non pywrapped objects

Not sure what to do with this one. It seems that you can't write a cell that passes non pywrapped objects through... or maybe I just don't know the idiom and this needs docs...

I'm back to thinking of

inputs.declare("in", ...)
outputs.declare("out", ...)

int process(...)
{
*in = *out;
}

or maybe something other than void... struct opaque {}; or struct unknown {}; ?

graph is a module

Define a method for exporting an existing graph as a module/black box for inclusion in another module.

python / super oo-ness prevents hardware integration

"yet another russian trolling comment"-

This thing should, in some sense, jive with Gary's comments about Matlab being easy to hookup filters and get some tests running on data.

Big annoyance in Ecto layout is the underlying desire for running python or other pc / server side scripting, when in many cases what you really want is to prototype something that ultimately wants to go onto lower-level hardware.

Matlab does this nicely with auto-generating C and VHDL from block-diagram filters ... (p.s. I don't see how to mark this as a comment or feature request as opposed to a bug ... maybe that's on the branch owner ? )

fix Todo FIXME generated docs

there are some try/catches in the normal course of thing in the initialization of modules. this makes debugging that depends on the catching of real errors with 'catch throw' difficult.

% gdb --args python ../test/scripts/test_constant.py
GNU gdb (GDB) 7.2-ubuntu
Copyright (C) 2010 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-linux-gnu".
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>...
Reading symbols from /usr/bin/python...(no debugging symbols found)...done.
(gdb) r
Starting program: /usr/bin/python ../test/scripts/test_constant.py
[Thread debugging using libthread_db enabled]
START static void ecto::Constant::declare_params(ecto::tendrils&)
END static void ecto::Constant::declare_params(ecto::tendrils&)
START static void ecto::Constant::declare_io(const ecto::tendrils&, ecto::tendrils&, ecto::tendrils&)
END static void ecto::Constant::declare_io(const ecto::tendrils&, ecto::tendrils&, ecto::tendrils&)
test running...
START static void ecto::Constant::declare_params(ecto::tendrils&)
END static void ecto::Constant::declare_params(ecto::tendrils&)
Traceback (most recent call last):
  File "../test/scripts/test_constant.py", line 21, in <module>
    test_constant()
  File "../test/scripts/test_constant.py", line 9, in test_constant
    c = ecto.Constant(value=0.50505)
RuntimeError: Could not convert python object to type : boost::shared_ptr<ecto::tendril>

Program exited with code 01.
(gdb) catch throw
Catchpoint 1 (throw)
(gdb) r
Starting program: /usr/bin/python ../test/scripts/test_constant.py
[Thread debugging using libthread_db enabled]
START static void ecto::Constant::declare_params(ecto::tendrils&)
END static void ecto::Constant::declare_params(ecto::tendrils&)
START static void ecto::Constant::declare_io(const ecto::tendrils&, ecto::tendrils&, ecto::tendrils&)
END static void ecto::Constant::declare_io(const ecto::tendrils&, ecto::tendrils&, ecto::tendrils&)
Catchpoint 1 (exception thrown), 0x00007ffff53e8de0 in __cxa_throw () from /usr/lib/libstdc++.so.6
(gdb) where
#0  0x00007ffff53e8de0 in __cxa_throw () from /usr/lib/libstdc++.so.6
#1  0x00007ffff62c74e2 in boost::python::throw_error_already_set() ()
   from /usr/lib/libboost_python-py26.so.1.40.0
#2  0x00007ffff62b5748 in boost::python::converter::registration::to_python(void const volatile*) const ()
   from /usr/lib/libboost_python-py26.so.1.40.0
#3  0x00007fffec841612 in boost::python::converter::shared_ptr_to_python<int> (x=...)
    at /usr/include/boost/python/converter/shared_ptr_to_python.hpp:23
#4  0x00007fffec8410ba in boost::python::converter::detail::shared_ptr_arg_to_python<boost::shared_ptr<int> >::shared_ptr_arg_to_python (this=0x7fffffffb6f0, x=...)
    at /usr/include/boost/python/converter/arg_to_python.hpp:235
#5  0x00007fffec840841 in boost::python::converter::arg_to_python<boost::shared_ptr<int> >::arg_to_python (
    this=0x7fffffffb6f0, x=...) at /usr/include/boost/python/converter/arg_to_python.hpp:256
#6  0x00007fffec83f1e8 in boost::python::api::object_initializer_impl<false, false>::get<boost::shared_ptr<int> > (x=...) at /usr/include/boost/python/object_core.hpp:385
#7  0x00007fffec83da1a in boost::python::api::object_base_initializer<boost::shared_ptr<int> > (x=...)
    at /usr/include/boost/python/object_core.hpp:307
#8  0x00007fffec839e9e in boost::python::api::object::object<boost::shared_ptr<int> > (
    this=0x7fffffffb7a0, x=...) at /usr/include/boost/python/object_core.hpp:326
#9  0x00007fffec833c83 in holder<boost::shared_ptr<int> >::getPython (this=0xdc9ff0)
    at /home/ecto/include/ecto/tendril.hpp:449
#10 0x00007ffff571ed07 in ecto::tendril::extract (this=0x95f860) at /home/ecto/src/lib/tendril.cpp:86
#11 0x00007ffff5722d7e in ecto::print_tendril::operator() (this=0x7fffffffb8f0, tp=...)
    at /home/ecto/src/lib/tendrils.cpp:20
#12 0x00007ffff5723771 in std::for_each<std::_Rb_tree_const_iterator<std::pair<std::basic_string<char, std::char_traits<char>, std::allocator<char> > const, boost::shared_ptr<ecto::tendril> > >, ecto::print_tendril>
    (__first=..., __last=..., __f=...) at /usr/include/c++/4.4/bits/stl_algo.h:4200
#13 0x00007ffff57226ea in ecto::tendrils::print_doc (this=0xdcaa30, out=..., tendrils_name=...)
    at /home/ecto/src/lib/tendrils.cpp:41
#14 0x00007ffff5729293 in ecto::module::gen_doc (this=0xdca9d0, doc=...)
    at /home/ecto/src/lib/module.cpp:81
#15 0x00007fffec814d22 in ecto::module_doc<ecto_test::SharedPass> (doc=...)
    at /home/ecto/include/ecto/ecto.hpp:117
#16 0x00007fffec8132ad in ecto::wrap<ecto_test::SharedPass> (name=0x7fffec8511ae "SharedPass", doc_str=...)
    at /home/ecto/include/ecto/ecto.hpp:147
#17 0x00007fffec80dcef in init_module_ecto_test_rest () at /home/ecto/test/modules/ecto_test.cpp:309
#18 0x00007fffec80dcac in init_module_ecto_test () at /home/ecto/test/modules/ecto_test.cpp:304
#19 0x00007ffff62c754b in boost::python::handle_exception_impl(boost::function0<void>) ()
   from /usr/lib/libboost_python-py26.so.1.40.0
#20 0x00007ffff62c8183 in boost::python::detail::init_module(char const*, void (*)()) ()
   from /usr/lib/libboost_python-py26.so.1.40.0
#21 0x00007fffec80dc94 in initecto_test () at /home/ecto/test/modules/ecto_test.cpp:304
#22 0x00000000004c081c in _PyImport_LoadDynamicModule ()
#23 0x00000000004bed93 in ?? ()
#24 0x00000000004bf00f in ?? ()
#25 0x00000000004bf6cb in ?? ()
#26 0x00000000004bfc14 in PyImport_ImportModuleLevel ()
#27 0x00000000004a16ab in ?? ()
#28 0x000000000041f0c7 in PyObject_Call ()
#29 0x00000000004a226f in ?? ()
#30 0x00000000004a55fc in PyEval_EvalFrameEx ()
#31 0x00000000004a9671 in PyEval_EvalCodeEx ()
#32 0x00000000004a9742 in PyEval_EvalCode ()
#33 0x00000000004c9a0e in PyRun_FileExFlags ()
#34 0x00000000004c9c24 in PyRun_SimpleFileExFlags ()


error message improvement / make inputs/outputs/parameters typesafe?

RuntimeError: Module Throttle_0 threw
in does not exist!

  1. it would be good to know where we are (process or configure?)
  2. suggest "are you looking in the wrong place? For example, are you looking in the parameters for something you declared as an output?

OR

But I think this should probably just be compile-time typesafe... e.g. input/output/params are different kinds of spores and can't just be connected to one another; perhaps provide a spore_cast for situations where you do want to make this kind of connection, or maybe make a more general type.

development practices with multiple ecto-based projects

use cases involving multiple projects that link against ecto and other libraries, e.g. opencv

should you not be able to make install when CMAKE_INSTALL_PREFIX=${CMAKE_SOURCE_DIR}

correct autogeneration of python_path.sh

Can we somehow verify that the PYTHONPATH matches the LD_LIBRARY_PATH

document!

demo modules

for demo purposes: a Ping module that sends the current time, a module that sleeps for some configurable time in process(), and a module that compares the current time to the incoming messiage time, calculates bandwidth (in messages/second) and latency

support cycles!

acyclic is lame, the confusing things happen when hooking up a hands-free looped program!

tendril bounds objects

implement a way for specifying the min,max values of a tendril.

Also maybe a validator (think regex validation for strings).

The goal being that this might be a good way to construct parameter tuning guis.

native debian build

Make this apt-get able using git-buildpackage and willow's deb building system.

"reverse" edges / cycles / delay node

implement reverse edges via "teleport/delay" node that hides the existence of the cycle from the ecto graph. delay node takes the default value for the output (and the number of timesteps delay > 0) as a parameter.

internal plasm impl is ugly

Current impl goes:

module A -> output of A -> input of B -> module B;

should be something along the lines of:

module A -> module B [edge description "output of A to input of B"];

module api flesh out / lockdown

The current interface is so:

struct MyModule
{
  static void declare_params(tendrils& params);
  static void declare_io(const tendrils& params, tendrils& in, tendrils& out);
  void configure(tendrils& params);
  int process(const tendrils& in, tendrils& out);
  void destroy();
};

Do we need something like.

struct MyModule
{
  static void declare_params(tendrils& params);
  static void declare_io(const tendrils& params, tendrils& in, tendrils& out);
  //register expensive callbacks here
  void configure(tendrils& params);
  //called as a global update by user (may choose to ignore expensive parameters as these might have callbacks registered)
  void reconfigure(tendrils& params); // ????
  int process(const tendrils& in, tendrils& out);
  void destroy();
};

parameter tuning

At somepoint need a dynamic gui for tuning module parameters.

tendril interface inadequate

you can't reliably tell whether a tendril is dirty or not when you assign to a nonconst reference returned by get(),
which makes detection of whether parameter values are default or not impossible.

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.