Star Nav

Autonomous quadrotor exploration, simulation first

Star Nav is a ROS Noetic workspace that flies a quadrotor through an unknown forest: a waypoint exploration manager, the EGO-Planner local planner fed by a depth camera, and a MuJoCo 4 simulator with rigid-body dynamics that you watch in the browser.

MuJoCo simulator. Physics, flight controller and depth camera; the same camera the browser viewer uses.
RViz. Blue: flown path. Coloured: known obstacles. Magenta: the planner's occupancy map built from depth.
One full mission, real time (60 s): 12 lawnmower waypoints over a 9 × 9 m area in a forest of 150 pillars and tilted rings, zero collisions. Recorded with --record; the same run is an automated test in CI.
500 Hz
physics and flight control
30 / 10 Hz
depth camera / 360° lidar
~6 ms
depth frame on GPU (EGL)
0 ROS
imports in the simulator

Live MuJoCo in your browser

MuJoCo 4, compiled to WebAssembly, simulates the quadrotor in this page in real time: the same model, forest (seed 1) and SE(3) flight controller as the simulator, following the setpoints EGO-Planner sent during a recorded mission. Drag to orbit, scroll to zoom, right-drag to pan.

The interactive scene loads when you scroll here.

Blue: the planned path. Orange: the path flown in your browser. Physics runs at 500 Hz on your CPU; the planner itself is not running here, only its output is replayed, so the drone loops over the same mission.

Architecture

The simulator is a plain Python process with no ROS dependency. A thin C++ bridge translates its ZeroMQ messages into the exact topics the planning stack already expects, so the planner, the exploration manager and the RViz configuration are unchanged, and the same stack flies on hardware.

Simulator process (Docker image or Python venv) ROS bridge ROS planning stack

How the loop closes

The planner never sees the simulator's ground truth. It only gets what a real drone would get: odometry and a depth image or lidar scan.

Observation

Simulator → planner

  1. Every 2 ms MuJoCo steps the rigid body; every 5 ms its pose and velocity go out as state, republished as nav_msgs/Odometry.
  2. At 30 Hz the onboard camera renders a depth image in millimetres, stamped with the optical-frame pose at the moment of capture.
  3. The bridge publishes the image and camera_pose with one timestamp; EGO-Planner's grid map pairs them and ray-casts every pixel into its occupancy map.
  4. Obstacle geometry is published once as a point cloud for RViz only; the planner does not use it.
Control

Planner → simulator

  1. The exploration manager sends the next waypoint to EGO-Planner, which optimises a collision-free B-spline from the current odometry.
  2. traj_server samples it at 100 Hz into a PositionCommand: position, velocity, acceleration, yaw and yaw rate.
  3. The bridge forwards it over ZeroMQ. A geometric SE(3) controller tracks it with acceleration feed-forward and turns it into four motor thrusts.
  4. If commands stop for 0.5 s the quadrotor holds its last position.

Depth camera or 360° lidar

The planner can avoid obstacles with the forward depth camera or with a simulated 32-beam lidar (sensor:=lidar). Both feed the same occupancy map; the lidar sees all around the vehicle but only between its beams. Every run checks the data against the true world: lidar points land within 5 mm of the obstacle surfaces, and the planner's map has no phantom obstacles.

MuJoCo. Lidar returns as dots: rings on the ground, columns on pillars and rings.
RViz. Red: the current scan. Coloured: obstacles in the planner's map. Blue: flown path.
Depth camera360° lidar
Field of view79° × 64°, forward360° × 45°
Samples640 × 480 at 30 Hz32 × 1024 at 10 Hz
Into the plannerimage + camera pose, projected with intrinsicsworld-frame point cloud
No returnfree space up to 4.5 mno information
Blind spotseverything outside the frustumabove and below the beam fan, gaps between beams

How the two inputs differ and how accuracy is checked →

Two simulators, one stack

Both publish the same topics; pick one per launch file. The kinematic one is the quickest check, MuJoCo is closer to a real flight.

Kinematic (exploration_sim.launch)MuJoCo (exploration_mujoco.launch)
VehicleFollows commands exactly1 kg quadrotor, motor lag, drag, SE(3) controller
DepthRendered from the global point cloudRasterised by MuJoCo (also sees the ground)
CollisionsNot modelledCounted; the test fails on any contact
VisualisationRVizBrowser viewer and RViz
Runs onROS Noetic (native or Docker)Simulator: any OS with Python ≥ 3.11 or Docker
Bridge + planner: ROS Noetic
Testsim_smoke.testmujoco_smoke.test

Quick start

Docker is the shortest path and works on Linux, macOS and Windows (WSL2). Commands run from the repository root.

01Headless check in Docker

Builds the images and flies a full mission on MuJoCo; exits non-zero on failure or collision.

git clone https://github.com/1nrobotics/star-nav.git
cd star-nav
./scripts/run_mujoco_smoke_test.sh

02Watch it fly (Ubuntu 20.04 + ROS Noetic)

The repository is the src folder of a catkin workspace. The simulator gets its own Python environment.

git clone https://github.com/1nrobotics/star-nav.git ~/catkin_ws/src
cd ~/catkin_ws
source /opt/ros/noetic/setup.bash
rosdep install --from-paths src --ignore-src -r -y
catkin_make -DCMAKE_BUILD_TYPE=Release
source devel/setup.bash
./src/scripts/setup_mujoco_env.sh   # once: creates mujoco_sim/.venv
roslaunch star_nav_bringup exploration_mujoco.launch use_rviz:=true

Open http://localhost:8080, then press Start Exploration in the RViz GCS panel, or:

rostopic pub -1 /exploration/trigger geometry_msgs/PoseStamped "{}"

03Simulator on its own

No ROS needed: useful for controller work or to run the simulator on another machine (--bind 0.0.0.0).

cd mujoco_sim
.venv/bin/python -m star_nav_mujoco --seed 3 --record flight.mp4
.venv/bin/python -m pytest

Licensing and credits

Star Nav is a mixed-license repository. The planning and control stack builds on EGO-Planner and Fast-Planner (GPLv3), so the combined code is distributed under GPLv3, with per-package licenses preserved. The MuJoCo simulator and bridge are original MIT code; MuJoCo itself is Apache-2.0, and the live scene uses its WebAssembly build and three.js (MIT). Details in docs/LICENSES.md.