<?xml version="1.0" encoding="utf-8"?><feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en"><generator uri="https://jekyllrb.com/" version="3.10.0">Jekyll</generator><link href="https://dgerod.xyz-lab.org.es/feed.xml" rel="self" type="application/atom+xml" /><link href="https://dgerod.xyz-lab.org.es/" rel="alternate" type="text/html" hreflang="en" /><updated>2026-11-10T06:46:27+00:00</updated><id>https://dgerod.xyz-lab.org.es/feed.xml</id><title type="html">Diego Escudero</title><subtitle>Diego Escudero, computer engineer specialized in Robotics. Except where otherwise noted, content is licensed under CC BY 3.0.</subtitle><author><name>dgerod</name></author><entry><title type="html">My Python Tricks</title><link href="https://dgerod.xyz-lab.org.es/blog/2018/06/11/tricks-for-python-2.7.html" rel="alternate" type="text/html" title="My Python Tricks" /><published>2018-06-11T00:00:00+00:00</published><updated>2018-06-11T00:00:00+00:00</updated><id>https://dgerod.xyz-lab.org.es/blog/2018/06/11/tricks-for-python-2.7</id><content type="html" xml:base="https://dgerod.xyz-lab.org.es/blog/2018/06/11/tricks-for-python-2.7.html"><![CDATA[<p>I am working on Python 2.7 so it is possible that some trick does not work in Python 3, or maybe there are better options. Please, be aware that I am not always following the pythonic way :stuck_out_tongue_winking_eye: .</p>

<h2 id="checking-arguments-and-return-types">Checking arguments and return types</h2>

<p>Two decorators named as @accepts and @returns can be used to check types of functions and methods of a class. In case that an argument passes to the function or method is not from specified type a ValueError is raised, same thing for the return type. Decorators could be used independently.</p>

<p>Example:</p>

<div class="language-python highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="o">&gt;&gt;&gt;</span> <span class="o">@</span><span class="n">accepts</span><span class="p">(</span><span class="nb">str</span><span class="p">,</span> <span class="nb">int</span><span class="p">)</span>
<span class="p">...</span> <span class="o">@</span><span class="n">returns</span><span class="p">(</span><span class="nb">int</span><span class="p">)</span>
<span class="p">...</span> <span class="k">def</span> <span class="nf">test_function</span><span class="p">(</span><span class="n">a</span><span class="p">,</span> <span class="n">b</span><span class="p">):</span>
<span class="p">...</span>   <span class="k">return</span> <span class="mi">1</span>
 
<span class="o">&gt;&gt;&gt;</span> <span class="n">test_function</span><span class="p">(</span><span class="s">'hello'</span><span class="p">,</span> <span class="mi">100</span><span class="p">)</span>
<span class="p">...</span> <span class="mi">1</span>

<span class="o">&gt;&gt;&gt;</span> <span class="k">class</span> <span class="nc">Test</span><span class="p">(</span><span class="nb">object</span><span class="p">):</span>
<span class="p">...</span> <span class="o">@</span><span class="n">accepts</span><span class="p">(</span><span class="nb">object</span><span class="p">,</span> <span class="nb">str</span><span class="p">,</span> <span class="nb">int</span><span class="p">)</span>
<span class="p">...</span> <span class="o">@</span><span class="n">returns</span><span class="p">(</span><span class="nb">int</span><span class="p">)</span>
<span class="p">...</span> <span class="k">def</span> <span class="nf">test_method</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">a</span><span class="p">,</span> <span class="n">b</span><span class="p">):</span>
<span class="p">...</span>   <span class="k">return</span> <span class="mi">1</span>
    
<span class="o">&gt;&gt;&gt;</span> <span class="n">t</span> <span class="o">=</span> <span class="n">Test</span><span class="p">()</span>
<span class="p">...</span> <span class="n">t</span><span class="p">.</span><span class="n">test_method</span><span class="p">(</span><span class="s">'hello'</span><span class="p">,</span> <span class="mi">100</span><span class="p">)</span>
<span class="p">...</span> <span class="mi">1</span>
</code></pre></div></div>

