SO101-Nexus
API Reference

Configuration Classes

Reference for all configuration classes.

Configuration Classes

All configuration classes live in so101_nexus_core and are plain Python classes with default constructor arguments. They control rendering, robot parameters, reward shaping, observation composition, and environment behavior.

RenderConfig

Controls image resolution for the visualization render camera (not observations).

from so101_nexus_core import RenderConfig

render = RenderConfig(width=640, height=480)

Constructor Parameters

ParameterTypeDefaultDescription
widthint640Render image width in pixels
heightint480Render image height in pixels

Pose

Defines a named robot arm configuration with fixed and free joints. See Initial Poses for a conceptual overview.

from so101_nexus_core import Pose

pose = Pose(
    name="custom",
    shoulder_pan_deg=(-110.0, 110.0),  # free: sampled uniformly
    shoulder_lift_deg=-90.0,            # fixed
    elbow_flex_deg=90.0,                # fixed
    wrist_flex_deg=37.8,                # fixed
    wrist_roll_deg=(-157.0, 163.0),     # free
    gripper_deg=(-10.0, 100.0),         # free
)

Constructor Parameters

ParameterTypeDescription
namestrHuman-readable identifier
shoulder_pan_degfloat | tuple[float, float]Shoulder pan angle or range (degrees)
shoulder_lift_degfloat | tuple[float, float]Shoulder lift angle or range (degrees)
elbow_flex_degfloat | tuple[float, float]Elbow flex angle or range (degrees)
wrist_flex_degfloat | tuple[float, float]Wrist flex angle or range (degrees)
wrist_roll_degfloat | tuple[float, float]Wrist roll angle or range (degrees)
gripper_degfloat | tuple[float, float]Gripper angle or range (degrees)

Methods

MethodReturnsDescription
sample(rng)tuple[float, ...]Sample concrete joint angles in degrees
sample_rad(rng)tuple[float, ...]Sample concrete joint angles in radians

Built-in Poses

NameConstantDescription
"rest"REST_POSEArm curled in rest position, free shoulder_pan/wrist_roll/gripper
"extended"EXTENDED_POSEArm extended forward, free shoulder_pan/wrist_roll/gripper

Access via the POSES dict or by constant:

from so101_nexus_core import POSES, REST_POSE

pose = POSES["rest"]   # same as REST_POSE

RobotConfig

Controls the arm rest pose and grasping thresholds.

from so101_nexus_core import RobotConfig

robot = RobotConfig(rest_qpos_deg=(0.0, -90.0, 90.0, 37.82, 0.0, -63.03))

Constructor Parameters

ParameterTypeDefaultDescription
rest_qpos_degtuple[float, ...](0.0, -90.0, 90.0, 37.82, 0.0, -63.03)Rest joint positions in degrees, one per joint
init_posestr | Pose | NoneNoneInitial pose for resets. String looks up from POSES, Pose instance used directly, None uses legacy rest + noise.
grasp_force_thresholdfloat0.5Minimum contact force to count as a grasp
static_vel_thresholdfloat0.2Maximum velocity to consider the arm stationary

Properties

PropertyTypeDescription
rest_qpos_radtuple[float, ...]rest_qpos_deg converted to radians
rest_qpostuple[float, ...]Alias for rest_qpos_rad
resolve_pose()Pose | NoneReturns the resolved Pose object, or None

RewardConfig

Defines reward component weights and computes the shaped reward.

from so101_nexus_core import RewardConfig

reward = RewardConfig(reaching=0.25, grasping=0.25, task_objective=0.40, completion_bonus=0.10)

Constructor Parameters

ParameterTypeDefaultDescription
reachingfloat0.25Weight for the reaching component
graspingfloat0.25Weight for the grasping component
task_objectivefloat0.40Weight for the task-specific objective
completion_bonusfloat0.10Weight for the task completion bonus
action_delta_penaltyfloat0.0Penalty coefficient on L2 norm of consecutive action deltas
energy_penaltyfloat0.0Penalty coefficient on L2 norm of the action vector
tanh_shaping_scalefloat5.0Scale factor for tanh reward shaping

