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

MethodParametersDescription
move_to_cartesian_pose()
x: floaty: floatz: floatroll: floatpitch: floatyaw: floatduration: float
Move the end-effector to a target Cartesian pose.
goto_joint_state()
joints: list[float]
Move the arm to a target joint configuration (6 values).
get_current_orientation_rpy()NoneGet current end-effector orientation as roll/pitch/yaw values.
get_current_end_effector_pose()NoneGet current end-effector pose (position + quaternion).
solve_ik()
x: floaty: floatz: floatroll: floatpitch: floatyaw: floattimeout: float
Solve inverse kinematics for a target pose without moving the arm.

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
)

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

MethodParametersDescription
set_position()
angle: int
Set head tilt angle (from -25deg to +15deg).

Tilt Angles

AngleView
-25degFloor and objects below.
0degStraight ahead.
+15degFaces and shelves above.
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"