<!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> </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> (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">
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"> File "joint_controller.py",
line 11, in <module></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><<A
href="mailto:fgb@eecs.berkeley.edu">fgb@eecs.berkeley.edu</A>></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><<A href="mailto:annachiara.bellini@gmail.com"
target=_blank>annachiara.bellini@gmail.com</A>></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><<A href="mailto:fgb@eecs.berkeley.edu"
target=_blank>fgb@eecs.berkeley.edu</A>></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><<A href="mailto:fgb@eecs.berkeley.edu"
target=_blank>fgb@eecs.berkeley.edu</A>> wrote:<BR>>
Anna,<BR>><BR>> I've constructed passive compliant joints in the
past using a mixture<BR>> of rigid body joints and a python script
controller, since there are<BR>> no generic spring constraints in
Blender that I know of.<BR>><BR>> In a nutshell, I create a
generic 6 DoF rigid body joint between two<BR>> bodies, disabling
collisions between them. I then proceed to allow<BR>> only the
rotations that the spring joint I'm envisioning has. I setup<BR>>
rigid body physics for both bodies and then add some parameters to
the<BR>> game property editor (spring constant, damping constant, and
resting<BR>> position for the joint). Finally, I add an always sensor
connected to<BR>> a python script which effectively controls the
passive compliant<BR>> joint. The script implements torque feedback
based on the game<BR>> property parameters. You could easily
implement force feedback for a<BR>> linear spring joint in a similar
way. For clarity, I'm including a<BR>> demonstration blend
file.<BR>><BR>> As you can see, the forces/torques are available
to you as part of the<BR>> simulation, but as Gilberto notes, they
might not be very precise due<BR>> to Bullet's
limitations.<BR>><BR>> I hope this helps you solve your issue. Let
me know if you have any questions,<BR>><BR>> --
Fernando<BR>><BR>><BR>> On Mon, Jun 6, 2011 at 11:09, Anna
Chiara Bellini<BR>> <<A href="mailto:annachiara.bellini@gmail.com"
target=_blank>annachiara.bellini@gmail.com</A>> wrote:<BR></DIV>
<DIV>
<DIV></DIV>
<DIV>>> Hello Gilberto,<BR>>><BR>>> I'll try to
explain it better... I need to detect forces for two
reasons:<BR>>><BR>>> 1 - our robot is an UAV, and as it
flies, it will get in touch with objects<BR>>> and environment. On
the robot I need to have a few force/torque sensors,<BR>>> that
will tell me the force/torque applied in that spot, and then we
combine<BR>>> the different values to get a resulting force that
will get back to the user<BR>>> using a force-feedback
device.<BR>>><BR>>> 2 - the robot features a
grasp/manipulate tool, and I need to read the force<BR>>> applied
on it.<BR>>><BR>>> Now, my first idea is this: if I model
the sensor as a small pivoting<BR>>> damper, then I could read the
position and pose of the damper to calculate<BR>>> force and
torque... but this is just a very basic idea, I don't know if
it's<BR>>> correct or if there are better ways. (Ideally, this
should end up being a<BR>>> MORSE sensor, but that would be a
second step, hence why I posted the<BR>>> question here instead on
the morse mailing list)<BR>>><BR>>> I have also found this
on the Bullet forum:<BR>>> <A
href="http://www.bulletphysics.org/Bullet/phpBB3/viewtopic.php?p=&f=9&t=3637"
target=_blank>http://www.bulletphysics.org/Bullet/phpBB3/viewtopic.php?p=&f=9&t=3637</A>,
but<BR>>> I'm not understanding it completely, for instance I do
not know what a<BR>>> "proxy" object is and how to set it
up.<BR>>><BR>>> Hope this is clear enough
:-)<BR>>><BR>>> You are saying that the Bullet engine is not
extremely precise... can you<BR>>> tell me what are the
limitations, or point me to a place where I can get<BR>>> more
information?<BR>>><BR>>> Thank you
again<BR>>><BR>>> Anna Chiara
Bellini<BR>>><BR>>><BR>>> On 6 June 2011 18:09,
Gilberto Echeverria <<A href="mailto:gilberto.echeverria@laas.fr"
target=_blank>gilberto.echeverria@laas.fr</A>><BR>>>
wrote:<BR>>>><BR>>>> Hello Anna
Chiara,<BR>>>><BR>>>> For the moment, MORSE does not
include this sort of force sensors in<BR>>>> joints. So far,
the main developers of MORSE have not approached this
sort<BR>>>> of simulation, so it remains an open area for
development. However, maybe<BR>>>> other people in the Blender
community may have worked on similar
problems.<BR>>>><BR>>>> It should be possible to
measure forces in Blender, but the physics engine<BR>>>> used
by default (Bullet) is not extremely precise. It will depend on
what<BR>>>> exactly you want to model.<BR>>>> If you
can provide more details, we can give you a better insight on
how<BR>>>> to deal with this kind of
sensors.<BR>>>><BR>>>> Best regards,<BR>>>>
Gilberto Echeverria<BR>>>><BR>>>> On 06/06/2011 04:16
PM, Anna Chiara Bellini wrote:<BR>>>><BR>>>> Dear
all,<BR>>>><BR>>>> I am working on a robot simulation
project ( <A href="http://www.airobots.eu/"
target=_blank>http://www.airobots.eu/</A> )<BR>>>> with Blender
and I am trying to do something which I'm sure someone else
has<BR>>>> already done, so I'm asking for directions: I need
to model passive<BR>>>> compliant joints and detect the forces
acting on them. I guess that the way<BR>>>> is through
Blender's rigid body joint constraint , possibly the<BR>>>>
6DofSpringConstraint, but I'm not really sure about it and I really
don't<BR>>>> know which would be the best
solution.<BR>>>><BR>>>> In our project, we are using
MORSE for sensors/actuators/middleware, so if<BR>>>> anyone had
a MORSE-specific solution or suggestion, that would be
great.<BR>>>><BR>>>> Any
ideas?<BR>>>><BR>>>> Thank you in
advance<BR>>>><BR>>>> Anna Chiara
Bellini<BR>>>><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>>>><BR>>>>
--<BR>>>> Gilberto Echeverria<BR>>>> Research
Engineer<BR>>>> Robotics and Interactions Group
(RIS)<BR>>>> LAAS/CNRS, Toulouse<BR>>>> <A
href="tel:%2B33%20%280%295%2061%2033%2078%2095" target=_blank
value="+33561337895">+33 (0)5 61 33 78
95</A><BR>>>><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>>><BR>>><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>_______________________________________________<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>