Validation

The four base weights (reaching + grasping + task_objective + completion_bonus) must sum to 1.0. Construction raises an error if this constraint is violated. The penalty coefficients are separate additive terms and are not included in the sum constraint.

Methods

compute()

def compute(
    reach_progress: float,
    is_grasped: bool,
    task_progress: float,
    is_complete: bool,
    action_delta_norm: float = 0.0,
    energy_norm: float = 0.0,
) -> float

Computes the weighted reward from per-component progress values.

ParameterTypeDefaultDescription
reach_progressfloatrequiredProgress toward the target (0 to 1)
is_graspedboolrequiredWhether the object is currently grasped
task_progressfloatrequiredProgress on the task objective (0 to 1)
is_completeboolrequiredWhether the task is fully complete
action_delta_normfloat0.0Norm of the action delta for penalty
energy_normfloat0.0Norm of energy usage for penalty

Returns a single float reward value.


EnvironmentConfig

Base configuration for all environments. Task-specific configs extend this class.

from so101_nexus_core import EnvironmentConfig

config = EnvironmentConfig(max_episode_steps=512, obs_mode="state")

Constructor Parameters

ParameterTypeDefaultDescription
renderRenderConfig | NoneNoneRender camera resolution settings (visualization only). Uses RenderConfig() defaults when None.
rewardRewardConfig | NoneNoneReward weights. Uses RewardConfig() defaults when None.
robotRobotConfig | NoneNoneRobot settings. Uses RobotConfig() defaults when None.
ground_colorsColorConfig"gray"Ground plane color(s)
max_episode_stepsint1024Maximum steps before truncation
goal_threshfloat0.025Distance threshold for goal completion (meters)
spawn_half_sizefloat0.05Half-size of object spawn region
spawn_centertuple[float, float](0.15, 0.0)Center of the spawn region (x, y)
spawn_min_radiusfloat0.20Minimum spawn distance from the robot base
spawn_max_radiusfloat0.40Maximum spawn distance from the robot base
spawn_angle_half_range_degfloat90.0Half-range of spawn angle in degrees
obs_modeObsMode"state"Observation mode: "state" or "visual"
robot_colorsColorConfig"yellow"Robot body color(s)
robot_init_qpos_noisefloat0.02Noise added to initial joint positions
observationslist[Observation] | NoneNoneObservation components to include. Task-specific configs provide defaults when None.

Validation

  • obs_mode must be "state" or "visual"
  • When obs_mode="visual", observations must contain at least one camera component (WristCamera or OverheadCamera)
  • Duplicate camera component types are not allowed

Observation Components

Observation components are lightweight descriptor classes passed via the observations parameter. See Observations for a conceptual overview.

State Components

ClassSizeDescription
JointPositions()6Current joint angles
EndEffectorPose()7TCP position + quaternion
TargetOffset()3Vector from gripper to goal
GazeDirection()3Unit vector toward target
GraspState()1Binary grasp flag
ObjectPose()7Object position + quaternion
ObjectOffset()3Vector from gripper to object
TargetPosition()3Absolute goal position

Camera Components

WristCamera

from so101_nexus_core import WristCamera

cam = WristCamera(width=224, height=224)
ParameterTypeDefaultDescription
widthint640Image width in pixels
heightint480Image height in pixels
fov_deg_rangetuple[float, float](60.0, 90.0)FOV randomization range in degrees
pitch_deg_rangetuple[float, float](-34.4, 0.0)Pitch randomization range in degrees
pos_x_noisefloat0.005Position noise along x-axis
pos_y_centerfloat0.04Nominal y-offset from the wrist
pos_y_noisefloat0.01Position noise along y-axis
pos_z_centerfloat-0.04Nominal z-offset from the wrist
pos_z_noisefloat0.01Position noise along z-axis

Properties: fov_rad_range, pitch_rad_range (converted to radians).

OverheadCamera

from so101_nexus_core import OverheadCamera

