Anna Chiara, Arnaud, Benoit,<br><br>Sorry for the late response, but research took over for a bit.<br><br>Thanks for catching the Matrix.transpose[d]() issue and proposing a fix; I still don&#39;t understand how I overlooked it. I ended up going with beam.worldOrientation.transpose<span class="x">d</span>() for conciseness and have updated the repo addressing this:<br>

<br><a href="https://github.com/fgb/passive_compliant_joint/commit/05f81a3036a632717e344a7ea0a684f68221f79e">https://github.com/fgb/passive_compliant_joint/commit/05f81a3036a632717e344a7ea0a684f68221f79e</a><br><br>Thanks,<br>

<br clear="all">-- Fernando<br>
<br><br><div class="gmail_quote">On Wed, Jun 15, 2011 at 09:40, Benoit Bolsee <span dir="ltr">&lt;<a href="mailto:benoit.bolsee@online.be">benoit.bolsee@online.be</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">

<u></u>





<div>
<div><span><font face="Arial" size="2" color="#0000ff">The 
method that returns a new matrix is Matrix.transposed()</font></span></div>
<div><span><font face="Arial" size="2" color="#0000ff">The 
API didn&#39;t change with regards to that.</font></span></div><div class="im">
<div><span></span> </div>
<div></div>
<div><font face="Tahoma" size="2">-----Original Message-----<br><b>From:</b> 
<a href="mailto:robotics-bounces@blender.org" target="_blank">robotics-bounces@blender.org</a> [mailto:<a href="mailto:robotics-bounces@blender.org" target="_blank">robotics-bounces@blender.org</a>] <b>On Behalf 
Of </b>Anna Chiara Bellini<br><b>Sent:</b> mercredi 15 juin 2011 
13:21<br><b>To:</b> Blender and Robotics<br><b>Subject:</b> Re: [Robotics] 
Force/torque/collision sensor<br><br></font></div>
</div><div><div></div><div class="h5"><blockquote style="border-left:#0000ff 2px solid;padding-left:5px;margin-left:5px;margin-right:0px">Hi 
  Fernando,<br><br>my issue was this: the 
  mathutils.Matrix<b>.transpose()</b>  (beam.worldorientation.transpose(), 
  line 11 ) doesn&#39;t return a new instance of Matrix, but rather it trasnposes 
  the matrix itself, and returns None. <br>As such, on line 11 the beam 
  orientation is transposed, the operation returns None and the multiplication 
  fails with and exception, and the rest of the script is ignored<br><br><span style="font-family:courier new,monospace">rot = 
  (beam.worldOrientation.transpose() * 
  base.worldOrientation).to_euler()</span><br><span style="font-family:courier new,monospace">                                    
  this ^ fails</span><br><br>On the Blender console I see:<br><span style="font-family:courier new,monospace">Python script error - object 
  &#39;Beam&#39;, controller &#39;Python Script#CONTR#1&#39;:</span><br style="font-family:courier new,monospace"><span style="font-family:courier new,monospace">Traceback (most recent call 
  last):</span><br style="font-family:courier new,monospace"><span style="font-family:courier new,monospace">  File &quot;joint_controller.py&quot;, 
  line 11, in &lt;module&gt;</span><br style="font-family:courier new,monospace"><span style="font-family:courier new,monospace">TypeError: Matrix multiplication: 
  not supported between &#39;NoneType&#39; and &#39;mathutils.Matrix&#39; 
  types</span><br><br>So, here is what I did:<br><br><span style="font-family:courier new,monospace">beam_rot = 
  beam.worldOrientation.copy() # so that subsequent transpose() doesn&#39;t change 
  the beam&#39;s real orientation</span><br style="font-family:courier new,monospace"><span style="font-family:courier new,monospace">beam_rot.transpose()</span><br style="font-family:courier new,monospace"><span style="font-family:courier new,monospace">rot = (beam_rot * 
  base.worldOrientation).to_euler()</span><br><span style="font-family:courier new,monospace"></span><br>I have given it for 
  granted this was a bug introduced by Blender&#39;s huge api change, but I&#39;m not 
  sure, I wanted to try it on an older Blender, but... hem, I don&#39;t know how to 
  work with pre-2.5 :-)<br><br>Thank you again<br><br>Anna 
Chiara<br><br><br><br>
  <div class="gmail_quote">On 10 June 2011 19:00, Fernando Garcia Bermudez <span dir="ltr">&lt;<a href="mailto:fgb@eecs.berkeley.edu" target="_blank">fgb@eecs.berkeley.edu</a>&gt;</span> 
  wrote:<br>
  <blockquote style="border-left:#ccc 1px solid;margin:0px 0px 0px 0.8ex;padding-left:1ex" class="gmail_quote">Anna Chiara,<br><br>Can you provide more info on the 
    issue/change? I&#39;m using 2.57 and not seeing anything wrong, but I might be 
    overlooking it. If you can send the changed script I can test it and update 
    it on github for future users. Thanks,<br><font color="#888888"><br clear="all">-- Fernando</font>
    <div>
    <div></div>
    <div><br><br><br>
    <div class="gmail_quote">On Fri, Jun 10, 2011 at 02:56, Anna Chiara Bellini 
    <span dir="ltr">&lt;<a href="mailto:annachiara.bellini@gmail.com" target="_blank">annachiara.bellini@gmail.com</a>&gt;</span> wrote:<br>
    <blockquote style="border-left:#ccc 1px solid;margin:0px 0px 0px 0.8ex;padding-left:1ex" class="gmail_quote">Ciao Fernando,<br>I&#39;ve been playing around with this for 
      a while, and I think I got the hang of it, thank you :-)<br>I just had to 
      change the script a little because the mathutils.Matrix api has changed in 
      Blender 2.56 (namely: I had to copy() and then .transpose() the beam 
      rotation Matrix), but it works very well. <br><br>I&#39;m working on the 
      linear springs now, and I&#39;m planning to transform this in a Morse-style 
      sensor, even though a few peculiarities will apply. <br><br>Thank you 
      again for your kind help<br><font color="#888888"><br>Anna Chiara 
      Bellini</font>
      <div>
      <div></div>
      <div><br><br>
      <div class="gmail_quote">On 7 June 2011 17:40, Fernando Garcia Bermudez 
      <span dir="ltr">&lt;<a href="mailto:fgb@eecs.berkeley.edu" target="_blank">fgb@eecs.berkeley.edu</a>&gt;</span> wrote:<br>
      <blockquote style="border-left:#ccc 1px solid;margin:0px 0px 0px 0.8ex;padding-left:1ex" class="gmail_quote">Since the e-mail below was being held due to a large 
        attachment, I<br>decided to re-post without it. You can grab the 
        attachment from:<br><br><a href="http://github.com/fgb/passive_compliant_joint" target="_blank">http://github.com/fgb/passive_compliant_joint</a><br><br>Thanks,<br><font color="#888888"><br>-- Fernando<br></font>
        <div><br>On Mon, Jun 6, 2011 at 12:05, Fernando Garcia 
        Bermudez<br>&lt;<a href="mailto:fgb@eecs.berkeley.edu" target="_blank">fgb@eecs.berkeley.edu</a>&gt; wrote:<br>&gt; 
        Anna,<br>&gt;<br>&gt; I&#39;ve constructed passive compliant joints in the 
        past using a mixture<br>&gt; of rigid body joints and a python script 
        controller, since there are<br>&gt; no generic spring constraints in 
        Blender that I know of.<br>&gt;<br>&gt; In a nutshell, I create a 
        generic 6 DoF rigid body joint between two<br>&gt; bodies, disabling 
        collisions between them. I then proceed to allow<br>&gt; only the 
        rotations that the spring joint I&#39;m envisioning has. I setup<br>&gt; 
        rigid body physics for both bodies and then add some parameters to 
        the<br>&gt; game property editor (spring constant, damping constant, and 
        resting<br>&gt; position for the joint). Finally, I add an always sensor 
        connected to<br>&gt; a python script which effectively controls the 
        passive compliant<br>&gt; joint. The script implements torque feedback 
        based on the game<br>&gt; property parameters. You could easily 
        implement force feedback for a<br>&gt; linear spring joint in a similar 
        way. For clarity, I&#39;m including a<br>&gt; demonstration blend 
        file.<br>&gt;<br>&gt; As you can see, the forces/torques are available 
        to you as part of the<br>&gt; simulation, but as Gilberto notes, they 
        might not be very precise due<br>&gt; to Bullet&#39;s 
        limitations.<br>&gt;<br>&gt; I hope this helps you solve your issue. Let 
        me know if you have any questions,<br>&gt;<br>&gt; -- 
        Fernando<br>&gt;<br>&gt;<br>&gt; On Mon, Jun 6, 2011 at 11:09, Anna 
        Chiara Bellini<br>&gt; &lt;<a href="mailto:annachiara.bellini@gmail.com" target="_blank">annachiara.bellini@gmail.com</a>&gt; wrote:<br></div>
        <div>
        <div></div>
        <div>&gt;&gt; Hello Gilberto,<br>&gt;&gt;<br>&gt;&gt; I&#39;ll try to 
        explain it better... I need to detect forces for two 
        reasons:<br>&gt;&gt;<br>&gt;&gt; 1 - our robot is an UAV, and as it 
        flies, it will get in touch with objects<br>&gt;&gt; and environment. On 
        the robot I need to have a few force/torque sensors,<br>&gt;&gt; that 
        will tell me the force/torque applied in that spot, and then we 
        combine<br>&gt;&gt; the different values to get a resulting force that 
        will get back to the user<br>&gt;&gt; using a force-feedback 
        device.<br>&gt;&gt;<br>&gt;&gt; 2 - the robot features a 
        grasp/manipulate tool, and I need to read the force<br>&gt;&gt; applied 
        on it.<br>&gt;&gt;<br>&gt;&gt; Now, my first idea is this: if I model 
        the sensor as a small pivoting<br>&gt;&gt; damper, then I could read the 
        position and pose of the damper to calculate<br>&gt;&gt; force and 
        torque... but this is just a very basic idea, I don&#39;t know if 
        it&#39;s<br>&gt;&gt; correct or if there are better ways. (Ideally, this 
        should end up being a<br>&gt;&gt; MORSE sensor, but that would be a 
        second step, hence why I posted the<br>&gt;&gt; question here instead on 
        the morse mailing list)<br>&gt;&gt;<br>&gt;&gt; I have also found this 
        on the Bullet forum:<br>&gt;&gt; <a href="http://www.bulletphysics.org/Bullet/phpBB3/viewtopic.php?p=&amp;f=9&amp;t=3637" target="_blank">http://www.bulletphysics.org/Bullet/phpBB3/viewtopic.php?p=&amp;f=9&amp;t=3637</a>, 
        but<br>&gt;&gt; I&#39;m not understanding it completely, for instance I do 
        not know what a<br>&gt;&gt; &quot;proxy&quot; object is and how to set it 
        up.<br>&gt;&gt;<br>&gt;&gt; Hope this is clear enough 
        :-)<br>&gt;&gt;<br>&gt;&gt; You are saying that the Bullet engine is not 
        extremely precise... can you<br>&gt;&gt; tell me what are the 
        limitations, or point me to a place where I can get<br>&gt;&gt; more 
        information?<br>&gt;&gt;<br>&gt;&gt; Thank you 
        again<br>&gt;&gt;<br>&gt;&gt; Anna Chiara 
        Bellini<br>&gt;&gt;<br>&gt;&gt;<br>&gt;&gt; On 6 June 2011 18:09, 
        Gilberto Echeverria &lt;<a href="mailto:gilberto.echeverria@laas.fr" target="_blank">gilberto.echeverria@laas.fr</a>&gt;<br>&gt;&gt; 
        wrote:<br>&gt;&gt;&gt;<br>&gt;&gt;&gt; Hello Anna 
        Chiara,<br>&gt;&gt;&gt;<br>&gt;&gt;&gt; For the moment, MORSE does not 
        include this sort of force sensors in<br>&gt;&gt;&gt; joints. So far, 
        the main developers of MORSE have not approached this 
        sort<br>&gt;&gt;&gt; of simulation, so it remains an open area for 
        development. However, maybe<br>&gt;&gt;&gt; other people in the Blender 
        community may have worked on similar 
        problems.<br>&gt;&gt;&gt;<br>&gt;&gt;&gt; It should be possible to 
        measure forces in Blender, but the physics engine<br>&gt;&gt;&gt; used 
        by default (Bullet) is not extremely precise. It will depend on 
        what<br>&gt;&gt;&gt; exactly you want to model.<br>&gt;&gt;&gt; If you 
        can provide more details, we can give you a better insight on 
        how<br>&gt;&gt;&gt; to deal with this kind of 
        sensors.<br>&gt;&gt;&gt;<br>&gt;&gt;&gt; Best regards,<br>&gt;&gt;&gt; 
        Gilberto Echeverria<br>&gt;&gt;&gt;<br>&gt;&gt;&gt; On 06/06/2011 04:16 
        PM, Anna Chiara Bellini wrote:<br>&gt;&gt;&gt;<br>&gt;&gt;&gt; Dear 
        all,<br>&gt;&gt;&gt;<br>&gt;&gt;&gt; I am working on a robot simulation 
        project ( <a href="http://www.airobots.eu/" target="_blank">http://www.airobots.eu/</a> )<br>&gt;&gt;&gt; with Blender 
        and I am trying to do something which I&#39;m sure someone else 
        has<br>&gt;&gt;&gt; already done, so I&#39;m asking for directions: I need 
        to model passive<br>&gt;&gt;&gt; compliant joints and detect the forces 
        acting on them. I guess that the way<br>&gt;&gt;&gt; is through 
        Blender&#39;s rigid body joint constraint , possibly the<br>&gt;&gt;&gt; 
        6DofSpringConstraint, but I&#39;m not really sure about it and I really 
        don&#39;t<br>&gt;&gt;&gt; know which would be the best 
        solution.<br>&gt;&gt;&gt;<br>&gt;&gt;&gt; In our project, we are using 
        MORSE for sensors/actuators/middleware, so if<br>&gt;&gt;&gt; anyone had 
        a MORSE-specific solution or suggestion, that would be 
        great.<br>&gt;&gt;&gt;<br>&gt;&gt;&gt; Any 
        ideas?<br>&gt;&gt;&gt;<br>&gt;&gt;&gt; Thank you in 
        advance<br>&gt;&gt;&gt;<br>&gt;&gt;&gt; Anna Chiara 
        Bellini<br>&gt;&gt;&gt;<br>&gt;&gt;&gt; 
        _______________________________________________<br>&gt;&gt;&gt; Robotics 
        mailing list<br>&gt;&gt;&gt; <a href="mailto:Robotics@blender.org" target="_blank">Robotics@blender.org</a><br>&gt;&gt;&gt; <a href="http://lists.blender.org/mailman/listinfo/robotics" target="_blank">http://lists.blender.org/mailman/listinfo/robotics</a><br>

&gt;&gt;&gt;<br>&gt;&gt;&gt;<br>&gt;&gt;&gt; 
        --<br>&gt;&gt;&gt; Gilberto Echeverria<br>&gt;&gt;&gt; Research 
        Engineer<br>&gt;&gt;&gt; Robotics and Interactions Group 
        (RIS)<br>&gt;&gt;&gt; LAAS/CNRS, Toulouse<br>&gt;&gt;&gt; <a href="tel:%2B33%20%280%295%2061%2033%2078%2095" value="+33561337895" target="_blank">+33 (0)5 61 33 78 
        95</a><br>&gt;&gt;&gt;<br>&gt;&gt;&gt; 
        _______________________________________________<br>&gt;&gt;&gt; Robotics 
        mailing list<br>&gt;&gt;&gt; <a href="mailto:Robotics@blender.org" target="_blank">Robotics@blender.org</a><br>&gt;&gt;&gt; <a href="http://lists.blender.org/mailman/listinfo/robotics" target="_blank">http://lists.blender.org/mailman/listinfo/robotics</a><br>

&gt;&gt;&gt;<br>&gt;&gt;<br>&gt;&gt;<br>&gt;&gt; 
        _______________________________________________<br>&gt;&gt; Robotics 
        mailing list<br>&gt;&gt; <a href="mailto:Robotics@blender.org" target="_blank">Robotics@blender.org</a><br>&gt;&gt; <a href="http://lists.blender.org/mailman/listinfo/robotics" target="_blank">http://lists.blender.org/mailman/listinfo/robotics</a><br>

&gt;<br>_______________________________________________<br>Robotics 
        mailing list<br><a href="mailto:Robotics@blender.org" target="_blank">Robotics@blender.org</a><br><a href="http://lists.blender.org/mailman/listinfo/robotics" target="_blank">http://lists.blender.org/mailman/listinfo/robotics</a><br>

</div></div></blockquote></div><br></div></div><br>_______________________________________________<br>Robotics 
      mailing list<br><a href="mailto:Robotics@blender.org" target="_blank">Robotics@blender.org</a><br><a href="http://lists.blender.org/mailman/listinfo/robotics" target="_blank">http://lists.blender.org/mailman/listinfo/robotics</a><br>

<br></blockquote></div><br></div></div><br>_______________________________________________<br>Robotics 
    mailing list<br><a href="mailto:Robotics@blender.org" target="_blank">Robotics@blender.org</a><br><a href="http://lists.blender.org/mailman/listinfo/robotics" target="_blank">http://lists.blender.org/mailman/listinfo/robotics</a><br>

<br></blockquote></div><br></blockquote></div></div></div>
<br>_______________________________________________<br>
Robotics mailing list<br>
<a href="mailto:Robotics@blender.org">Robotics@blender.org</a><br>
<a href="http://lists.blender.org/mailman/listinfo/robotics" target="_blank">http://lists.blender.org/mailman/listinfo/robotics</a><br>
<br></blockquote></div><br>