Server Launch Options
The ROS 1 server is launched with mujoco_ros/launch/launch_server.launch:
roslaunch mujoco_ros launch_server.launch use_sim_time:=true
Required Argument
use_sim_timeRequired. Sets
/use_sim_time. Usetruefor fully simulated systems. Usefalseonly when another clock source owns ROS time.
Runtime Arguments
nsOptional namespace passed to the server.
unpauseStarts physics immediately when
true. Defaults tofalse.headlessDisables the interactive GUI when
true. Offscreen rendering can still be enabled. Defaults tofalse.render_offscreenAllocates offscreen camera rendering resources when
true. Camera streams are still lazy and render only while subscribed. Defaults totrue.no_renderShorthand for
headless:=trueandrender_offscreen:=false. Use this for compute-only server runs. Defaults tofalse.no_xDeprecated compatibility option. It is treated as a no-render request when set and should be replaced by
no_render.modelfileMuJoCo XML or MJB file. Defaults to empty (no implicit
pendulum_world.xml).Without a description bundle (
urdf_sourceunset):modelfileis the full model to load. An empty value starts an empty simulation with a warning; set a path such as$(find mujoco_ros)/assets/pendulum_world.xmlfor a complete robot-and-world model.With a description bundle (
urdf_sourceset):modelfileis the world MJCF to compose the URDF robot into. An empty value uses the built-indefault_world.xml(checker ground plane, light, spawn frame). SRDF and Extended Params launch args remain optional.wait_for_xmlWaits for model XML on the parameter server instead of immediately loading a file path. Defaults to
false.
Description Bundle Arguments
Optional overrides that load the model from a URDF description bundle instead
of a standalone modelfile. The bundle activates when urdf_source is set;
SRDF args are optional (URDF-only bundles are valid). When active, the server
reads bundle params (urdf.* / srdf.*),
converts the URDF (and optional SRDF / Extended Params), and composes the robot
into the world given by modelfile (empty modelfile → built-in
default_world.xml).
urdf_sourceURDF source kind:
fileortopic. Empty skips the description bundle.urdf_pathURDF file path when
urdf_source:=file.urdf_topicTopic publishing the URDF as a latched
std_msgs/Stringwhenurdf_source:=topic(e.g./robot_description). The publisher must usetransient_localdurability (ROS 2) /latch=true(ROS 1) – a non-latched publisher is not readable through this path. If unset, the server defaults torobot_description.srdf_sourceOptional. SRDF source kind:
fileortopic.srdf_pathSRDF file path when
srdf_source:=file.srdf_topicTopic publishing the SRDF as a latched
std_msgs/Stringwhensrdf_source:=topic. Same latching requirement asurdf_topic. If unset, the server defaults torobot_description_semantic.convert_ascii_stlOptional. Sets
description.convert_ascii_stltotrueorfalse. Whentrue, ASCII visual/collision STLs are converted to binary under/tmp/mujoco_ros_stl_cache/(package files are never modified). When unset/empty (default), conversion is off and ASCII STLs use the collision OBJ fallback (<stem>.obj/<stem>_convex_hull.obj) or fail with a hint naming this option.
Example (URDF-only, default world):
roslaunch mujoco_ros launch_server.launch use_sim_time:=true \\
urdf_source:=file urdf_path:=/path/to/robot.urdf
Example (URDF + SRDF + custom world):
roslaunch mujoco_ros launch_server.launch use_sim_time:=true \\
urdf_source:=file urdf_path:=/path/to/robot.urdf \\
srdf_source:=file srdf_path:=/path/to/robot.srdf \\
modelfile:=/path/to/my_world.xml
Example (ASCII STL convert on):
roslaunch mujoco_ros launch_server.launch use_sim_time:=true \\
urdf_source:=file urdf_path:=/path/to/robot.urdf \\
convert_ascii_stl:=true
realtimeDesired real-time factor. Values in
(0, 1]cap the simulation speed;-1runs as fast as possible. If unset, the model’s MuJoCo realtime value is used. The server reapplies this mapping on every completed model load (including reloads), not only on the first queued init.num_sim_stepsAutomatically exits after this many MuJoCo simulation steps.
-1disables the limit.mujoco_threadsDeprecated. Number of MuJoCo worker threads requested by the server. The launch file defaults to
1; the server falls back to its internal default when the parameter is not set. Values greater than1can increase CPU usage because MuJoCo worker threads busy-wait; see google-deepmind/mujoco#2746. MuJoCo upstream is changing the public threading API to internal-only usage, so this behavior will change in the future andmujoco_roswill need its own threading API.mujoco_plugin_configYAML file loaded before the node starts. Use it to define
MujocoPluginsand plugin-specific configuration.initial_joint_statesYAML file loaded into the server namespace. Defaults to
$(find mujoco_ros)/config/initial_joint_states.yaml.
Access Control and Logging
eval_modeEnables evaluation restrictions. Mutating service calls require a matching
admin_hash, and the sensors plugin suppresses ground-truth topics. Defaults tofalse.admin_hashHash required by protected service calls while
eval_modeis enabled.verboseLoads the configured ROS console file and enables more detailed logs. Defaults to
false.console_config_fileROS console configuration used when
verboseis true. Defaults to$(find mujoco_ros)/config/rosconsole.config.
Developer Arguments
debugRuns the server under
gdb --args.debug_serverRuns the server under
gdbserver localhost:1234. This overrides normal debug mode.valgrindRuns the server under
valgrind. Do not combine this withdebug.valgrind_argsExtra arguments passed to valgrind.
profileSets
CPUPROFILE=/tmp/profile.outfor profiler-enabled builds.
ROS 2 Launch Differences
The hybrid-devel branch provides ROS 2 launch files at:
mujoco_ros/launch/ros2/launch/launch_server.launch.xmlmujoco_ros/launch/ros2/launch/launch_server.launch.py
Both mirror the ROS 1 arguments (including the description-bundle overrides)
but use ROS 2 launch syntax, $(find-pkg-share ...) / get_package_share_directory
paths, exec= instead of type=, ROS 2 log-level arguments, and
<param from=...> / ParameterFile for YAML loading.
They also add gdb_term_cmd for opening gdb in a terminal.