cam = OverheadCamera(width=320, height=240, fov_deg=45.0)
ParameterTypeDefaultDescription
widthint640Image width in pixels
heightint480Image height in pixels
fov_degfloat45.0Vertical field-of-view in degrees

PickConfig

Extends EnvironmentConfig with parameters for pick and lift tasks.

from so101_nexus_core import PickConfig, CubeObject, YCBObject

config = PickConfig(
    objects=[CubeObject(color="blue"), YCBObject("011_banana")],
    n_distractors=2,
)

Additional Parameters

These are in addition to all EnvironmentConfig parameters.

ParameterTypeDefaultDescription
objectslist[SceneObject] | SceneObject | NoneNoneObjects to pick. A single object is auto-wrapped. Defaults to [CubeObject()] when None.
n_distractorsint0Number of distractor objects to spawn
lift_thresholdfloat0.05Height above the table to count as lifted (meters)
max_goal_heightfloat0.08Maximum target lift height (meters)
min_object_separationfloat0.04Minimum distance between spawned objects (meters)

Default Observations

When observations is not specified: [EndEffectorPose(), GraspState(), ObjectPose(), ObjectOffset()] (18 dimensions).


PickAndPlaceConfig

Extends EnvironmentConfig with parameters for pick-and-place tasks.

from so101_nexus_core import PickAndPlaceConfig

config = PickAndPlaceConfig(
    cube_colors="blue",
    target_colors="green",
    min_cube_target_separation=0.05,
)

Additional Parameters

These are in addition to all EnvironmentConfig parameters.

ParameterTypeDefaultDescription
cube_colorsColorConfig"red"Color(s) for the cube
target_colorsColorConfig"blue"Color(s) for the target disc
cube_half_sizefloat0.0125Half-size of the cube (meters)
cube_massfloat0.01Mass of the cube (kg)
target_disc_radiusfloat0.05Radius of the target disc (meters)
min_cube_target_separationfloat0.0375Minimum distance between cube and target spawn positions (meters)

Default Observations

When observations is not specified: [EndEffectorPose(), GraspState(), TargetPosition(), ObjectPose(), ObjectOffset(), TargetOffset()] (24 dimensions).


ReachConfig

Extends EnvironmentConfig with parameters for the reach-to-target primitive task.

from so101_nexus_core import ReachConfig

config = ReachConfig(target_radius=0.03, success_threshold=0.02)

Additional Parameters

ParameterTypeDefaultDescription
target_radiusfloat0.02Visual radius of the target site sphere (meters)
target_workspace_half_extentfloat0.15Half-width of the cubic workspace for target sampling (meters)
success_thresholdfloat0.02TCP-to-target distance (m) that counts as success

Defaults max_episode_steps to 512.

Default Observations

When observations is not specified: [JointPositions()] (6 dimensions).


LookAtConfig

Extends EnvironmentConfig with parameters for the look-at primitive task.

from so101_nexus_core import LookAtConfig, CubeObject

config = LookAtConfig(
    objects=CubeObject(color="blue"),
    orientation_success_threshold_deg=5.0,
)

Additional Parameters

ParameterTypeDefaultDescription
objectslist[SceneObject] | SceneObject | NoneNoneTarget object(s). Only CubeObject is supported. Defaults to [CubeObject()].
orientation_success_threshold_degfloat5.73Max angular error in degrees for success

Defaults max_episode_steps to 256.

Default Observations

When observations is not specified: [JointPositions()] (6 dimensions).


MoveConfig

Extends EnvironmentConfig with parameters for the directional move primitive task.

from so101_nexus_core import MoveConfig

config = MoveConfig(direction="up", target_distance=0.10)

Additional Parameters

ParameterTypeDefaultDescription
directionMoveDirection"up"Cardinal direction: "up", "down", "left", "right", "forward", "backward"
target_distancefloat0.10Distance in metres to travel from the initial TCP position
success_thresholdfloat0.01Max residual distance (m) to count as success

Defaults max_episode_steps to 256.

Default Observations

When observations is not specified: [JointPositions()] (6 dimensions).

On this page