<p>Code:</p>
<div class="language-python highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="k">def</span> <span class="nf">accepts</span><span class="p">(</span><span class="o">*</span><span class="n">args_types</span><span class="p">,</span> <span class="o">**</span><span class="n">kwargs_types</span><span class="p">):</span>
    <span class="s">"""
    Decorator to check argument types.

    Usage:
        @accepts(str) for functions
        @accedef accepts(*args_types, **kwargs_types):
    """</span>
    <span class="k">def</span> <span class="nf">wrapper</span><span class="p">(</span><span class="n">func</span><span class="p">):</span>
        <span class="k">def</span> <span class="nf">wrapped</span><span class="p">(</span><span class="o">*</span><span class="n">args</span><span class="p">,</span> <span class="o">**</span><span class="n">kwargs</span><span class="p">):</span>
            <span class="k">if</span> <span class="nb">len</span><span class="p">(</span><span class="n">args</span><span class="p">)</span> <span class="o">&gt;</span> <span class="nb">len</span><span class="p">(</span><span class="n">args_types</span><span class="p">):</span>
                <span class="k">raise</span> <span class="nb">TypeError</span><span class="p">(</span><span class="s">"%s() takes at most %s non-keyword arguments (%s given)"</span> <span class="o">%</span> <span class="p">(</span><span class="n">func</span><span class="p">.</span><span class="n">__name__</span><span class="p">,</span> <span class="nb">len</span><span class="p">(</span><span class="n">args_types</span><span class="p">),</span> <span class="nb">len</span><span class="p">(</span><span class="n">args</span><span class="p">)))</span>
            <span class="n">args_pairs</span> <span class="o">=</span> <span class="nb">zip</span><span class="p">(</span><span class="n">args</span><span class="p">,</span> <span class="n">args_types</span><span class="p">)</span>
            <span class="k">for</span> <span class="n">k</span><span class="p">,</span><span class="n">v</span> <span class="ow">in</span> <span class="n">kwargs</span><span class="p">.</span><span class="n">items</span><span class="p">():</span>
                <span class="k">if</span> <span class="n">k</span> <span class="ow">not</span> <span class="ow">in</span> <span class="n">kwargs_types</span><span class="p">:</span>
                    <span class="k">raise</span> <span class="nb">TypeError</span><span class="p">(</span><span class="s">"Unexpected keyword argument '%s' for %s()"</span> <span class="o">%</span> <span class="p">(</span><span class="n">k</span><span class="p">,</span> <span class="n">func</span><span class="p">.</span><span class="n">__name__</span><span class="p">))</span>
                <span class="n">args_pairs</span><span class="p">.</span><span class="n">append</span><span class="p">((</span><span class="n">v</span><span class="p">,</span> <span class="n">kwargs_types</span><span class="p">[</span><span class="n">k</span><span class="p">]))</span>
            <span class="k">for</span> <span class="n">param</span><span class="p">,</span> <span class="n">expected</span> <span class="ow">in</span> <span class="n">args_pairs</span><span class="p">:</span>
                <span class="k">if</span> <span class="n">param</span> <span class="ow">is</span> <span class="ow">not</span> <span class="bp">None</span> <span class="ow">and</span> <span class="ow">not</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">param</span><span class="p">,</span> <span class="n">expected</span><span class="p">):</span>
                    <span class="k">raise</span> <span class="nb">TypeError</span><span class="p">(</span><span class="s">"Parameter '%s' is not %s"</span> <span class="o">%</span> <span class="p">(</span><span class="n">param</span><span class="p">,</span> <span class="n">expected</span><span class="p">.</span><span class="n">__name__</span><span class="p">))</span>
            <span class="k">return</span> <span class="n">func</span><span class="p">(</span><span class="o">*</span><span class="n">args</span><span class="p">,</span> <span class="o">**</span><span class="n">kwargs</span><span class="p">)</span>
        <span class="k">return</span> <span class="n">wrapped</span>
    <span class="k">return</span> <span class="n">wrapper</span>

<span class="k">def</span> <span class="nf">returns</span><span class="p">(</span><span class="n">return_type</span><span class="p">):</span>
    <span class="s">"""
    Decorator to check return type.

    Usage:
        @returns(int)
    """</span>
    <span class="k">def</span> <span class="nf">wrapper</span><span class="p">(</span><span class="n">func</span><span class="p">):</span>
        <span class="k">def</span> <span class="nf">wrapped</span><span class="p">(</span><span class="o">*</span><span class="n">args</span><span class="p">,</span> <span class="o">**</span><span class="n">kwargs</span><span class="p">):</span>
            <span class="n">result</span> <span class="o">=</span> <span class="n">func</span><span class="p">(</span><span class="o">*</span><span class="n">args</span><span class="p">,</span> <span class="o">**</span><span class="n">kwargs</span><span class="p">)</span>
            <span class="k">if</span> <span class="ow">not</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">result</span><span class="p">,</span> <span class="n">return_type</span><span class="p">):</span>
                <span class="k">raise</span> <span class="nb">TypeError</span><span class="p">(</span><span class="s">"return value %r does not match %s"</span> <span class="o">%</span> <span class="p">(</span><span class="n">result</span><span class="p">,</span> <span class="n">return_type</span><span class="p">))</span>
            <span class="k">return</span> <span class="n">result</span>
        <span class="k">return</span> <span class="n">wrapped</span>
    <span class="k">return</span> <span class="n">wrapper</span>
</code></pre></div></div>

<p>References:</p>
<ul>
  <li><a href="https://wiki.python.org/moin/PythonDecoratorLibrary#Type_Enforcement_.28accepts.2Freturns.29">Type enforcement in Decorator Libary</a></li>
  <li><a href="http://blog.mathieu-leplatre.info/python-check-arguments-types.html">Python check arguments types at Mathieu Leplatre’s Blog</a></li>
</ul>

<h2 id="muliple-dispatch">Muliple dispatch</h2>

<p>Python is a dynamically typed language, so the concept of overloading simply does not apply to it. However, it is possible to use multiple dispatch (aka multi mehtods) to simulat this behavior. Multiple dispatch is a feature of some OOP languages in which a function or method can be dynamically dispatched based on the run time type of its arguments.</p>

<p>Example:</p>

<div class="language-python highlighter-rouge"><div class="highlight"><pre class="highlight"><code>
   <span class="o">&gt;&gt;&gt;</span> <span class="kn">from</span> <span class="nn">multipledispatch</span> <span class="kn">import</span> <span class="n">dispatch</span>

   <span class="o">&gt;&gt;&gt;</span> <span class="o">@</span><span class="n">dispatch</span><span class="p">(</span><span class="nb">int</span><span class="p">,</span> <span class="nb">int</span><span class="p">)</span>
   <span class="p">...</span> <span class="k">def</span> <span class="nf">add</span><span class="p">(</span><span class="n">x</span><span class="p">,</span> <span class="n">y</span><span class="p">):</span>
   <span class="p">...</span>     <span class="k">return</span> <span class="n">x</span> <span class="o">+</span> <span class="n">y</span>

   <span class="o">&gt;&gt;&gt;</span> <span class="o">@</span><span class="n">dispatch</span><span class="p">(</span><span class="nb">object</span><span class="p">,</span> <span class="nb">object</span><span class="p">)</span>
   <span class="p">...</span> <span class="k">def</span> <span class="nf">add</span><span class="p">(</span><span class="n">x</span><span class="p">,</span> <span class="n">y</span><span class="p">):</span>
   <span class="p">...</span>     <span class="k">return</span> <span class="s">"%s + %s"</span> <span class="o">%</span> <span class="p">(</span><span class="n">x</span><span class="p">,</span> <span class="n">y</span><span class="p">)</span>

   <span class="o">&gt;&gt;&gt;</span> <span class="n">add</span><span class="p">(</span><span class="mi">1</span><span class="p">,</span> <span class="mi">2</span><span class="p">)</span>
   <span class="mi">3</span>

   <span class="o">&gt;&gt;&gt;</span> <span class="n">add</span><span class="p">(</span><span class="mi">1</span><span class="p">,</span> <span class="s">'hello'</span><span class="p">)</span>
   <span class="s">'1 + hello'</span>
