morse-simulator / morse

The Modular OpenRobots Simulation Engine
http://morse-simulator.github.io/
Other
351 stars 155 forks source link

Getting passive objects location #767

Closed tomazela closed 6 years ago

tomazela commented 6 years ago

Hi,

I am working on a simulation where my robot grabs a passive object (cup), walks to a point and releases it. So, I would like to know if is there a way to get the position of a passive object after its falling? I've read some topics that was possible to use bpy (Python API of Blender), but I was not able to use it outside Blender python console :/

Tks in advance!


severin-lemaignan commented 6 years ago

Hello Lucas,

One way of achieving this is to attach a sensor (in your case, a pose sensor) to a FakeRobot (as passive objects can not hold directly sensors), and attach the FakeRobot to your object:

Something like that:

chair = PassiveObject('props/objects','RollingChair') chair.properties(Object = True)

fakerobot = FakeRobot() chairpose = Pose()

chair.append(fakerobot) fakerobot.append(chairpose) fakerobot.add_default_interface('socket')

Let us know whether this work for you, and if it does, please close this issue.

tomazela commented 6 years ago

Hi Severin,

This workaround has worked :)

Thanks! Lucas