Passive objects

Besides physical interaction and perception via cameras or depth sensors, passive objects in a simulation can be interacted with in several other ways.

For instance some objects can be set to be graspable by a robot (or a human), and specific sensors like the Semantic camera may provide extended facts on a particular object, like its type.

Creating passive objects

Passive objects are either plain, regular Blender objects, or a hierarchy of objects that all share the same prefix.

../../_images/object_grouping.png

In the screenshot above (from $MORSE/share/morse/data/props/objects.blend), the RollingChair hierarchy is made of an empty (the RollingChair object itself) and five children (four for the bounding box, one for the actual mesh).

Since all these six Blender objects share the same prefix, they will be correctly imported together when using the MORSE Builder API.

When imported manually (from Blender interface), it eases the selection of relevant objects.

Note

You can also have a look to the tips to add a bounding box around your objects.

Passive objects properties

To be set as an interactive passive object, you only have to add the (Game) property Object to the object, and to set it as a True boolean property.

Other, optional, properties allow to control the behaviour of the object:

  • Label (String): the name (or label) of the object [1],
  • Description (String): a longer description of the object [2],
  • Type (String): the type of the object [3],
  • Graspable (Boolean): if the object is graspable or not [4].

You can temporarly disable an object by simply setting its Object property to false.

[1]Used to display the object name in human’s manipulation mode and by the semantic camera sensor as ID of tracked objects.
[2]Not used yet.
[3]Used by the semantic camera sensor, defaults to Object.
[4]Used by the human’s manipulation mode and the gripper actuators.

Note

For the manipulation routines to work, the above properties (especially, Graspable) must be set on the object holding the mesh you want to grab.

Importing passive objects with the MORSE Builder API

Passive objects can easily get added to a scenario defined with the MORSE Builder API.

The following example imports the SmallTable Blender object from the props/objects.blend assets file, set some properties, and place it in the scene:

from morse.builder.morsebuilder import *

table = PassiveObject('props/objects.blend','SmallTable')
table.setgraspable()
table.translate(x=3.5, y=-3, z=0)
table.rotate(z=0.2)

As any other property, the game properties can be set using the following command:

table.properties(Object = True, Graspable = False, Label = "TABLE")

Warning

To set an object to be graspable, you must also call the setgraspable(..) function. It adds an internal collision sensor to the object, required for pick and place actions with the human avatar.

The next example shows how to add semi-randomly placed chairs in a scene:

import random
from morse.builder.morsebuilder import *

# Add some randomly placed chairs
for i in range(3):
    chair = PassiveObject('props/objects.blend','RollingChair')
    chair.translate(x=random.uniform(1.5, 7.0),
                    y=random.uniform(-5.0, 0.0),
                    z=0.0000)
    chair.rotate(z=random.uniform(0.0, 6.2)) # rotation in radians

Table Of Contents

Previous topic

The human component in MORSE

Next topic

Human victim object

This Page