</code></pre></div></div>

<p>References:</p>
<ul>
  <li><a href="https://en.wikipedia.org/wiki/Multiple_dispatch">Understanding the multiple dispatch technique</a></li>
  <li><a href="https://github.com/mrocklin/multipledispatch">Multiple Dispatch package</a></li>
</ul>]]></content><author><name>dgerod</name></author><category term="blog" /><category term="python" /><category term="software" /><category term="programming" /><category term="tricks" /><category term="note" /><summary type="html"><![CDATA[I am working on Python 2.7 so it is possible that some trick does not work in Python 3, or maybe there are better options. Please, be aware that I am not always following the pythonic way :stuck_out_tongue_winking_eye: .]]></summary></entry><entry><title type="html">A visualizer for our robots done using ROS and EtherCAT</title><link href="https://dgerod.xyz-lab.org.es/blog/2015/04/19/robot-visualizer-using-ros-and-ecat.html" rel="alternate" type="text/html" title="A visualizer for our robots done using ROS and EtherCAT" /><published>2015-04-19T00:00:00+00:00</published><updated>2015-04-19T00:00:00+00:00</updated><id>https://dgerod.xyz-lab.org.es/blog/2015/04/19/robot-visualizer-using-ros-and-ecat</id><content type="html" xml:base="https://dgerod.xyz-lab.org.es/blog/2015/04/19/robot-visualizer-using-ros-and-ecat.html"><![CDATA[<p>In the MDT we were thinking about using ROS as development framework to make our life easy when we develop our own machine controller, the NJ controller that integrates <a href="http://industrial.omron.eu/en/products/catalogue/motion_and_drives/machine_automation_controllers/nj_series/nj5_robotics/default.html">robotics functions</a>.</p>

<p><img src="https://user-images.githubusercontent.com/1392333/153720224-1dd30418-bf0c-41b3-8b62-a8193aae4ddf.png" alt="image" /></p>

<p>The NJ controller is programmed using the SYSMAC ￼Studio IDE and it can control 64 servo-drives through the EtherCAT field bus. Due to that, the visualizer is installed on a normal PC with an EtherCAT slave card; and it runs on Ubuntu 14.04 LTS and ROS Indigo.</p>

<p><img src="https://user-images.githubusercontent.com/1392333/153720213-e5d987a5-1c7e-482d-a337-2ca5348e5c67.png" alt="image" /></p>

<p>The visualizer is composed by two main parts:</p>

<ul>
  <li>The simulator of EtherCAT slaves.</li>
  <li>The ROS meta-package that visualizes the family of delta robots.</li>
</ul>

<p>The EtherCAT slave simulator reads the axes commanded positions sent by the controller, forwards them to a ROS node, and closes the loop providing feedback to the controller. After that the ROS meta-package calculates the full positions of the delta robots based on the provided positions and visualizes them using RViz.</p>

<p><img src="https://user-images.githubusercontent.com/1392333/153720236-123353b7-520e-471c-936b-ed757b87c5a6.png" alt="image" /> <img src="https://user-images.githubusercontent.com/1392333/153720241-46ccc0de-4589-4999-81ee-a98d00211ee5.png" alt="image" /></p>

<p>The work was done by <a href="https://github.com/FelipMarti">F. Martí</a> during his winter internship at <a href="https://industrial.omron.eu">OMRON Industrial Automation</a>. And in his <a href="https://vimeo.com/felipmarti">Vimeo account</a> you could see the <a href="https://vimeo.com/118338456">video of the system working</a> at the Robotics Lab of the MDT that is placed in Barcelona (Spain).</p>

<p>Information about this project was also published in <a href="http://www.ros.org/news/2015/04/visualizer-of-delta-robots-using-ros-and-ethercat.html">ROS Blog</a>.</p>]]></content><author><name>dgerod</name></author><category term="blog" /><category term="robotics" /><category term="delta-3_robot" /><category term="ROS" /><category term="visualizer" /><category term="robot" /><category term="ECAT" /><summary type="html"><![CDATA[In the MDT we were thinking about using ROS as development framework to make our life easy when we develop our own machine controller, the NJ controller that integrates robotics functions.]]></summary></entry><entry><title type="html">Talking about ‘Robotics Flexible Machines’ in ISOLA 2014</title><link href="https://dgerod.xyz-lab.org.es/blog/2014/10/12/talk-isola-2014.html" rel="alternate" type="text/html" title="Talking about ‘Robotics Flexible Machines’ in ISOLA 2014" /><published>2014-10-12T00:00:00+00:00</published><updated>2014-10-12T00:00:00+00:00</updated><id>https://dgerod.xyz-lab.org.es/blog/2014/10/12/talk-isola-2014</id><content type="html" xml:base="https://dgerod.xyz-lab.org.es/blog/2014/10/12/talk-isola-2014.html"><![CDATA[<p>I was invited to do a talk about ‘Flexible Robotics Machines’ in the Industrial Day of the <a href="http://cs.uni-potsdam.de/isola/isola2014">ISOLA 2104</a> conference.</p>

