Closed MaximilienNaveau closed 3 years ago
Thanks for this :) As you did test that, could you add an unittest ? If you don't have time for it, you can just copy-paste me your ipython history :)
Eventually, re-implementing the Entity::getDocString
or adding some doxygen documentation explaining what the entity does would be welcome.
I did nit really do much more than:
In [2]: from dynamic_graph.sot.core.smooth_reach import SmoothReach
In [3]: s = SmoothReach
In [4]: s = SmoothReach("banana")
In [5]: s.displaySignals()
--- <banana> signal list:
|-- <Sig:SmoothReach(banana)::output(vector)::goal (Type Fun)
|-- <Sig:SmoothReach(banana)::input(vector)::start (Type Cst) UNPLUGGED
In [6]: s.goal?
Type: SignalTimeDependentVector
String form: Sig:SmoothReach(banana)::output(vector)::goal (Type Fun)
File: ~/devel/workspace_ros2/install/lib/python3.6/site-packages/dynamic_graph/wrap.so
Docstring: <no docstring>
Init docstring:
Raises an exception
This class cannot be instantiated from Python
In [7]: s.set?
Type: Command
String form: <dynamic_graph.wrap.Command object at 0x7fe53511b260>
File: ~/devel/workspace_ros2/install/lib/python3.6/site-packages/dynamic_graph/wrap.so
Docstring:
Set the curve.
Input:
- A vector (goal).
Input:
- A int (duration).
Void return.
Init docstring:
Raises an exception
This class cannot be instantiated from Python
Call docstring:
object __call__(tuple args, dict kwds) :
execute the command
C++ signature :
object __call__(tuple args, dict kwds)
In [8]:
For the doc and test I do not really have time right now but we can keep an issue open and I will do it a bit later. WDYT?
Eventually, re-implementing the
Entity::getDocString
or adding some doxygen documentation explaining what the entity does would be welcome.
Do you have a link to a file where this getDocString is implemented?
You only have to reimplement function virtual std::string Entity::getDocString() const
in inherited entities. The result of this function is used as class docstring in Python.
done for the dumb test: https://github.com/nim65s/sot-core/commit/f2d69e916aa9132fb28574ef8f1d28b4278c22b7
Thanks @nim65s !
Should I merge ?
Yes from my part I will do another PR for more unit-tests and doc
Re-packaged the smooth reach entity as it is very handy to initialize the experiment using a switch_vector.
I tested it by loading the entity into an ipython and displaying the signals.
I will also use it in my controllers.