Skip to main content
The ManipulationInterface and HeadInterface give you direct control over the robot’s arm and head. Use these for manipulation tasks, gestures, and camera positioning.

ManipulationInterface

Declare the interface at class level:
from brain_client.skill_types import Skill, Interface, InterfaceType

class MySkill(Skill):
    manipulation = Interface(InterfaceType.MANIPULATION)

Methods

Cartesian Control

Move the end-effector to a specific position and orientation:
# Move to position (x, y, z) with orientation (roll, pitch, yaw)
self.manipulation.move_to_cartesian_pose(
    x=0.2, y=0.0, z=0.3,
    roll=0.0, pitch=0.0, yaw=0.0,
    duration=2.0  # motion duration in seconds (not milliseconds)
)

Joint Control

Move directly to joint angles (6 joints):
# Move to joint configuration [j1, j2, j3, j4, j5, j6]
self.manipulation.goto_joint_state([0, -0.5, 1.5, -1.0, 0, 0])

Reading State

# Get current end-effector pose
pose = self.manipulation.get_current_end_effector_pose()
# Returns: {'position': [x, y, z], 'orientation': [qx, qy, qz, qw]}

# Get orientation as roll/pitch/yaw
rpy = self.manipulation.get_current_orientation_rpy()
# Returns: {'roll': r, 'pitch': p, 'yaw': y}

Inverse Kinematics

Check if a pose is reachable before moving:
joints = self.manipulation.solve_ik(
    x=0.2, y=0.0, z=0.3,
    roll=0.0, pitch=0.0, yaw=0.0,
    timeout=1.0
)
if joints:
    self.manipulation.goto_joint_state(joints)
else:
    return "Pose unreachable", SkillResult.FAILURE

HeadInterface

Control camera tilt:
from brain_client.skill_types import Skill, Interface, InterfaceType

class MySkill(Skill):
    head = Interface(InterfaceType.HEAD)

Methods

Tilt Angles

self.head.set_position(-15)  # Look down at objects
self.head.set_position(0)    # Look straight ahead
self.head.set_position(10)   # Look up at faces

Example: Wave

A skill that waves the arm:
from brain_client.skill_types import Skill, SkillResult, Interface, InterfaceType
import time

class Wave(Skill):
    manipulation = Interface(InterfaceType.MANIPULATION)

    @property
    def name(self):
        return "wave"

    def guidelines(self):
        return "Use to wave at someone in greeting."

    def execute(self, times: int = 3):
        # Wave positions
        wave_left = [0.5, -0.3, 1.0, -0.5, 0.5, 0]
        wave_right = [0.5, -0.3, 1.0, -0.5, -0.5, 0]

        for i in range(times):
            if self._cancelled:
                return "Wave cancelled", SkillResult.CANCELLED

            self.manipulation.goto_joint_state(wave_left)
            time.sleep(0.3)
            self.manipulation.goto_joint_state(wave_right)
            time.sleep(0.3)

        return f"Waved {times} times", SkillResult.SUCCESS

    def cancel(self):
        self._cancelled = True
        return "Wave cancelled"

Example: LookAtObject

A skill that adjusts head to look at objects:
from brain_client.skill_types import Skill, SkillResult, Interface, InterfaceType

class LookAtObject(Skill):
    head = Interface(InterfaceType.HEAD)

    @property
    def name(self):
        return "look_at_object"

    def guidelines(self):
        return "Use to tilt camera to look at objects on the floor or shelves."

    def execute(self, location: str = "floor"):
        angles = {
            "floor": -25,
            "table": -10,
            "ahead": 0,
            "face": 10,
            "shelf": 15
        }

        angle = angles.get(location, 0)
        self.head.set_position(angle)

        return f"Looking at {location}", SkillResult.SUCCESS

    def cancel(self):
        return "Cannot cancel head movement"