<p>The content of my presentation was:</p>

<ul>
  <li>Flexible machines: Robotics &amp; Vision</li>
  <li>Path recognition with on-fly robot synchronization</li>
  <li>How the system works
    <ul>
      <li>Vision process</li>
      <li>Robotics process</li>
    </ul>
  </li>
  <li>Easy programming</li>
</ul>

<p>Ideas of the presentation are: (1) robots represent a ready-to-use solution with large degrees of freedom that allow to simplify the mechanical problems so that the product handling becomes easier and more suitable with the increasing amount of different formats, and (2) vision systems can detect the products and thanks to advanced shape recognition algorithms the teaching of new format get easier.</p>

<p><img src="https://user-images.githubusercontent.com/1392333/153741989-74190718-1b31-46f5-88ac-5896886b50e6.png" alt="image" /></p>

<p>Therefore, let’s use these technologies to increase the flexibility of the new machines.</p>

<p>Below you could see a video done during PPMA Show 2015, in this video the ideas and technology I was presented in ISOLA conference were shown.</p>

<iframe id="video" src="https://www.youtube.com/embed/tR2WpbbterA" width="560" height="315" frameborder="0" allowfullscreen="">
</iframe>

<p>And the conclusions of the talk were:</p>

<ul>
  <li>Flexible machines will become more and more important.</li>
  <li>Robots and vision systems are technologies that allow to do flexible machines.</li>
  <li>Easy programming is important for machine builders.</li>
  <li>Machine builders require specific libraries, wizards and tools based on family of machines.</li>
</ul>]]></content><author><name>dgerod</name></author><category term="blog" /><category term="computer_vision" /><category term="conference" /><category term="flexible_machines" /><category term="robotics" /><category term="talk" /><summary type="html"><![CDATA[I was invited to do a talk about ‘Flexible Robotics Machines’ in the Industrial Day of the ISOLA 2104 conference.]]></summary></entry><entry><title type="html">Application to simulate a RU link</title><link href="https://dgerod.xyz-lab.org.es/blog/2014/07/01/app-simulate-RU-link.html" rel="alternate" type="text/html" title="Application to simulate a RU link" /><published>2014-07-01T00:00:00+00:00</published><updated>2014-07-01T00:00:00+00:00</updated><id>https://dgerod.xyz-lab.org.es/blog/2014/07/01/app-simulate-RU-link</id><content type="html" xml:base="https://dgerod.xyz-lab.org.es/blog/2014/07/01/app-simulate-RU-link.html"><![CDATA[<p>The objective of the task was to simulate a in a generic environment the kinematics behavior of one revolute joint and one universal joint. It includes the simulation of the motions of the mechanism.</p>

<p><img src="https://user-images.githubusercontent.com/1392333/153741851-00d7d8a7-43b7-4b46-86d6-e177cec43c8a.png" alt="image" /></p>

<p>Therefore, I developed a GNU/Linux application in C++ and <a href="http://www.qt.io">QT</a>. The application was divided in three components: simulations, graphics and model importer.</p>

<p><img src="https://user-images.githubusercontent.com/1392333/153741854-fd6472ee-d759-4886-a0e6-a7d16727d0ec.png" alt="image" /></p>

<p>The simulation of the RU kinematics was done using <a href="http://www.orocos.org/kdl">KDL</a> and a PTP movement using a polynomial 3 profile was created. For the visualization engine I used directly <a href="https://www.opengl.org">OpenGL</a>.</p>

<p><img src="https://user-images.githubusercontent.com/1392333/153741855-b16b4535-a24b-4436-9514-ab7224ea53f2.png" alt="image" /></p>

<p>Below you could a see video of the application that is upload in <a href="https://www.youtube.com/channel/UCRX6SIvzNbPf7FUBhXc7iAw">my channel</a>. And the code is stored in <a href="https://github.com/dgerod/simulate_RU_link">GitHub</a>.</p>

<iframe id="video" src="https://www.youtube.com/embed/gUnaLO5bWQI" width="560" height="315" frameborder="0" allowfullscreen="">
</iframe>

<p>This code was a quick prototype developed due to a special requested, I did it in 25 hours of effective work. As it was I developed in my free time, it is not completed, for example the importer is missing.</p>]]></content><author><name>dgerod</name></author><category term="blog" /><category term="C++" /><category term="kinematics" /><category term="OpenGL" /><category term="QT" /><category term="robotics" /><category term="simulation" /><summary type="html"><![CDATA[The objective of the task was to simulate a in a generic environment the kinematics behavior of one revolute joint and one universal joint. It includes the simulation of the motions of the mechanism.]]></summary></entry><entry><title type="html">Control a Kuka LWR in Morse using ROS with MoveIt</title><link href="https://dgerod.xyz-lab.org.es/blog/2014/06/10/control-klwr-using-morse-and-ros.html" rel="alternate" type="text/html" title="Control a Kuka LWR in Morse using ROS with MoveIt" /><published>2014-06-10T00:00:00+00:00</published><updated>2014-06-10T00:00:00+00:00</updated><id>https://dgerod.xyz-lab.org.es/blog/2014/06/10/control-klwr-using-morse-and-ros</id><content type="html" xml:base="https://dgerod.xyz-lab.org.es/blog/2014/06/10/control-klwr-using-morse-and-ros.html"><![CDATA[<p>Example to control a simulated robot in <a href="http://morse-simulator.github.io">MORSE</a> using <a href="http://moveit.ros.org">MoveIt</a> package from <a href="http://www.ros.org">ROS</a>.</p>

