Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Stack Of Tasks
dynamic-graph-python
Commits
34b43cad
Commit
34b43cad
authored
Oct 02, 2019
by
Guilhem Saurel
Browse files
add dynamic-graph-py.hh
parent
d4a89710
Changes
9
Hide whitespace changes
Inline
Side-by-side
src/debug-py.cc
View file @
34b43cad
...
...
@@ -15,6 +15,7 @@
#include
"exception.hh"
#include
<boost/shared_ptr.hpp>
#include
"dynamic-graph-py.hh"
typedef
boost
::
shared_ptr
<
std
::
ofstream
>
ofstreamShrPtr
;
...
...
src/dynamic-graph-py.cc
View file @
34b43cad
...
...
@@ -10,72 +10,12 @@
#include
<dynamic-graph/signal-base.h>
#include
"exception.hh"
#include
"dynamic-graph-py.hh"
#include
"signal-wrapper.hh"
namespace
dynamicgraph
{
namespace
python
{
// Declare functions defined in other source files
namespace
signalBase
{
extern
PyObject
*
create
(
PyObject
*
self
,
PyObject
*
args
);
extern
PyObject
*
createSignalWrapper
(
PyObject
*
self
,
PyObject
*
args
);
extern
PyObject
*
getTime
(
PyObject
*
self
,
PyObject
*
args
);
extern
PyObject
*
setTime
(
PyObject
*
self
,
PyObject
*
args
);
extern
PyObject
*
getName
(
PyObject
*
self
,
PyObject
*
args
);
extern
PyObject
*
getClassName
(
PyObject
*
self
,
PyObject
*
args
);
extern
PyObject
*
display
(
PyObject
*
self
,
PyObject
*
args
);
extern
PyObject
*
displayDependencies
(
PyObject
*
self
,
PyObject
*
args
);
extern
PyObject
*
getValue
(
PyObject
*
self
,
PyObject
*
args
);
extern
PyObject
*
setValue
(
PyObject
*
self
,
PyObject
*
args
);
extern
PyObject
*
recompute
(
PyObject
*
self
,
PyObject
*
args
);
extern
PyObject
*
unplug
(
PyObject
*
self
,
PyObject
*
args
);
extern
PyObject
*
isPlugged
(
PyObject
*
self
,
PyObject
*
args
);
extern
PyObject
*
getPlugged
(
PyObject
*
self
,
PyObject
*
args
);
}
// namespace signalBase
namespace
entity
{
extern
PyObject
*
create
(
PyObject
*
self
,
PyObject
*
args
);
extern
PyObject
*
display
(
PyObject
*
self
,
PyObject
*
args
);
extern
PyObject
*
display
(
PyObject
*
self
,
PyObject
*
args
);
extern
PyObject
*
getName
(
PyObject
*
self
,
PyObject
*
args
);
extern
PyObject
*
getClassName
(
PyObject
*
self
,
PyObject
*
args
);
extern
PyObject
*
hasSignal
(
PyObject
*
self
,
PyObject
*
args
);
extern
PyObject
*
getSignal
(
PyObject
*
self
,
PyObject
*
args
);
extern
PyObject
*
listSignals
(
PyObject
*
self
,
PyObject
*
args
);
extern
PyObject
*
executeCommand
(
PyObject
*
self
,
PyObject
*
args
);
extern
PyObject
*
listCommands
(
PyObject
*
self
,
PyObject
*
args
);
extern
PyObject
*
getCommandDocstring
(
PyObject
*
self
,
PyObject
*
args
);
extern
PyObject
*
getDocString
(
PyObject
*
self
,
PyObject
*
args
);
extern
PyObject
*
setLoggerVerbosityLevel
(
PyObject
*
self
,
PyObject
*
args
);
extern
PyObject
*
getLoggerVerbosityLevel
(
PyObject
*
self
,
PyObject
*
args
);
extern
PyObject
*
setTimeSample
(
PyObject
*
self
,
PyObject
*
args
);
extern
PyObject
*
getTimeSample
(
PyObject
*
self
,
PyObject
*
args
);
extern
PyObject
*
setStreamPrintPeriod
(
PyObject
*
self
,
PyObject
*
args
);
extern
PyObject
*
getStreamPrintPeriod
(
PyObject
*
self
,
PyObject
*
args
);
}
// namespace entity
namespace
factory
{
extern
PyObject
*
getEntityClassList
(
PyObject
*
self
,
PyObject
*
args
);
}
namespace
signalCaster
{
extern
PyObject
*
getSignalTypeList
(
PyObject
*
self
,
PyObject
*
args
);
}
namespace
pool
{
extern
PyObject
*
writeGraph
(
PyObject
*
self
,
PyObject
*
args
);
extern
PyObject
*
getEntityList
(
PyObject
*
self
,
PyObject
*
args
);
}
// namespace pool
namespace
debug
{
extern
PyObject
*
addLoggerFileOutputStream
(
PyObject
*
self
,
PyObject
*
args
);
extern
PyObject
*
addLoggerCoutOutputStream
(
PyObject
*
self
,
PyObject
*
args
);
extern
PyObject
*
closeLoggerFileOutputStream
(
PyObject
*
self
,
PyObject
*
args
);
extern
PyObject
*
realTimeLoggerSpinOnce
(
PyObject
*
self
,
PyObject
*
args
);
extern
PyObject
*
realTimeLoggerDestroy
(
PyObject
*
self
,
PyObject
*
args
);
extern
PyObject
*
realTimeLoggerInstance
(
PyObject
*
self
,
PyObject
*
args
);
}
// namespace debug
struct
module_state
{
PyObject
*
dgpyError
;
};
/**
\brief plug a signal into another one.
*/
...
...
@@ -142,21 +82,15 @@ PyObject* enableTrace(PyObject* /*self*/, PyObject* args) {
}
return
Py_BuildValue
(
""
);
}
#if PY_MAJOR_VERSION >= 3
#define GETSTATE(m) ((struct dynamicgraph::python::module_state*)PyModule_GetState(m))
#else
#define GETSTATE(m) (&dynamicgraph::python::_state)
static
struct
dynamicgraph
::
python
::
module_state
_state
;
#endif
static
PyObject
*
PyObject
*
error_out
(
#if PY_MAJOR_VERSION >= 3
error_out
(
PyObject
*
m
,
PyObject
*
)
{
struct
module_state
*
st
=
GETSTATE
(
m
);
PyObject
*
m
,
PyObject
*
#else
error_out
(
PyObject
*
,
PyObject
*
)
{
struct
module_state
*
st
=
&
dynamicgraph
::
python
::
_state
;
PyObject
*
,
PyObject
*
#endif
)
{
struct
module_state
*
st
=
GETSTATE
(
m
);
PyErr_SetString
(
st
->
dgpyError
,
"something bad happened"
);
return
NULL
;
}
...
...
@@ -164,116 +98,16 @@ static PyObject *
}
// namespace python
}
// namespace dynamicgraph
/**
\brief List of python functions
*/
static
PyMethodDef
dynamicGraphMethods
[]
=
{
{
"w_plug"
,
dynamicgraph
::
python
::
plug
,
METH_VARARGS
,
"plug an output signal into an input signal"
},
{
"enableTrace"
,
dynamicgraph
::
python
::
enableTrace
,
METH_VARARGS
,
"Enable or disable tracing debug info in a file"
},
// Signals
{
"create_signal_base"
,
dynamicgraph
::
python
::
signalBase
::
create
,
METH_VARARGS
,
"create a SignalBase C++ object"
},
{
"create_signal_wrapper"
,
dynamicgraph
::
python
::
signalBase
::
createSignalWrapper
,
METH_VARARGS
,
"create a SignalWrapper C++ object"
},
{
"signal_base_get_time"
,
dynamicgraph
::
python
::
signalBase
::
getTime
,
METH_VARARGS
,
"Get time of a SignalBase"
},
{
"signal_base_set_time"
,
dynamicgraph
::
python
::
signalBase
::
setTime
,
METH_VARARGS
,
"Set time of a SignalBase"
},
{
"signal_base_get_name"
,
dynamicgraph
::
python
::
signalBase
::
getName
,
METH_VARARGS
,
"Get the name of a signal"
},
{
"signal_base_get_class_name"
,
dynamicgraph
::
python
::
signalBase
::
getClassName
,
METH_VARARGS
,
"Get the class name of a signal"
},
{
"signal_base_display"
,
dynamicgraph
::
python
::
signalBase
::
display
,
METH_VARARGS
,
"Print the signal in a string"
},
{
"signal_base_display_dependencies"
,
dynamicgraph
::
python
::
signalBase
::
displayDependencies
,
METH_VARARGS
,
"Print the signal dependencies in a string"
},
{
"signal_base_get_value"
,
dynamicgraph
::
python
::
signalBase
::
getValue
,
METH_VARARGS
,
"Read the value of a signal"
},
{
"signal_base_set_value"
,
dynamicgraph
::
python
::
signalBase
::
setValue
,
METH_VARARGS
,
"Set the value of a signal"
},
{
"signal_base_recompute"
,
dynamicgraph
::
python
::
signalBase
::
recompute
,
METH_VARARGS
,
"Recompute the signal at given time"
},
{
"signal_base_unplug"
,
dynamicgraph
::
python
::
signalBase
::
unplug
,
METH_VARARGS
,
"Unplug the signal"
},
{
"signal_base_isPlugged"
,
dynamicgraph
::
python
::
signalBase
::
isPlugged
,
METH_VARARGS
,
"Whether the signal is plugged"
},
{
"signal_base_getPlugged"
,
dynamicgraph
::
python
::
signalBase
::
getPlugged
,
METH_VARARGS
,
"To which signal the signal is plugged"
},
// Entity
{
"create_entity"
,
dynamicgraph
::
python
::
entity
::
create
,
METH_VARARGS
,
"create an Entity C++ object"
},
{
"display_entity"
,
dynamicgraph
::
python
::
entity
::
display
,
METH_VARARGS
,
"print an Entity C++ object"
},
{
"entity_get_name"
,
dynamicgraph
::
python
::
entity
::
getName
,
METH_VARARGS
,
"get the name of an Entity"
},
{
"entity_get_class_name"
,
dynamicgraph
::
python
::
entity
::
getClassName
,
METH_VARARGS
,
"get the class name of an Entity"
},
{
"entity_has_signal"
,
dynamicgraph
::
python
::
entity
::
hasSignal
,
METH_VARARGS
,
"return True if the entity has a signal with the given name"
},
{
"entity_get_signal"
,
dynamicgraph
::
python
::
entity
::
getSignal
,
METH_VARARGS
,
"get signal by name from an Entity"
},
{
"entity_list_signals"
,
dynamicgraph
::
python
::
entity
::
listSignals
,
METH_VARARGS
,
"Return the list of signals of an entity."
},
{
"entity_execute_command"
,
dynamicgraph
::
python
::
entity
::
executeCommand
,
METH_VARARGS
,
"execute a command"
},
{
"entity_list_commands"
,
dynamicgraph
::
python
::
entity
::
listCommands
,
METH_VARARGS
,
"list the commands of an entity"
},
{
"entity_get_command_docstring"
,
dynamicgraph
::
python
::
entity
::
getCommandDocstring
,
METH_VARARGS
,
"get the docstring of an entity command"
},
{
"entity_get_docstring"
,
dynamicgraph
::
python
::
entity
::
getDocString
,
METH_VARARGS
,
"get the doc string of an entity type"
},
{
"factory_get_entity_class_list"
,
dynamicgraph
::
python
::
factory
::
getEntityClassList
,
METH_VARARGS
,
"return the list of entity classes"
},
{
"signal_caster_get_type_list"
,
dynamicgraph
::
python
::
signalCaster
::
getSignalTypeList
,
METH_VARARGS
,
"return the list of signal type names"
},
{
"writeGraph"
,
dynamicgraph
::
python
::
pool
::
writeGraph
,
METH_VARARGS
,
"Write the graph of entities in a filename."
},
{
"get_entity_list"
,
dynamicgraph
::
python
::
pool
::
getEntityList
,
METH_VARARGS
,
"return the list of instanciated entities"
},
{
"entity_set_logger_verbosity"
,
dynamicgraph
::
python
::
entity
::
setLoggerVerbosityLevel
,
METH_VARARGS
,
"set the verbosity level of the entity"
},
{
"entity_get_logger_verbosity"
,
dynamicgraph
::
python
::
entity
::
getLoggerVerbosityLevel
,
METH_VARARGS
,
"get the verbosity level of the entity"
},
{
"addLoggerFileOutputStream"
,
dynamicgraph
::
python
::
debug
::
addLoggerFileOutputStream
,
METH_VARARGS
,
"add a output file stream to the logger by filename"
},
{
"addLoggerCoutOutputStream"
,
dynamicgraph
::
python
::
debug
::
addLoggerCoutOutputStream
,
METH_VARARGS
,
"add std::cout as output stream to the logger"
},
{
"closeLoggerFileOutputStream"
,
dynamicgraph
::
python
::
debug
::
closeLoggerFileOutputStream
,
METH_VARARGS
,
"close all the loggers file output streams."
},
{
"entity_set_time_sample"
,
dynamicgraph
::
python
::
entity
::
setTimeSample
,
METH_VARARGS
,
"set the time sample for printing debugging information"
},
{
"entity_get_time_sample"
,
dynamicgraph
::
python
::
entity
::
getTimeSample
,
METH_VARARGS
,
"get the time sample for printing debugging information"
},
{
"entity_set_stream_print_period"
,
dynamicgraph
::
python
::
entity
::
setStreamPrintPeriod
,
METH_VARARGS
,
"set the period at which debugging information are printed"
},
{
"entity_get_stream_print_period"
,
dynamicgraph
::
python
::
entity
::
getStreamPrintPeriod
,
METH_VARARGS
,
"get the period at which debugging information are printed"
},
{
"real_time_logger_destroy"
,
dynamicgraph
::
python
::
debug
::
realTimeLoggerDestroy
,
METH_VARARGS
,
"Destroy the real time logger."
},
{
"real_time_logger_spin_once"
,
dynamicgraph
::
python
::
debug
::
realTimeLoggerSpinOnce
,
METH_VARARGS
,
"Destroy the real time logger."
},
{
"real_time_logger_instance"
,
dynamicgraph
::
python
::
debug
::
realTimeLoggerInstance
,
METH_VARARGS
,
"Starts the real time logger."
},
{
"error_out"
,
(
PyCFunction
)
dynamicgraph
::
python
::
error_out
,
METH_NOARGS
,
NULL
},
{
NULL
,
NULL
,
0
,
NULL
}
/* Sentinel */
};
#if PY_MAJOR_VERSION >= 3
static
struct
PyModuleDef
moduledef
=
{
PyModuleDef_HEAD_INIT
,
"dynamic_graph"
,
NULL
,
sizeof
(
struct
dynamicgraph
::
python
::
module_state
),
dynamicGraphMethods
,
NULL
,
NULL
,
NULL
,
NULL
};
#define INITERROR return NULL
PyMODINIT_FUNC
PyInit_dynamic_graph
(
void
)
PyMODINIT_FUNC
PyInit_dynamic_graph
(
void
)
#else
#define INITERROR return
void
initdynamic_graph
(
void
)
void
initdynamic_graph
(
void
)
#endif
{
#if PY_MAJOR_VERSION >= 3
PyObject
*
module
=
PyModule_Create
(
&
moduledef
);
PyObject
*
module
=
PyModule_Create
(
&
dynamicgraph
::
python
::
moduledef
);
#else
PyObject
*
module
=
Py_InitModule
(
"dynamic_graph"
,
dynamicGraphMethods
);
PyObject
*
module
=
Py_InitModule
(
"dynamic_graph"
,
dynamicgraph
::
python
::
dynamicGraphMethods
);
#endif
if
(
module
==
NULL
)
...
...
src/dynamic-graph-py.hh
0 → 100644
View file @
34b43cad
#ifndef DYNAMIC_GRAPH_PY
#define DYNAMIC_GRAPH_PY
#include
<Python.h>
#include
<iostream>
#include
<sstream>
#include
<string>
#include
<dynamic-graph/debug.h>
#include
<dynamic-graph/exception-factory.h>
#include
<dynamic-graph/signal-base.h>
#include
"signal-wrapper.hh"
namespace
dynamicgraph
{
namespace
python
{
// Declare functions defined in other source files
namespace
signalBase
{
PyObject
*
create
(
PyObject
*
self
,
PyObject
*
args
);
PyObject
*
createSignalWrapper
(
PyObject
*
self
,
PyObject
*
args
);
PyObject
*
getTime
(
PyObject
*
self
,
PyObject
*
args
);
PyObject
*
setTime
(
PyObject
*
self
,
PyObject
*
args
);
PyObject
*
getName
(
PyObject
*
self
,
PyObject
*
args
);
PyObject
*
getClassName
(
PyObject
*
self
,
PyObject
*
args
);
PyObject
*
display
(
PyObject
*
self
,
PyObject
*
args
);
PyObject
*
displayDependencies
(
PyObject
*
self
,
PyObject
*
args
);
PyObject
*
getValue
(
PyObject
*
self
,
PyObject
*
args
);
PyObject
*
setValue
(
PyObject
*
self
,
PyObject
*
args
);
PyObject
*
recompute
(
PyObject
*
self
,
PyObject
*
args
);
PyObject
*
unplug
(
PyObject
*
self
,
PyObject
*
args
);
PyObject
*
isPlugged
(
PyObject
*
self
,
PyObject
*
args
);
PyObject
*
getPlugged
(
PyObject
*
self
,
PyObject
*
args
);
}
// namespace signalBase
namespace
entity
{
PyObject
*
create
(
PyObject
*
self
,
PyObject
*
args
);
PyObject
*
display
(
PyObject
*
self
,
PyObject
*
args
);
PyObject
*
display
(
PyObject
*
self
,
PyObject
*
args
);
PyObject
*
getName
(
PyObject
*
self
,
PyObject
*
args
);
PyObject
*
getClassName
(
PyObject
*
self
,
PyObject
*
args
);
PyObject
*
hasSignal
(
PyObject
*
self
,
PyObject
*
args
);
PyObject
*
getSignal
(
PyObject
*
self
,
PyObject
*
args
);
PyObject
*
listSignals
(
PyObject
*
self
,
PyObject
*
args
);
PyObject
*
executeCommand
(
PyObject
*
self
,
PyObject
*
args
);
PyObject
*
listCommands
(
PyObject
*
self
,
PyObject
*
args
);
PyObject
*
getCommandDocstring
(
PyObject
*
self
,
PyObject
*
args
);
PyObject
*
getDocString
(
PyObject
*
self
,
PyObject
*
args
);
PyObject
*
setLoggerVerbosityLevel
(
PyObject
*
self
,
PyObject
*
args
);
PyObject
*
getLoggerVerbosityLevel
(
PyObject
*
self
,
PyObject
*
args
);
PyObject
*
setTimeSample
(
PyObject
*
self
,
PyObject
*
args
);
PyObject
*
getTimeSample
(
PyObject
*
self
,
PyObject
*
args
);
PyObject
*
setStreamPrintPeriod
(
PyObject
*
self
,
PyObject
*
args
);
PyObject
*
getStreamPrintPeriod
(
PyObject
*
self
,
PyObject
*
args
);
}
// namespace entity
namespace
factory
{
PyObject
*
getEntityClassList
(
PyObject
*
self
,
PyObject
*
args
);
}
namespace
signalCaster
{
PyObject
*
getSignalTypeList
(
PyObject
*
self
,
PyObject
*
args
);
}
namespace
pool
{
PyObject
*
writeGraph
(
PyObject
*
self
,
PyObject
*
args
);
PyObject
*
getEntityList
(
PyObject
*
self
,
PyObject
*
args
);
}
// namespace pool
namespace
debug
{
PyObject
*
addLoggerFileOutputStream
(
PyObject
*
self
,
PyObject
*
args
);
PyObject
*
addLoggerCoutOutputStream
(
PyObject
*
self
,
PyObject
*
args
);
PyObject
*
closeLoggerFileOutputStream
(
PyObject
*
self
,
PyObject
*
args
);
PyObject
*
realTimeLoggerSpinOnce
(
PyObject
*
self
,
PyObject
*
args
);
PyObject
*
realTimeLoggerDestroy
(
PyObject
*
self
,
PyObject
*
args
);
PyObject
*
realTimeLoggerInstance
(
PyObject
*
self
,
PyObject
*
args
);
}
// namespace debug
struct
module_state
{
PyObject
*
dgpyError
;
};
PyObject
*
plug
(
PyObject
*
/*self*/
,
PyObject
*
args
);
PyObject
*
enableTrace
(
PyObject
*
/*self*/
,
PyObject
*
args
);
PyObject
*
error_out
(
#if PY_MAJOR_VERSION >= 3
PyObject
*
m
,
PyObject
*
#else
PyObject
*
,
PyObject
*
#endif
);
/**
\brief List of python functions
*/
__attribute__
((
unused
))
static
PyMethodDef
dynamicGraphMethods
[]
=
{
{
"w_plug"
,
dynamicgraph
::
python
::
plug
,
METH_VARARGS
,
"plug an output signal into an input signal"
},
{
"enableTrace"
,
dynamicgraph
::
python
::
enableTrace
,
METH_VARARGS
,
"Enable or disable tracing debug info in a file"
},
// Signals
{
"create_signal_base"
,
dynamicgraph
::
python
::
signalBase
::
create
,
METH_VARARGS
,
"create a SignalBase C++ object"
},
{
"create_signal_wrapper"
,
dynamicgraph
::
python
::
signalBase
::
createSignalWrapper
,
METH_VARARGS
,
"create a SignalWrapper C++ object"
},
{
"signal_base_get_time"
,
dynamicgraph
::
python
::
signalBase
::
getTime
,
METH_VARARGS
,
"Get time of a SignalBase"
},
{
"signal_base_set_time"
,
dynamicgraph
::
python
::
signalBase
::
setTime
,
METH_VARARGS
,
"Set time of a SignalBase"
},
{
"signal_base_get_name"
,
dynamicgraph
::
python
::
signalBase
::
getName
,
METH_VARARGS
,
"Get the name of a signal"
},
{
"signal_base_get_class_name"
,
dynamicgraph
::
python
::
signalBase
::
getClassName
,
METH_VARARGS
,
"Get the class name of a signal"
},
{
"signal_base_display"
,
dynamicgraph
::
python
::
signalBase
::
display
,
METH_VARARGS
,
"Print the signal in a string"
},
{
"signal_base_display_dependencies"
,
dynamicgraph
::
python
::
signalBase
::
displayDependencies
,
METH_VARARGS
,
"Print the signal dependencies in a string"
},
{
"signal_base_get_value"
,
dynamicgraph
::
python
::
signalBase
::
getValue
,
METH_VARARGS
,
"Read the value of a signal"
},
{
"signal_base_set_value"
,
dynamicgraph
::
python
::
signalBase
::
setValue
,
METH_VARARGS
,
"Set the value of a signal"
},
{
"signal_base_recompute"
,
dynamicgraph
::
python
::
signalBase
::
recompute
,
METH_VARARGS
,
"Recompute the signal at given time"
},
{
"signal_base_unplug"
,
dynamicgraph
::
python
::
signalBase
::
unplug
,
METH_VARARGS
,
"Unplug the signal"
},
{
"signal_base_isPlugged"
,
dynamicgraph
::
python
::
signalBase
::
isPlugged
,
METH_VARARGS
,
"Whether the signal is plugged"
},
{
"signal_base_getPlugged"
,
dynamicgraph
::
python
::
signalBase
::
getPlugged
,
METH_VARARGS
,
"To which signal the signal is plugged"
},
// Entity
{
"create_entity"
,
dynamicgraph
::
python
::
entity
::
create
,
METH_VARARGS
,
"create an Entity C++ object"
},
{
"display_entity"
,
dynamicgraph
::
python
::
entity
::
display
,
METH_VARARGS
,
"print an Entity C++ object"
},
{
"entity_get_name"
,
dynamicgraph
::
python
::
entity
::
getName
,
METH_VARARGS
,
"get the name of an Entity"
},
{
"entity_get_class_name"
,
dynamicgraph
::
python
::
entity
::
getClassName
,
METH_VARARGS
,
"get the class name of an Entity"
},
{
"entity_has_signal"
,
dynamicgraph
::
python
::
entity
::
hasSignal
,
METH_VARARGS
,
"return True if the entity has a signal with the given name"
},
{
"entity_get_signal"
,
dynamicgraph
::
python
::
entity
::
getSignal
,
METH_VARARGS
,
"get signal by name from an Entity"
},
{
"entity_list_signals"
,
dynamicgraph
::
python
::
entity
::
listSignals
,
METH_VARARGS
,
"Return the list of signals of an entity."
},
{
"entity_execute_command"
,
dynamicgraph
::
python
::
entity
::
executeCommand
,
METH_VARARGS
,
"execute a command"
},
{
"entity_list_commands"
,
dynamicgraph
::
python
::
entity
::
listCommands
,
METH_VARARGS
,
"list the commands of an entity"
},
{
"entity_get_command_docstring"
,
dynamicgraph
::
python
::
entity
::
getCommandDocstring
,
METH_VARARGS
,
"get the docstring of an entity command"
},
{
"entity_get_docstring"
,
dynamicgraph
::
python
::
entity
::
getDocString
,
METH_VARARGS
,
"get the doc string of an entity type"
},
{
"factory_get_entity_class_list"
,
dynamicgraph
::
python
::
factory
::
getEntityClassList
,
METH_VARARGS
,
"return the list of entity classes"
},
{
"signal_caster_get_type_list"
,
dynamicgraph
::
python
::
signalCaster
::
getSignalTypeList
,
METH_VARARGS
,
"return the list of signal type names"
},
{
"writeGraph"
,
dynamicgraph
::
python
::
pool
::
writeGraph
,
METH_VARARGS
,
"Write the graph of entities in a filename."
},
{
"get_entity_list"
,
dynamicgraph
::
python
::
pool
::
getEntityList
,
METH_VARARGS
,
"return the list of instanciated entities"
},
{
"entity_set_logger_verbosity"
,
dynamicgraph
::
python
::
entity
::
setLoggerVerbosityLevel
,
METH_VARARGS
,
"set the verbosity level of the entity"
},
{
"entity_get_logger_verbosity"
,
dynamicgraph
::
python
::
entity
::
getLoggerVerbosityLevel
,
METH_VARARGS
,
"get the verbosity level of the entity"
},
{
"addLoggerFileOutputStream"
,
dynamicgraph
::
python
::
debug
::
addLoggerFileOutputStream
,
METH_VARARGS
,
"add a output file stream to the logger by filename"
},
{
"addLoggerCoutOutputStream"
,
dynamicgraph
::
python
::
debug
::
addLoggerCoutOutputStream
,
METH_VARARGS
,
"add std::cout as output stream to the logger"
},
{
"closeLoggerFileOutputStream"
,
dynamicgraph
::
python
::
debug
::
closeLoggerFileOutputStream
,
METH_VARARGS
,
"close all the loggers file output streams."
},
{
"entity_set_time_sample"
,
dynamicgraph
::
python
::
entity
::
setTimeSample
,
METH_VARARGS
,
"set the time sample for printing debugging information"
},
{
"entity_get_time_sample"
,
dynamicgraph
::
python
::
entity
::
getTimeSample
,
METH_VARARGS
,
"get the time sample for printing debugging information"
},
{
"entity_set_stream_print_period"
,
dynamicgraph
::
python
::
entity
::
setStreamPrintPeriod
,
METH_VARARGS
,
"set the period at which debugging information are printed"
},
{
"entity_get_stream_print_period"
,
dynamicgraph
::
python
::
entity
::
getStreamPrintPeriod
,
METH_VARARGS
,
"get the period at which debugging information are printed"
},
{
"real_time_logger_destroy"
,
dynamicgraph
::
python
::
debug
::
realTimeLoggerDestroy
,
METH_VARARGS
,
"Destroy the real time logger."
},
{
"real_time_logger_spin_once"
,
dynamicgraph
::
python
::
debug
::
realTimeLoggerSpinOnce
,
METH_VARARGS
,
"Destroy the real time logger."
},
{
"real_time_logger_instance"
,
dynamicgraph
::
python
::
debug
::
realTimeLoggerInstance
,
METH_VARARGS
,
"Starts the real time logger."
},
{
"error_out"
,
(
PyCFunction
)
dynamicgraph
::
python
::
error_out
,
METH_NOARGS
,
NULL
},
{
NULL
,
NULL
,
0
,
NULL
}
/* Sentinel */
};
#if PY_MAJOR_VERSION >= 3
__attribute__
((
unused
))
static
struct
PyModuleDef
moduledef
=
{
PyModuleDef_HEAD_INIT
,
"dynamic_graph"
,
NULL
,
sizeof
(
struct
dynamicgraph
::
python
::
module_state
),
dynamicGraphMethods
,
NULL
,
NULL
,
NULL
,
NULL
};
#define GETSTATE(m) ((struct dynamicgraph::python::module_state*)PyModule_GetState(m))
#define INITERROR return NULL
#else
__attribute__
((
unused
))
static
struct
module_state
_state
;
#define GETSTATE(m) (&dynamicgraph::python::_state)
#define INITERROR return
#endif
}
// namespace python
}
// namespace dynamicgraph
#endif
src/entity-py.cc
View file @
34b43cad
...
...
@@ -11,6 +11,7 @@
#include
<dynamic-graph/pool.h>
#include
<dynamic-graph/linear-algebra.h>
#include
"dynamic-graph-py.hh"
#include
"convert-dg-to-py.hh"
#include
"exception.hh"
...
...
src/factory-py.cc
View file @
34b43cad
...
...
@@ -4,6 +4,8 @@
#include
<iostream>
#include
<dynamic-graph/factory.h>
#include
"dynamic-graph-py.hh"
using
dynamicgraph
::
Entity
;
using
dynamicgraph
::
ExceptionAbstract
;
...
...
src/pool-py.cc
View file @
34b43cad
...
...
@@ -6,6 +6,8 @@
#include
<vector>
#include
"exception.hh"
#include
"dynamic-graph-py.hh"
namespace
dynamicgraph
{
namespace
python
{
...
...
src/signal-base-py.cc
View file @
34b43cad
...
...
@@ -12,6 +12,7 @@
#include
<dynamic-graph/pool.h>
#include
<dynamic-graph/factory.h>
#include
"dynamic-graph-py.hh"
#include
"convert-dg-to-py.hh"
#include
"exception.hh"
#include
"signal-wrapper.hh"
...
...
src/signal-caster-py.cc
View file @
34b43cad
...
...
@@ -6,6 +6,8 @@
#include
<dynamic-graph/signal-caster.h>
#include
"dynamic-graph-py.hh"
namespace
dynamicgraph
{
namespace
python
{
...
...
src/signal-wrapper.hh
View file @
34b43cad
// Copyright (c) 2018, Joseph Mirabel
// Authors: Joseph Mirabel (joseph.mirabel@laas.fr)
#ifndef DGPY_SIGNAL_WRAPPER
#define DGPY_SIGNAL_WRAPPER
#include
<Python.h>
#include
<dynamic-graph/linear-algebra.h>
...
...
@@ -70,3 +73,4 @@ class SignalWrapper : public Signal<T, Time> {
}
// namespace python
}
// namespace dynamicgraph
#endif
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment