<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=us-ascii">
<TITLE>Message</TITLE>

<META name=GENERATOR content="MSHTML 8.00.6001.19046"></HEAD>
<BODY>
<DIV><SPAN class=327043816-15062011><FONT color=#0000ff size=2 face=Arial>The 
method that returns a new matrix is Matrix.transposed()</FONT></SPAN></DIV>
<DIV><SPAN class=327043816-15062011><FONT color=#0000ff size=2 face=Arial>The 
API didn't change with regards to that.</FONT></SPAN></DIV>
<DIV><SPAN class=327043816-15062011></SPAN>&nbsp;</DIV>
<DIV></DIV>
<DIV><FONT size=2 face=Tahoma>-----Original Message-----<BR><B>From:</B> 
robotics-bounces@blender.org [mailto:robotics-bounces@blender.org] <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></DIV></FONT>
<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>&nbsp; (beam.worldorientation.transpose(), 
  line 11 ) doesn'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">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
  this ^ fails</SPAN><BR><BR>On the Blender console I see:<BR><SPAN 
  style="FONT-FAMILY: courier new,monospace">Python script error - object 
  'Beam', controller 'Python Script#CONTR#1':</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">&nbsp; File "joint_controller.py", 
  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 'NoneType' and 'mathutils.Matrix' 
  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't change 
  the beam'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's huge api change, but I'm not 
  sure, I wanted to try it on an older Blender, but... hem, I don'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">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'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 class=h5><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'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'm working on the 
      linear springs now, and I'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'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'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'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'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'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't know if 
        it'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'm not understanding it completely, for instance I do 
        not know what a<BR>&gt;&gt; "proxy" 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'm sure someone else 
        has<BR>&gt;&gt;&gt; already done, so I'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's rigid body joint constraint , possibly the<BR>&gt;&gt;&gt; 
        6DofSpringConstraint, but I'm not really sure about it and I really 
        don'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" target=_blank 
        value="+33561337895">+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">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></BODY></HTML>