<iframe id="video" src="https://www.youtube.com/embed/NkPyGqfW1sA" width="560" height="315" frameborder="0" allowfullscreen="">
</iframe>

<p>This code was used on ROS <a href="http://wiki.ros.org/hydro">Hydro</a> and MORSE <a href="https://github.com/morse-simulator/morse/blob/1.2/RELEASE_NOTES">v1.2-11</a>. And it is available in <a href="https://github.com/dgerod/morse_and_ros-moveit_example">GitHub</a>.</p>]]></content><author><name>dgerod</name></author><category term="blog" /><category term="control" /><category term="LWR" /><category term="robot" /><category term="MORSE" /><category term="MoveIt" /><category term="ROS" /><category term="simulation" /><summary type="html"><![CDATA[Example to control a simulated robot in MORSE using MoveIt package from ROS.]]></summary></entry><entry><title type="html">My Test-Driven Development (TDD) experience</title><link href="https://dgerod.xyz-lab.org.es/blog/2014/04/24/talk-tdd-IRI.html" rel="alternate" type="text/html" title="My Test-Driven Development (TDD) experience" /><published>2014-04-24T00:00:00+00:00</published><updated>2014-04-24T00:00:00+00:00</updated><id>https://dgerod.xyz-lab.org.es/blog/2014/04/24/talk-tdd-IRI</id><content type="html" xml:base="https://dgerod.xyz-lab.org.es/blog/2014/04/24/talk-tdd-IRI.html"><![CDATA[<p>Yesterday I talked about <a href="http://en.wikipedia.org/wiki/Test-driven_development">Test-Driven Development</a> in the ‘LabRobòtica Talks’ at the <a href="http://www.iri.upc.edu">IRI</a>.</p>

<p><img src="https://user-images.githubusercontent.com/1392333/153741742-8624a5a5-a5a4-4c64-a760-1d19d3d45af5.png" alt="image" /></p>

<p>In this talk I focused on my experience with this technique, and how/when we are applying it in the company I work. You could find the slides I used <a href="https://drive.google.com/file/d/0ByovaZlEMcTJS1M1WjRkQm5zcXc/view?usp=sharing&amp;resourcekey=0-FEo5F7Uh4jOxy25RownYZQ">here</a>.</p>]]></content><author><name>dgerod</name></author><category term="blog" /><category term="software" /><category term="development_process" /><category term="programming" /><category term="agile" /><category term="talk" /><category term="TDD" /><summary type="html"><![CDATA[Yesterday I talked about Test-Driven Development in the ‘LabRobòtica Talks’ at the IRI.]]></summary></entry><entry><title type="html">My note taking application based on TiddlyWiki</title><link href="https://dgerod.xyz-lab.org.es/blog/2013/11/04/tw-as-wnb.html" rel="alternate" type="text/html" title="My note taking application based on TiddlyWiki" /><published>2013-11-04T00:00:00+00:00</published><updated>2013-11-04T00:00:00+00:00</updated><id>https://dgerod.xyz-lab.org.es/blog/2013/11/04/tw-as-wnb</id><content type="html" xml:base="https://dgerod.xyz-lab.org.es/blog/2013/11/04/tw-as-wnb.html"><![CDATA[<h2 id="why-an-elnb-is-necessary">Why an ELNB is necessary?</h2>

<p>A laboratory notebook is a document that researchers use for writing their hypotheses, experiments, initial analysis and interpretation of these experiments. And a personal electronic laboratory notebook (ELNB) for replacing a hand-written notebook. This software application is also named as note taking application or personal wiki.</p>

<p>The mandatorory features that this type of application has to have are:</p>

<ul>
  <li>Local application, not a web server.</li>
  <li>Windows and Linux versions, it should be used in both OS.</li>
  <li>A kind of blog with categories and tags.</li>
  <li>Dynamic tree views of the notes.</li>
  <li>Notes can be ordered by date.</li>
  <li>Caterogies and tags for notes, as in wiki.</li>
  <li>List all notes by creation date, category and tag.</li>
  <li>Inter links (notes links) and external links (files and web).</li>
  <li>Write a note using a WYSIWYG editor.</li>
  <li>Embed images, videos and so on.</li>
  <li>Export notes to RTF, XML and PDF.</li>
  <li>Spellcheck.</li>
</ul>

<p>And some extra feature that are interesting:</p>

<ul>
  <li>Drag and drop support for images, text and video, mathematics</li>
  <li>LaTex Eq. support.</li>
  <li>Power search engine: ext, name, date, categories and tags. Use a Desktop Search (Copernic, Google Desktop, etc) application for doing this task could be an option.</li>
</ul>

<h2 id="tw-wnb-as-my-note-taking-solution">TW-WNB as my note taking solution</h2>

<p>As I was not able to find any application that matches my expectations after using several of them, I decided to build mine over <a href="https://tiddlywiki.com">TiddlyWiki</a>. TiddlyWiki is a reusable non-linear personal web notebook . It’s a single HTML file which contains CSS, JavaScript, and the content. The content is divided into a series of sections, or Tiddlers.</p>

<p>TiddlyWiki has been used by different people as a software framework to build specialisations including task management tool, web clipping tools, a collaborative note taking tool, etc.</p>

<p>My version, named as TiddlyWiki - Work Notebook (TW-WNB) is a tuning version of TiddlyWiki for managing your daily work. It allows you to add to-do tasks by priorities(now/next/future), attach tiddlers to activities (or projects), write meeting minutes and more.</p>

<p><img src="https://user-images.githubusercontent.com/1392333/153742386-c5f102f6-ad23-49cf-ba5b-342192082fd8.png" alt="image" /></p>

