Skip to content

Running the output ​

--target and --output turn a checked program into one directory that runs as it is.

sh
mobiledsl compile robot.core robot.world robot.task robot.eval --library parts \
  --target ros-gz-nav2 --output build

Targets ​

TargetFor
ros-gz-nav2ROS 2 Jazzy, Gazebo Harmonic, ros2_control, Nav2
ros-mujoco-nav2ROS 2 Jazzy, MuJoCo, ros2_control, Nav2

Both write the same robot description, controllers, navigation settings, task and runtime; they differ in the simulator. See Gazebo or MuJoCo.

The output directory ​

text
build/
├── robot/        robot.urdf, controllers.yaml, meshes/, and hulls/ when a part declares a hull
├── world/        world.sdf and bridge.yaml, or mujoco.json
├── nav/          nav2.base.yaml, nav2.robot.yaml, map.pgm, map.yaml
├── task/         behavior_tree.xml, mission.json, evaluation.json
├── launch/       bringup.launch.py
├── runtime/      the task runner and helpers, needing only ROS 2
└── compile.json  what the compiler knew: facts, validation, stand-ins, sources

Nothing in it is built or installed, and it holds no absolute path, so it can be moved or mounted anywhere. The same program, libraries and compiler version always produce the same bytes. Compiling again overwrites the files it writes and leaves every other file alone.

Launching ​

sh
ros2 launch build/launch/bringup.launch.py

The launch brings up the simulator, the robot, its drive controller, Nav2 and the task runner, in that order, and shuts everything down when the task ends.

ArgumentDoes
headless:=falseOpens Gazebo's window; MuJoCo has none
navigation:=falseBrings up only the simulator, the robot and its controller, to drive it by hand
exit_on_task_end:=falseKeeps everything running after the task ends
run_dir:=DIRWrites the run's results to DIR instead of build/run

To drive the base by hand, publish geometry_msgs/msg/TwistStamped on /cmd_vel. A command older than half a second stops the base.

Topics ​

TopicCarries
/cmd_velVelocity commands to the base
/odomThe base's wheel odometry
/scanThe first laser, or a scan made from another range sensor
/model/<robot>/poseThe simulator's own pose of the robot, which the evaluation trusts

Sensors lists every sensor's topics.

Results ​

A run writes run/task_result.json, the task's own account, and run/evaluation.json, the three verdicts. The compiler never writes into run/, so compiling again keeps earlier results. Judging a run explains both files.

Stand-ins ​

Where a simulator cannot model something as it is, the target stands in for it and says so. A mecanum wheel in Gazebo is a sphere that slides freely along its rollers' axis; a lidar gets a default beam count because the library does not state one. Every stand-in is listed under approximations in compile.json, next to the component it concerns:

sh
python -m json.tool build/compile.json | less

What a target cannot stand in for, it refuses at compile time, and nothing is written.

Next ​

The Advanced pages go deeper, starting with Adding your own part.