Jump to content

Connect Leeroopedia MCP: Equip your AI agents to search best practices, build plans, verify code, diagnose failures, and look up hyperparameter defaults.

Implementation:ARISE Initiative Robosuite MobileBaseVelocityController

From Leeroopedia
Knowledge Sources
Domains Robotics, Control
Last Updated 2026-02-15 07:00 GMT

Overview

Concrete tool for controlling a mobile robot base via joint velocity commands provided by robosuite.

Description

The MobileBaseJointVelocityController class implements velocity-level control of a robot's mobile base. It extends the MobileBaseController abstract base class and converts desired velocity actions into actuator commands that drive the base's translational and rotational joints. The controller is designed for holonomic mobile bases with joints for forward/lateral translation and yaw rotation.

A key feature of this controller is its coordinate frame transformation logic. Input actions are expressed as velocity deltas relative to the robot's current base pose, but the controller internally transforms these into the initial base pose coordinate frame. This is achieved by computing the angular difference between the current and initial base orientations and applying a 2D rotation to the translational velocity components. The final velocity commands are then scaled to the actuator range using a bias-plus-weight mapping to convert normalized actions (in [-1, 1]) to actuator control values.

The file also includes a LegacyMobileBaseJointVelocityController subclass that handles backward compatibility with older mobile base XML definitions where the forward joint axis may have been defined differently (y-axis instead of x-axis). This legacy controller dynamically detects the forward joint axis and reorders/rotates the input action accordingly. Both controllers support the same impedance mode options as other robosuite controllers ("fixed", "variable", "variable_kp") and optional interpolation.

Usage

Use the MobileBaseJointVelocityController for controlling the locomotion of mobile manipulator robots in robosuite. It is instantiated through the controller factory with the part name "base" and controller type "JOINT_VELOCITY" (or "JOINT_VELOCITY_LEGACY" for backward compatibility with older datasets).

Code Reference

Source Location

Signature

class MobileBaseJointVelocityController(MobileBaseController):
    def __init__(
        self,
        sim,
        joint_indexes,
        actuator_range,
        input_max=1,
        input_min=-1,
        output_max=1,
        output_min=-1,
        kp=50,
        damping_ratio=1,
        impedance_mode="fixed",
        kp_limits=(0, 300),
        damping_ratio_limits=(0, 100),
        policy_freq=20,
        qpos_limits=None,
        interpolator=None,
        **kwargs,
    ): ...

    def set_goal(self, action, set_qpos=None): ...
    def run_controller(self) -> np.array: ...
    def reset_goal(self): ...

    @property
    def control_limits(self) -> tuple: ...

    @property
    def name(self) -> str: ...  # Returns "JOINT_VELOCITY"

class LegacyMobileBaseJointVelocityController(MobileBaseJointVelocityController):
    def __init__(self, *args, **kwargs): ...
    def _check_forward_joint_reversed(self) -> bool: ...
    def set_goal(self, action, set_qpos=None): ...

Import

from robosuite.controllers.parts.mobile_base.joint_vel import MobileBaseJointVelocityController
from robosuite.controllers.parts.mobile_base.joint_vel import LegacyMobileBaseJointVelocityController

I/O Contract

Inputs

Name Type Required Description
sim MjSim Yes MuJoCo simulator instance for state updates
joint_indexes dict Yes Dictionary with keys 'joints', 'qpos', 'qvel' for the base joints
actuator_range 2-tuple of array Yes (low, high) actuator command limits
input_max float or Iterable No Maximum input action value (default: 1)
input_min float or Iterable No Minimum input action value (default: -1)
output_max float or Iterable No Maximum scaled output velocity (default: 1)
output_min float or Iterable No Minimum scaled output velocity (default: -1)
kp float or Iterable No Proportional gain (default: 50)
damping_ratio float or Iterable No Damping ratio for kd computation (default: 1)
impedance_mode str No One of "fixed", "variable", "variable_kp" (default: "fixed")
policy_freq int No Policy action frequency in Hz (default: 20)
qpos_limits 2-list or None No Joint position limits for goal clipping
interpolator Interpolator No Interpolator for smooth goal transitions

Outputs

Name Type Description
vels np.array Velocity commands mapped to actuator range, ready for application to the simulation
name str Controller identifier: "JOINT_VELOCITY"
control_limits tuple(np.array, np.array) (min, max) action limits varying by impedance mode

Usage Examples

# Typical usage via the controller factory
from robosuite.controllers.parts.controller_factory import mobile_base_controller_factory
import numpy as np

controller_params = {
    "sim": sim,
    "joint_indexes": {
        "joints": [0, 1, 2],
        "qpos": [0, 1, 2],
        "qvel": [0, 1, 2],
    },
    "actuator_range": (np.array([-1.0, -1.0, -1.0]), np.array([1.0, 1.0, 1.0])),
    "naming_prefix": "robot0_",
}

controller = mobile_base_controller_factory("JOINT_VELOCITY", controller_params)

# Reset goal to record initial base pose
controller.reset_goal()

# Command: move forward and rotate slightly
action = np.array([0.5, 0.0, 0.1])  # [forward, lateral, yaw]
controller.set_goal(action)

# Get actuator commands
vels = controller.run_controller()

Related Pages

Page Connections

Double-click a node to navigate. Hold to expand connections.
Principle
Implementation
Heuristic
Environment