<p>I have created this TiddlyWiki version because no other version satisfies my personal requirements. For doing this I modified some existing plug-ins but I have also developed my own plug-ins in Javascript, html templates, CSS styles, etc.</p>

<p>The source code of this note taking application is in <a href="https://github.com/dgerod/tw-wnb">here</a>.</p>]]></content><author><name>dgerod</name></author><category term="blog" /><category term="software" /><category term="tiddlywiki" /><category term="tool" /><category term="work_management" /><category term="javascript" /><category term="html" /><category term="note_talking" /><summary type="html"><![CDATA[Why an ELNB is necessary?]]></summary></entry><entry><title type="html">‘Cat and mouse’ game using ROS, Morse and CRAM</title><link href="https://dgerod.xyz-lab.org.es/blog/2013/01/26/cat-and-mouse-in-ros-morse-and-cram.html" rel="alternate" type="text/html" title="‘Cat and mouse’ game using ROS, Morse and CRAM" /><published>2013-01-26T00:00:00+00:00</published><updated>2013-01-26T00:00:00+00:00</updated><id>https://dgerod.xyz-lab.org.es/blog/2013/01/26/cat-and-mouse-in-ros-morse-and-cram</id><content type="html" xml:base="https://dgerod.xyz-lab.org.es/blog/2013/01/26/cat-and-mouse-in-ros-morse-and-cram.html"><![CDATA[<p>This is my first work using the <a href="http://ias.in.tum.de/research/cram">Cognitive Robot Abstract Machine</a> (CRAM). It is an implementation of the “cat and mouse” game using <a href="http://www.openrobots.org/wiki/morse/">MORSE</a>, <a href="http://www.ros.org">ROS</a> and <a href="http://www.ros.org/wiki/cram_core">CRAM</a> as controller of the cat.</p>

<p>The mouse is controlled by the user using the keyboard and the cat follows the mouse using a CRAM plan.</p>

<iframe id="video" src="https://www.youtube.com/embed/CscEglTKEIU" width="560" height="315" frameborder="0" allowfullscreen="">
</iframe>

<p>I used the example that comes with Morse but I have replaced the control script in Python for the cat by a CRAM plan. In addition, I added one pose sensor to the mouse robot and I used this sensor to know its position instead of the semantic cameras of the cat.</p>

<p>For create the CRAM plan I recycled some parts of the <a href="http://www.ros.org/wiki/cram_core/Tutorials">tutorials</a> that you can find in ROS wiki. I used the <a href="http://www.ros.org/wiki/cram_core/Tutorials/ControllingTurtlesimFromLisp">turtlesim controller</a> as base for my cat controller.</p>

<p>The source code is available in <a href="https://github.com/dgerod/morse_and_ros-cram_example">GitHub</a>.</p>]]></content><author><name>dgerod</name></author><category term="blog" /><category term="control" /><category term="ai_planning" /><category term="CRAM" /><category term="mobile_robot" /><category term="MORSE" /><category term="ROS" /><category term="simulation" /><category term="robotics" /><summary type="html"><![CDATA[This is my first work using the Cognitive Robot Abstract Machine (CRAM). It is an implementation of the “cat and mouse” game using MORSE, ROS and CRAM as controller of the cat.]]></summary></entry><entry><title type="html">Add a touchscreen to my Asus Eee PC</title><link href="https://dgerod.xyz-lab.org.es/blog/2013/01/20/touchscreen-asus-eee-pc.html" rel="alternate" type="text/html" title="Add a touchscreen to my Asus Eee PC" /><published>2013-01-20T00:00:00+00:00</published><updated>2013-01-20T00:00:00+00:00</updated><id>https://dgerod.xyz-lab.org.es/blog/2013/01/20/touchscreen-asus-eee-pc</id><content type="html" xml:base="https://dgerod.xyz-lab.org.es/blog/2013/01/20/touchscreen-asus-eee-pc.html"><![CDATA[<p>Finally I did it! After thinking some time on it, my Asus Eee PC 900A is touchable now…</p>

<iframe id="video" src="https://www.youtube.com/embed/jWWZtiM083c" width="560" height="315" frameborder="0" allowfullscreen="">
</iframe>

<p>And it is really cool!!!</p>

<p>You can see all the pictures I did during the work <a href="https://get.google.com/albumarchive/101542046887408327725/album/AF1QipOGtrBOVT0Wmqr9JjC4WJSI54hYBnWXBIcajGXU">here</a>.</p>]]></content><author><name>dgerod</name></author><category term="blog" /><category term="computer" /><category term="electronics" /><category term="hardware" /><category term="touch-screen" /><summary type="html"><![CDATA[Finally I did it! After thinking some time on it, my Asus Eee PC 900A is touchable now…]]></summary></entry><entry><title type="html">Playing with cardboard and controlling a delta-2 robot</title><link href="https://dgerod.xyz-lab.org.es/blog/2012/10/08/control-delta-2-of-cardboard.html" rel="alternate" type="text/html" title="Playing with cardboard and controlling a delta-2 robot" /><published>2012-10-08T00:00:00+00:00</published><updated>2012-10-08T00:00:00+00:00</updated><id>https://dgerod.xyz-lab.org.es/blog/2012/10/08/control-delta-2-of-cardboard</id><content type="html" xml:base="https://dgerod.xyz-lab.org.es/blog/2012/10/08/control-delta-2-of-cardboard.html"><![CDATA[<p>After developing the kinematics algorithms of a delta-2 robot, I want to test it in a real environment. For doing this we built the links using cardboard and connect them to real servo-drives.</p>

