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.
--record; the same run is an automated test in CI.
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.
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.
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.
Simulator → planner
- Every 2 ms MuJoCo steps the rigid body; every 5 ms its pose and velocity go out as
state, republished asnav_msgs/Odometry. - At 30 Hz the onboard camera renders a depth image in millimetres, stamped with the optical-frame pose at the moment of capture.
- The bridge publishes the image and
camera_posewith one timestamp; EGO-Planner's grid map pairs them and ray-casts every pixel into its occupancy map. - Obstacle geometry is published once as a point cloud for RViz only; the planner does not use it.
Planner → simulator
- The exploration manager sends the next waypoint to EGO-Planner, which optimises a collision-free B-spline from the current odometry.
traj_serversamples it at 100 Hz into aPositionCommand: position, velocity, acceleration, yaw and yaw rate.- The bridge forwards it over ZeroMQ. A geometric SE(3) controller tracks it with acceleration feed-forward and turns it into four motor thrusts.
- 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.
| Depth camera | 360° lidar | |
|---|---|---|
| Field of view | 79° × 64°, forward | 360° × 45° |
| Samples | 640 × 480 at 30 Hz | 32 × 1024 at 10 Hz |
| Into the planner | image + camera pose, projected with intrinsics | world-frame point cloud |
| No return | free space up to 4.5 m | no information |
| Blind spots | everything outside the frustum | above and below the beam fan, gaps between beams |
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) | |
|---|---|---|
| Vehicle | Follows commands exactly | 1 kg quadrotor, motor lag, drag, SE(3) controller |
| Depth | Rendered from the global point cloud | Rasterised by MuJoCo (also sees the ground) |
| Collisions | Not modelled | Counted; the test fails on any contact |
| Visualisation | RViz | Browser viewer and RViz |
| Runs on | ROS Noetic (native or Docker) | Simulator: any OS with Python ≥ 3.11 or Docker Bridge + planner: ROS Noetic |
| Test | sim_smoke.test | mujoco_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.