You can compose a single actor from multiple collision and visual primitives. When adding shapes to the ActorBuilder, you can provide a pose argument to add_box_collision or add_box_visual.
Crucial distinction:
- The
pose passed to add_... methods sets the shape's position relative to the actor frame. - The
actor.set_pose(...) method sets the actor's position relative to the world frame.
# Example: Creating a table (tabletop + 4 legs)
builder = scene.create_actor_builder()
# Add tabletop
builder.add_box_collision(half_size=[1.0, 1.0, 0.1], pose=Pose(p=[0, 0, 0.5], q=[1, 0, 0, 0]))
builder.add_box_visual(half_size=[1.0, 1.0, 0.1], pose=Pose(p=[0, 0, 0.5], q=[1, 0, 0, 0]))
# Add legs (example for one leg)
builder.add_box_collision(half_size=[0.1, 0.1, 0.5], pose=Pose(p=[0.9, 0.9, 0], q=[1, 0, 0, 0]))
builder.add_box_visual(half_size=[0.1, 0.1, 0.5], pose=Pose(p=[0.9, 0.9, 0], q=[1, 0, 0, 0]))
# ... add other legs ...
table = builder.build()