<iframe id="video" src="https://www.youtube.com/embed/cc2xYT8JAiE" width="560" height="315" frameborder="0" allowfullscreen="">
</iframe>

<p>There is a playlist with all videos in <a href="https://youtube.com/playlist?list=PL7EE27202FC7AC46D">my channel</a>, and the CAD files of robot are stored <a href="https://github.com/dgerod/my_CADs/tree/master/delta-2_robot">here</a>.</p>]]></content><author><name>dgerod</name></author><category term="blog" /><category term="control" /><category term="robotics" /><category term="delta-2_robot" /><category term="servo-drives" /><category term="prototype" /><category term="CAD" /><summary type="html"><![CDATA[After developing the kinematics algorithms of a delta-2 robot, I want to test it in a real environment. For doing this we built the links using cardboard and connect them to real servo-drives.]]></summary></entry><entry><title type="html">Kinematics of a delta-2 robot</title><link href="https://dgerod.xyz-lab.org.es/blog/2012/06/02/kinematics-delta-2-robot.html" rel="alternate" type="text/html" title="Kinematics of a delta-2 robot" /><published>2012-06-02T00:00:00+00:00</published><updated>2012-06-02T00:00:00+00:00</updated><id>https://dgerod.xyz-lab.org.es/blog/2012/06/02/kinematics-delta-2-robot</id><content type="html" xml:base="https://dgerod.xyz-lab.org.es/blog/2012/06/02/kinematics-delta-2-robot.html"><![CDATA[<p>A <a href="https://www.youtube.com/watch?v=57WoQSqxPW0">delta-2 robot</a> is a parallel robot composed by two legs, each one has three rational joints but only the one attached to the fixed-frame (or top-plate) is not a passive joint. Therefore, to move the end-effector position (TCP-0) of the robot the two active joints must be controlled.</p>

<p>The delta-2 robot can be seen as a simplification of the <a href="http://en.wikipedia.org/wiki/Delta_robot">delta-3 robot</a>, and it is usually used in the packaging industry for pick products on a conveyor belt. You can see some models <a href="https://www.google.com/search?q=delta+3+robot">here</a>.</p>

<p><img src="https://user-images.githubusercontent.com/1392333/150633759-a5bd9f3d-a10a-4ef1-a8fb-4810e656feda.png" alt="image" /></p>

<p>Due to its mechanical configuration this robot can only move its end-effector on plane XZ, see figure belowt. And its TCP-0 is defined by (x,0,z).</p>

<p><img src="https://user-images.githubusercontent.com/1392333/150633766-735d3a7d-bda6-45f3-929f-0503603fc0a8.png" alt="image" /></p>

<p>The kinematics of the delta-2 robot can be solved using a geometric method. For doing this, we model the robot (see figure abowe) using four kinematics parameters: rf,lf, le, re.
The parameter rf is the distance between the center of the fixed-frame to the position of the active joint, re is the distance between the center of the end-effector (E) and the position of the passive joint (F), and lf and le are the lengths of the links of a leg. And the link 1 and link 2 of a robot leg are connected in point G.</p>

<p>The <a href="https://github.com/dgerod/RTSX">algorithms</a> for solving the Kinematics Problem of the delta-2 robot have been developed using <a href="http://www.scilab.org">Scilab</a>.</p>

<h1 id="inverse-kinematics">Inverse kinematics</h1>

<p>For knowing the joins (j1,j2) from the end-effector position (TCP-0) we must solve the inverse kinematics problem.</p>

<p><img src="https://user-images.githubusercontent.com/1392333/150633772-bd53668d-88f1-4c61-aab4-0d14ab511f4c.png" alt="image" /></p>

<p>(le) as radius. And the second circle (red) has point F as center and the length link 1 (lf) as radius.
Once you know position of G, the value of the joint is calculated as the angle defined by the axis X and the line that connect F with G, that’s the real position of the link 1.</p>

<p>This method is applied independently for each leg of the robot.</p>

<h1 id="direct-kinematics">Direct kinematics</h1>

<p>And we can calculated the end-effector position (TCP-0) from the joint values (j1,j2) solving the kinematics problem.</p>

<p><img src="https://user-images.githubusercontent.com/1392333/150633775-3f549b62-2d19-4ae0-9a07-41bbd7bfb86c.png" alt="image" /></p>

<p>The end-effector position (E) is obtained from the intersection of the two circles (cyan) defined by the link 2 of each robot leg. The center of each circles is defined by G and the radius by the length of the link (le). And the point G is 
calculated by trigonometry using the value of the joint, the length of the link 1 (lf) and the position of F.</p>]]></content><author><name>dgerod</name></author><category term="blog" /><category term="robotics" /><category term="delta-2_robot" /><category term="robot" /><category term="kinematics" /><category term="algorithms" /><category term="note" /><summary type="html"><![CDATA[A delta-2 robot is a parallel robot composed by two legs, each one has three rational joints but only the one attached to the fixed-frame (or top-plate) is not a passive joint. Therefore, to move the end-effector position (TCP-0) of the robot the two active joints must be controlled.]]></summary></entry><entry><title type="html">Kinematics of a delta-3 robot</title><link href="https://dgerod.xyz-lab.org.es/blog/2011/09/16/kinematics-delta-3-robot.html" rel="alternate" type="text/html" title="Kinematics of a delta-3 robot" /><published>2011-09-16T00:00:00+00:00</published><updated>2011-09-16T00:00:00+00:00</updated><id>https://dgerod.xyz-lab.org.es/blog/2011/09/16/kinematics-delta-3-robot</id><content type="html" xml:base="https://dgerod.xyz-lab.org.es/blog/2011/09/16/kinematics-delta-3-robot.html"><![CDATA[<p>Parallel manipulators are robotic devices that differ from the more traditional serial robotic manipulators by virtue of their kinematics structure. Parallel manipulators are composed of multiple closed kinematics loops.</p>

