[Robotics] Force/torque/collision sensor

Benoit Bolsee benoit.bolsee at online.be
Wed Jun 15 18:40:03 CEST 2011


The method that returns a new matrix is Matrix.transposed()
The API didn't change with regards to that.
 
-----Original Message-----
From: robotics-bounces at blender.org [mailto:robotics-bounces at blender.org]
On Behalf Of Anna Chiara Bellini
Sent: mercredi 15 juin 2011 13:21
To: Blender and Robotics
Subject: Re: [Robotics] Force/torque/collision sensor



Hi Fernando,

my issue was this: the mathutils.Matrix.transpose()
(beam.worldorientation.transpose(), line 11 ) doesn't return a new
instance of Matrix, but rather it trasnposes the matrix itself, and
returns None. 
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

rot = (beam.worldOrientation.transpose() *
base.worldOrientation).to_euler()
                                    this ^ fails

On the Blender console I see:
Python script error - object 'Beam', controller 'Python Script#CONTR#1':
Traceback (most recent call last):
  File "joint_controller.py", line 11, in <module>
TypeError: Matrix multiplication: not supported between 'NoneType' and
'mathutils.Matrix' types

So, here is what I did:

beam_rot = beam.worldOrientation.copy() # so that subsequent transpose()
doesn't change the beam's real orientation
beam_rot.transpose()
rot = (beam_rot * base.worldOrientation).to_euler()

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 :-)

Thank you again

Anna Chiara




On 10 June 2011 19:00, Fernando Garcia Bermudez <fgb at eecs.berkeley.edu>
wrote:


Anna Chiara,

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,

-- Fernando 



On Fri, Jun 10, 2011 at 02:56, Anna Chiara Bellini
<annachiara.bellini at gmail.com> wrote:


Ciao Fernando,
I've been playing around with this for a while, and I think I got the
hang of it, thank you :-)
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. 

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. 

Thank you again for your kind help

Anna Chiara Bellini 


On 7 June 2011 17:40, Fernando Garcia Bermudez <fgb at eecs.berkeley.edu>
wrote:


Since the e-mail below was being held due to a large attachment, I
decided to re-post without it. You can grab the attachment from:

http://github.com/fgb/passive_compliant_joint

Thanks,

-- Fernando


On Mon, Jun 6, 2011 at 12:05, Fernando Garcia Bermudez
<fgb at eecs.berkeley.edu> wrote:
> Anna,
>
> I've constructed passive compliant joints in the past using a mixture
> of rigid body joints and a python script controller, since there are
> no generic spring constraints in Blender that I know of.
>
> In a nutshell, I create a generic 6 DoF rigid body joint between two
> bodies, disabling collisions between them. I then proceed to allow
> only the rotations that the spring joint I'm envisioning has. I setup
> rigid body physics for both bodies and then add some parameters to the
> game property editor (spring constant, damping constant, and resting
> position for the joint). Finally, I add an always sensor connected to
> a python script which effectively controls the passive compliant
> joint. The script implements torque feedback based on the game
> property parameters. You could easily implement force feedback for a
> linear spring joint in a similar way. For clarity, I'm including a
> demonstration blend file.
>
> As you can see, the forces/torques are available to you as part of the
> simulation, but as Gilberto notes, they might not be very precise due
> to Bullet's limitations.
>
> I hope this helps you solve your issue. Let me know if you have any
questions,
>
> -- Fernando
>
>
> On Mon, Jun 6, 2011 at 11:09, Anna Chiara Bellini
> <annachiara.bellini at gmail.com> wrote:

>> Hello Gilberto,
>>
>> I'll try to explain it better... I need to detect forces for two
reasons:
>>
>> 1 - our robot is an UAV, and as it flies, it will get in touch with
objects
>> and environment. On the robot I need to have a few force/torque
sensors,
>> that will tell me the force/torque applied in that spot, and then we
combine
>> the different values to get a resulting force that will get back to
the user
>> using a force-feedback device.
>>
>> 2 - the robot features a grasp/manipulate tool, and I need to read
the force
>> applied on it.
>>
>> Now, my first idea is this: if I model the sensor as a small pivoting
>> damper, then I could read the position and pose of the damper to
calculate
>> force and torque... but this is just a very basic idea, I don't know
if it's
>> correct or if there are better ways. (Ideally, this should end up
being a
>> MORSE sensor, but that would be a second step, hence why I posted the
>> question here instead on the morse mailing list)
>>
>> I have also found this on the Bullet forum:
>> http://www.bulletphysics.org/Bullet/phpBB3/viewtopic.php?p=
<http://www.bulletphysics.org/Bullet/phpBB3/viewtopic.php?p=&f=9&t=3637>
&f=9&t=3637, but
>> I'm not understanding it completely, for instance I do not know what
a
>> "proxy" object is and how to set it up.
>>
>> Hope this is clear enough :-)
>>
>> You are saying that the Bullet engine is not extremely precise... can
you
>> tell me what are the limitations, or point me to a place where I can
get
>> more information?
>>
>> Thank you again
>>
>> Anna Chiara Bellini
>>
>>
>> On 6 June 2011 18:09, Gilberto Echeverria
<gilberto.echeverria at laas.fr>
>> wrote:
>>>
>>> Hello Anna Chiara,
>>>
>>> For the moment, MORSE does not include this sort of force sensors in
>>> joints. So far, the main developers of MORSE have not approached
this sort
>>> of simulation, so it remains an open area for development. However,
maybe
>>> other people in the Blender community may have worked on similar
problems.
>>>
>>> It should be possible to measure forces in Blender, but the physics
engine
>>> used by default (Bullet) is not extremely precise. It will depend on
what
>>> exactly you want to model.
>>> If you can provide more details, we can give you a better insight on
how
>>> to deal with this kind of sensors.
>>>
>>> Best regards,
>>> Gilberto Echeverria
>>>
>>> On 06/06/2011 04:16 PM, Anna Chiara Bellini wrote:
>>>
>>> Dear all,
>>>
>>> I am working on a robot simulation project ( http://www.airobots.eu/
)
>>> with Blender and I am trying to do something which I'm sure someone
else has
>>> already done, so I'm asking for directions: I need to model passive
>>> compliant joints and detect the forces acting on them. I guess that
the way
>>> is through Blender's rigid body joint constraint , possibly the
>>> 6DofSpringConstraint, but I'm not really sure about it and I really
don't
>>> know which would be the best solution.
>>>
>>> In our project, we are using MORSE for sensors/actuators/middleware,
so if
>>> anyone had a MORSE-specific solution or suggestion, that would be
great.
>>>
>>> Any ideas?
>>>
>>> Thank you in advance
>>>
>>> Anna Chiara Bellini
>>>
>>> _______________________________________________
>>> Robotics mailing list
>>> Robotics at blender.org
>>> http://lists.blender.org/mailman/listinfo/robotics
>>>
>>>
>>> --
>>> Gilberto Echeverria
>>> Research Engineer
>>> Robotics and Interactions Group (RIS)
>>> LAAS/CNRS, Toulouse
>>> +33 (0)5 61 33 78  <tel:%2B33%20%280%295%2061%2033%2078%2095> 95
>>>
>>> _______________________________________________
>>> Robotics mailing list
>>> Robotics at blender.org
>>> http://lists.blender.org/mailman/listinfo/robotics
>>>
>>
>>
>> _______________________________________________
>> Robotics mailing list
>> Robotics at blender.org
>> http://lists.blender.org/mailman/listinfo/robotics
>
_______________________________________________
Robotics mailing list
Robotics at blender.org
http://lists.blender.org/mailman/listinfo/robotics




_______________________________________________
Robotics mailing list
Robotics at blender.org
http://lists.blender.org/mailman/listinfo/robotics





_______________________________________________
Robotics mailing list
Robotics at blender.org
http://lists.blender.org/mailman/listinfo/robotics




-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.blender.org/pipermail/robotics/attachments/20110615/d3cb351b/attachment-0001.htm 


More information about the Robotics mailing list