Skip to content

Control

FullJointControl

Bases: Motion

Full joint control.

Source code in mbodied/types/motion/control.py
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
class FullJointControl(Motion):
    """Full joint control."""

    joints: Sequence[JointControl] | list[float] = MotionField(
        default_factory=list,
        description="List of joint values in radians.",
    )
    names: Sequence[str] | list[float] | None = MotionField(default=None, description="List of joint names.")

    def space(self):  # noqa: ANN201
        space = dict(super().space())

        for i, joint in enumerate(self.joints):
            name = self.names[i] if self.names else f"joint_{i}"
            space[name] = joint.space()
        return spaces.Dict(space)

HandControl

Bases: Motion

Action for a 7D space representing x, y, z, roll, pitch, yaw, and oppenness of the hand.

Source code in mbodied/types/motion/control.py
65
66
67
68
69
70
71
72
class HandControl(Motion):
    """Action for a 7D space representing x, y, z, roll, pitch, yaw, and oppenness of the hand."""

    pose: Pose6D = MotionField(default_factory=Pose, description="Pose of the robot hand.")
    grasp: JointControl = MotionField(
        default_factory=JointControl,
        description="Openness of the robot hand. 0 is closed, 1 is open.",
    )

HumanoidControl

Bases: Motion

Control for a humanoid robot.

Source code in mbodied/types/motion/control.py
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
class HumanoidControl(Motion):
    """Control for a humanoid robot."""

    left_arm: FullJointControl | None = MotionField(
        default_factory=FullJointControl,
        description="Control for the left robot arm.",
    )
    right_arm: FullJointControl | None = MotionField(
        default_factory=FullJointControl,
        description="Control for the right robot arm.",
    )
    left_leg: FullJointControl | None = MotionField(
        default_factory=FullJointControl,
        description="Control for the left robot leg.",
    )
    right_leg: FullJointControl | None = MotionField(
        default_factory=FullJointControl,
        description="Control for the right robot leg.",
    )
    head: HeadControl | None = MotionField(default=None, description="Control for the robot head.")

JointControl

Bases: Motion

Motion for joint control.

Source code in mbodied/types/motion/control.py
38
39
40
41
42
43
44
class JointControl(Motion):
    """Motion for joint control."""

    value: float = MotionField(default_factory=lambda: 0.0, bounds=[-3.14, 3.14], description="Joint value in radians.")

    def space(self):  # noqa: ANN201
        return spaces.Box(low=-3.14, high=3.14, shape=(), dtype=np.float32)

MobileBimanualArmControl

Bases: Motion

Control for a robot that can move in 2D space with two arms.

Source code in mbodied/types/motion/control.py
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
class MobileBimanualArmControl(Motion):
    """Control for a robot that can move in 2D space with two arms."""

    base: LocationAngle | None = MotionField(
        default_factory=LocationAngle,
        description="Location of the robot on the ground.",
    )
    left_arm: FullJointControl | None = MotionField(
        default_factory=FullJointControl,
        description="Control for the left robot arm.",
    )
    right_arm: FullJointControl | None = MotionField(
        default_factory=FullJointControl,
        description="Control for the right robot arm.",
    )
    head: HeadControl | None = MotionField(default=None, description="Control for the robot head.")

MobileSingleArmControl

Bases: Motion

Control for a robot that can move in 2D space with a single arm.

Source code in mbodied/types/motion/control.py
 98
 99
100
101
102
103
104
105
106
107
108
109
class MobileSingleArmControl(Motion):
    """Control for a robot that can move in 2D space with a single arm."""

    base: LocationAngle | None = MotionField(
        default_factory=LocationAngle,
        description="Location of the robot on the ground.",
    )
    arm: FullJointControl | None = MotionField(
        default_factory=FullJointControl,
        description="Control for the robot arm.",
    )
    head: HeadControl | None = MotionField(default=None, description="Control for the robot head.")

MobileSingleHandControl

Bases: Motion

Control for a robot that can move its base in 2D space with a 6D EEF control + grasp.

Source code in mbodied/types/motion/control.py
86
87
88
89
90
91
92
93
94
95
class MobileSingleHandControl(Motion):
    """Control for a robot that can move its base in 2D space with a 6D EEF control + grasp."""

    # Location of the robot on the ground.
    base: LocationAngle | None = MotionField(
        default_factory=LocationAngle,
        description="Location of the robot on the ground.",
    )
    hand: HandControl | None = MotionField(default_factory=HandControl, description="Control for the robot hand.")
    head: HeadControl | None = MotionField(default=None, description="Control for the robot head.")