<p>The delta-3 robot is a three degree of freedom parallel manipulator. It was designed by Clavel (1988) et al. at the <a href="http://www.ethz.ch">Swiss Federal Institute of Technology</a>. This manipulator robot has only translational degrees of freedom.</p>

<p>It is interesting to have a model of the robot for doing this study .</p>

<h2 id="analysis-of-the-robot">Analysis of the Robot</h2>

<p>The delta-3 robot (DR-3) is composed by two parallel platforms named as End-Effector and Fixed-Framed; and three symmetric legs (see figure below).</p>

<p>The Fixed-Frame (FF) is usually attached to a fixed surface and the tool of the robot is mounted in the TCP-0 which is placed on the center of the End-Effector. The End-Effector (EE) could also be named as travel plate because it is the mobile base of the robot.</p>

<p><img src="https://user-images.githubusercontent.com/1392333/153739553-6e34f236-a12c-4f32-977a-aca76f8d974b.png" alt="image" /></p>

<p>Scheme of delta-3 robot</p>

<p>Each leg is composed by two links and three joints (RUU); the actuated joint is rotational (R) and the two passive joints are universal (U). And their position in the robot is named as Fi, Gi and Ei (see previous figure), respectively; where the index i is the number of the leg (1, 2 or 3).</p>

<p><img src="https://user-images.githubusercontent.com/1392333/153739558-806230b1-b105-467b-b3ce-acad61be107f.png" alt="image" /> <img src="https://user-images.githubusercontent.com/1392333/153739561-b15d216b-20c3-4650-aead-44ad7bd1b54d.png" alt="image" /></p>

<p>Spheres defined by the passive joints (placed in G and E) and Link 2, and circle defined by the actuated joint placed in F and Link1</p>

<p>F1, F2 and F3 are the positions in the Fixed-Frame of the actuated joints, J1, J2 and J3 respectively.</p>

<h2 id="kinematics">Kinematics</h2>

<p>The configuration parameters of a robot are the parameters which define a specific model of a robot type. For a DELTA-3 robot the geometry of its mechanical structure is directly used as configuration parameters:</p>

<ul>
  <li>Side length of end-effector (EE)</li>
  <li>Length of link 2, from knee(E) to ankle(C)</li>
  <li>Length of link 1, from hip(D) to knee(E)</li>
  <li>Side length of fixed-frame (FF)</li>
</ul>

<p>The <a href="https://github.com/dgerod/rtsx">algorithms</a> for solving the Kinematics Problem of the delta-3 robot was developed using <a href="http://www.scilab.org">Scilab</a>.</p>]]></content><author><name>dgerod</name></author><category term="blog" /><category term="robotics" /><category term="delta-3_robot" /><category term="robot" /><category term="kinematics" /><category term="algorithms" /><category term="note" /><summary type="html"><![CDATA[Parallel manipulators are robotic devices that differ from the more traditional serial robotic manipulators by virtue of their kinematics structure. Parallel manipulators are composed of multiple closed kinematics loops.]]></summary></entry><entry><title type="html">Study kinematics of a delta-3 robot using a cardboard model</title><link href="https://dgerod.xyz-lab.org.es/blog/2010/09/25/studying-delta-3-robot.html" rel="alternate" type="text/html" title="Study kinematics of a delta-3 robot using a cardboard model" /><published>2010-09-25T00:00:00+00:00</published><updated>2010-09-25T00:00:00+00:00</updated><id>https://dgerod.xyz-lab.org.es/blog/2010/09/25/studying-delta-3-robot</id><content type="html" xml:base="https://dgerod.xyz-lab.org.es/blog/2010/09/25/studying-delta-3-robot.html"><![CDATA[<p>Sometimes it is useful to create a simple prototype when you are studying a complex robot as parallel ones are. A prototype can help you to understand how its structure reacts when one or more actuated joints are modified.</p>

<p><img src="https://user-images.githubusercontent.com/1392333/153721532-bb5758e5-9956-4fb0-b520-d20347cebf2d.png" alt="image" /></p>

<p>Before building the model, it was designed using the Community Edition of QCAD. The model could be found <a href="https://github.com/dgerod/my_CADs/tree/master/delta-3_robot">here</a> and the process to build it <a href="https://get.google.com/albumarchive/101542046887408327725/album/AF1QipOKWDVPUi2vIxuG6L8gMnN4iiYjq6PFfqUMC1wS">here</a>.</p>]]></content><author><name>dgerod</name></author><category term="blog" /><category term="robotics" /><category term="delta-3_robot" /><category term="prototype" /><category term="CAD" /><summary type="html"><![CDATA[Sometimes it is useful to create a simple prototype when you are studying a complex robot as parallel ones are. A prototype can help you to understand how its structure reacts when one or more actuated joints are modified.]]></summary></entry><entry><title type="html">Hellow world !!!</title><link href="https://dgerod.xyz-lab.org.es/blog/2010/06/19/hello-world.html" rel="alternate" type="text/html" title="Hellow world !!!" /><published>2010-06-19T00:00:00+00:00</published><updated>2010-06-19T00:00:00+00:00</updated><id>https://dgerod.xyz-lab.org.es/blog/2010/06/19/hello-world</id><content type="html" xml:base="https://dgerod.xyz-lab.org.es/blog/2010/06/19/hello-world.html"><![CDATA[<p>printf(“Hello world !!!\n”);</p>]]></content><author><name>dgerod</name></author><category term="blog" /><category term="other" /><summary type="html"><![CDATA[printf(“Hello world !!!\n”);]]></summary></entry></feed>