ManipulationInterface and HeadInterface give you direct control over the robot’s arm and head. Use these for manipulation tasks, gestures, and camera positioning.
Documentation Index
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
ManipulationInterface and HeadInterface give you direct control over the robot’s arm and head. Use these for manipulation tasks, gestures, and camera positioning.
from brain_client.skill_types import Skill, Interface, InterfaceType
class MySkill(Skill):
manipulation = Interface(InterfaceType.MANIPULATION)
# 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)
)
# Move to joint configuration [j1, j2, j3, j4, j5, j6]
self.manipulation.goto_joint_state([0, -0.5, 1.5, -1.0, 0, 0])
# 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}
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
from brain_client.skill_types import Skill, Interface, InterfaceType
class MySkill(Skill):
head = Interface(InterfaceType.HEAD)
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
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"
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"
