Package symbol

mono_depth_viewer package from mono_depth_viewer repo

mono_depth_viewer

ROS Distro
humble

Package Summary

Version 0.2.0
License Apache-2.0
Build type AMENT_PYTHON
Use RECOMMENDED

Repository Summary

Description
Checkout URI https://github.com/divagarn/mono_depth_ros2.git
VCS Type git
VCS Version main
Last Updated 2026-11-07
Dev Status DEVELOPED
Released RELEASED
Contributing Help Wanted (-)
Good First Issues (-)
Pull Requests to Review (-)

Package Description

Qt viewer that runs transformer-based monocular depth estimation on image topics stored in ROS 2 bags.

Additional Links

Maintainers

  • Divagar

Authors

No additional authors.

mono_depth_viewer

Qt viewer for monocular depth estimation on image topics recorded in ROS 2 bags (sqlite3 .db3). Runs transformer models (Depth Anything V1, DPT-Hybrid MiDaS) from Hugging Face and shows the camera image next to a colourised depth map.

Install (ROS 2 Humble)

mkdir -p ~/ros2_ws/src && cd ~/ros2_ws/src
git clone https://github.com/divagarn/mono_depth_ros2.git mono_depth_viewer
cd ~/ros2_ws
rosdep install --from-paths src --ignore-src -y
pip install transformers==4.40.2           # plus torch/torchvision; see requirements.txt
colcon build --symlink-install --packages-select mono_depth_viewer
source install/setup.bash

If you keep torch/transformers in a virtualenv (created with --system-site-packages) instead of the system Python, tell the launch file which interpreter to use, once per shell or per launch:

export MONO_DEPTH_PYTHON=~/venvs/depth/bin/python        # or:  ... viewer.launch.py python:=~/venvs/depth/bin/python

Run with ros2 launch

# live, headless: subscribe to the camera topic, publish /mono_depth/points
ros2 launch mono_depth_viewer viewer.launch.py auto_level:=true hfov:=100
# without a camera, play a bag in another terminal:  ros2 bag play <bag> --topics /camera/image_raw --loop

# debug GUI with a bag file
ros2 launch mono_depth_viewer viewer.launch.py debug:=true bag:=/path/to/bag pointcloud:=true auto_level:=true play:=true

Launch arguments (all optional; ros2 launch mono_depth_viewer viewer.launch.py --show-args lists them): python, debug, bag, play, pointcloud, image_topic, model, input_size, pc_topic, pc_frame, pc_axes, pc_stamp, pc_stride, hfov, near, far, pitch, cam_height, auto_level.

Use

ros2 launch mono_depth_viewer viewer.launch.py debug:=true bag:=/path/to/bag_folder

Pick the topic (default /camera/image_raw), model, input size and colormap in the toolbar. You can play, scrub, save a frame (PNG + raw .npy) or export a side-by-side MP4. The first run downloads model weights from Hugging Face.

Point cloud output

The node has two modes:

  • Live (default, no window): subscribes to a camera topic, runs the depth model and publishes a coloured sensor_msgs/PointCloud2. Works with a real camera or with ros2 bag play.
  • --debug (GUI): opens the viewer to open a bag, play/scrub it and see the depth image. Add --pointcloud to publish clouds from the GUI as well.
# live, headless (e.g. with `ros2 bag play <bag> --topics /camera/image_raw --loop` in another terminal)
ros2 run mono_depth_viewer viewer --image-topic /camera/image_raw --auto-level --hfov 100

# debug GUI with a bag
ros2 run mono_depth_viewer viewer --debug /path/to/bag --pointcloud --auto-level --play --hfov 100

# same through launch
ros2 launch mono_depth_viewer viewer.launch.py image_topic:=/camera/image_raw auto_level:=true hfov:=100
ros2 launch mono_depth_viewer viewer.launch.py debug:=true bag:=/path/to/bag pointcloud:=true

Option Default Meaning
--debug off show the GUI instead of running headless
--image-topic /camera/image_raw live input (Image or CompressedImage)
--model small small, base, large or dpt
--input-size 364 network input short side in pixels; smaller = faster
--pointcloud off (--debug only) also publish; always on in live mode
--pc-topic /mono_depth/points topic name
--pc-axes ros ros: x forward, y left, z up (REP-103). optical: x right, y down, z forward
--pc-frame camera_link (camera_optical_frame for optical) frame_id (image = use each image’s own header frame)
--auto-level off fit the ground plane every frame, level it and put the ground at z = 0
--pitch 0 manual alternative: camera tilt-down angle in degrees
--cam-height 0 lift the cloud by this many metres (use with --pitch)
--pc-stamp image (live) / now (--debug) header stamp: the image’s own (image) or wall clock (now)
--pc-stride 4 use every Nth pixel (bigger = fewer points, faster)
--hfov 90 camera horizontal field of view in degrees (pinhole model)
--near / --far 0.5 / 20 metres assigned to the closest / farthest part of the scene
--play off (--debug) start playback as soon as the model is ready

View it in RViz with Fixed Frame = camera_link (the default --pc-frame) and a PointCloud2 display on the topic. With the default ros axes the ground is horizontal only if the camera is level; for a camera that looks down, add --auto-level (or --pitch <deg>).

The scale is an assumption. The network predicts relative depth, so --near/--far set the metric range; distances are plausible but not measured. Lens distortion is not corrected (pinhole model), so wide-angle or fisheye cameras give curved geometry. Clouds are published at the rate frames are processed (about 1 Hz on CPU); in live mode only the newest camera frame is processed, older ones are dropped.

Performance

File truncated at 100 lines see the full file

CHANGELOG

Changelog for package mono_depth_viewer

0.2.0 (2026-11-07)

  • Live mode (default): subscribe to an Image or CompressedImage topic (bag playback or a real camera) and publish a coloured sensor_msgs/PointCloud2 on /mono_depth/points. No window is opened.
  • Breaking: the Qt GUI now needs the --debug flag (viewer --debug <bag>); a bag path without --debug is an error.
  • Point cloud options: ROS (x forward, y left, z up) or optical axes, --auto-level ground fitting, manual --pitch/--cam-height, --hfov, --near/--far, --pc-stride, --pc-frame, --pc-stamp.
  • Launch file with arguments for all options; python:= / MONO_DEPTH_PYTHON selects a virtualenv interpreter.
  • Faster point cloud creation (about 127 ms to 7 ms per cloud at stride 4).
  • Clean shutdown on Ctrl+C.
  • Add PERFORMANCE.md (measured rates, tested hardware, 30 FPS requirements) and benchmarks/ scripts.
  • Contributors: Divagar

0.1.1 (2026-10-23)

  • Initial release.
  • Qt viewer that reads sensor_msgs/Image and CompressedImage topics from ROS 2 sqlite3 (.db3) bags.
  • Monocular depth estimation with transformer models (Depth Anything V1 Small/Base/Large, DPT-Hybrid MiDaS).
  • Playback, frame scrubbing, frame skipping, colormap and input size selection.
  • Save frames (PNG + raw .npy) and export side-by-side MP4 videos.
  • Contributors: Divagar

Dependant Packages

No known dependants.

Launch files

No launch files found

Messages

No message files found.

Services

No service files found

Plugins

No plugins found.

Recent questions tagged mono_depth_viewer at Robotics Stack Exchange

No version for distro jazzy showing humble. Known supported distros are highlighted in the buttons above.
Package symbol

mono_depth_viewer package from mono_depth_viewer repo

mono_depth_viewer

ROS Distro
humble

Package Summary

Version 0.2.0
License Apache-2.0
Build type AMENT_PYTHON
Use RECOMMENDED

Repository Summary

Description
Checkout URI https://github.com/divagarn/mono_depth_ros2.git
VCS Type git
VCS Version main
Last Updated 2026-11-07
Dev Status DEVELOPED
Released RELEASED
Contributing Help Wanted (-)
Good First Issues (-)
Pull Requests to Review (-)

Package Description

Qt viewer that runs transformer-based monocular depth estimation on image topics stored in ROS 2 bags.

Additional Links

Maintainers

  • Divagar

Authors

No additional authors.

mono_depth_viewer

Qt viewer for monocular depth estimation on image topics recorded in ROS 2 bags (sqlite3 .db3). Runs transformer models (Depth Anything V1, DPT-Hybrid MiDaS) from Hugging Face and shows the camera image next to a colourised depth map.

Install (ROS 2 Humble)

mkdir -p ~/ros2_ws/src && cd ~/ros2_ws/src
git clone https://github.com/divagarn/mono_depth_ros2.git mono_depth_viewer
cd ~/ros2_ws
rosdep install --from-paths src --ignore-src -y
pip install transformers==4.40.2           # plus torch/torchvision; see requirements.txt
colcon build --symlink-install --packages-select mono_depth_viewer
source install/setup.bash

If you keep torch/transformers in a virtualenv (created with --system-site-packages) instead of the system Python, tell the launch file which interpreter to use, once per shell or per launch:

export MONO_DEPTH_PYTHON=~/venvs/depth/bin/python        # or:  ... viewer.launch.py python:=~/venvs/depth/bin/python

Run with ros2 launch

# live, headless: subscribe to the camera topic, publish /mono_depth/points
ros2 launch mono_depth_viewer viewer.launch.py auto_level:=true hfov:=100
# without a camera, play a bag in another terminal:  ros2 bag play <bag> --topics /camera/image_raw --loop

# debug GUI with a bag file
ros2 launch mono_depth_viewer viewer.launch.py debug:=true bag:=/path/to/bag pointcloud:=true auto_level:=true play:=true

Launch arguments (all optional; ros2 launch mono_depth_viewer viewer.launch.py --show-args lists them): python, debug, bag, play, pointcloud, image_topic, model, input_size, pc_topic, pc_frame, pc_axes, pc_stamp, pc_stride, hfov, near, far, pitch, cam_height, auto_level.

Use

ros2 launch mono_depth_viewer viewer.launch.py debug:=true bag:=/path/to/bag_folder

Pick the topic (default /camera/image_raw), model, input size and colormap in the toolbar. You can play, scrub, save a frame (PNG + raw .npy) or export a side-by-side MP4. The first run downloads model weights from Hugging Face.

Point cloud output

The node has two modes:

  • Live (default, no window): subscribes to a camera topic, runs the depth model and publishes a coloured sensor_msgs/PointCloud2. Works with a real camera or with ros2 bag play.
  • --debug (GUI): opens the viewer to open a bag, play/scrub it and see the depth image. Add --pointcloud to publish clouds from the GUI as well.
# live, headless (e.g. with `ros2 bag play <bag> --topics /camera/image_raw --loop` in another terminal)
ros2 run mono_depth_viewer viewer --image-topic /camera/image_raw --auto-level --hfov 100

# debug GUI with a bag
ros2 run mono_depth_viewer viewer --debug /path/to/bag --pointcloud --auto-level --play --hfov 100

# same through launch
ros2 launch mono_depth_viewer viewer.launch.py image_topic:=/camera/image_raw auto_level:=true hfov:=100
ros2 launch mono_depth_viewer viewer.launch.py debug:=true bag:=/path/to/bag pointcloud:=true

Option Default Meaning
--debug off show the GUI instead of running headless
--image-topic /camera/image_raw live input (Image or CompressedImage)
--model small small, base, large or dpt
--input-size 364 network input short side in pixels; smaller = faster
--pointcloud off (--debug only) also publish; always on in live mode
--pc-topic /mono_depth/points topic name
--pc-axes ros ros: x forward, y left, z up (REP-103). optical: x right, y down, z forward
--pc-frame camera_link (camera_optical_frame for optical) frame_id (image = use each image’s own header frame)
--auto-level off fit the ground plane every frame, level it and put the ground at z = 0
--pitch 0 manual alternative: camera tilt-down angle in degrees
--cam-height 0 lift the cloud by this many metres (use with --pitch)
--pc-stamp image (live) / now (--debug) header stamp: the image’s own (image) or wall clock (now)
--pc-stride 4 use every Nth pixel (bigger = fewer points, faster)
--hfov 90 camera horizontal field of view in degrees (pinhole model)
--near / --far 0.5 / 20 metres assigned to the closest / farthest part of the scene
--play off (--debug) start playback as soon as the model is ready

View it in RViz with Fixed Frame = camera_link (the default --pc-frame) and a PointCloud2 display on the topic. With the default ros axes the ground is horizontal only if the camera is level; for a camera that looks down, add --auto-level (or --pitch <deg>).

The scale is an assumption. The network predicts relative depth, so --near/--far set the metric range; distances are plausible but not measured. Lens distortion is not corrected (pinhole model), so wide-angle or fisheye cameras give curved geometry. Clouds are published at the rate frames are processed (about 1 Hz on CPU); in live mode only the newest camera frame is processed, older ones are dropped.

Performance

File truncated at 100 lines see the full file

CHANGELOG

Changelog for package mono_depth_viewer

0.2.0 (2026-11-07)

  • Live mode (default): subscribe to an Image or CompressedImage topic (bag playback or a real camera) and publish a coloured sensor_msgs/PointCloud2 on /mono_depth/points. No window is opened.
  • Breaking: the Qt GUI now needs the --debug flag (viewer --debug <bag>); a bag path without --debug is an error.
  • Point cloud options: ROS (x forward, y left, z up) or optical axes, --auto-level ground fitting, manual --pitch/--cam-height, --hfov, --near/--far, --pc-stride, --pc-frame, --pc-stamp.
  • Launch file with arguments for all options; python:= / MONO_DEPTH_PYTHON selects a virtualenv interpreter.
  • Faster point cloud creation (about 127 ms to 7 ms per cloud at stride 4).
  • Clean shutdown on Ctrl+C.
  • Add PERFORMANCE.md (measured rates, tested hardware, 30 FPS requirements) and benchmarks/ scripts.
  • Contributors: Divagar

0.1.1 (2026-10-23)

  • Initial release.
  • Qt viewer that reads sensor_msgs/Image and CompressedImage topics from ROS 2 sqlite3 (.db3) bags.
  • Monocular depth estimation with transformer models (Depth Anything V1 Small/Base/Large, DPT-Hybrid MiDaS).
  • Playback, frame scrubbing, frame skipping, colormap and input size selection.
  • Save frames (PNG + raw .npy) and export side-by-side MP4 videos.
  • Contributors: Divagar

Dependant Packages

No known dependants.

Launch files

No launch files found

Messages

No message files found.

Services

No service files found

Plugins

No plugins found.

Recent questions tagged mono_depth_viewer at Robotics Stack Exchange

No version for distro kilted showing humble. Known supported distros are highlighted in the buttons above.
Package symbol

mono_depth_viewer package from mono_depth_viewer repo

mono_depth_viewer

ROS Distro
humble

Package Summary

Version 0.2.0
License Apache-2.0
Build type AMENT_PYTHON
Use RECOMMENDED

Repository Summary

Description
Checkout URI https://github.com/divagarn/mono_depth_ros2.git
VCS Type git
VCS Version main
Last Updated 2026-11-07
Dev Status DEVELOPED
Released RELEASED
Contributing Help Wanted (-)
Good First Issues (-)
Pull Requests to Review (-)

Package Description

Qt viewer that runs transformer-based monocular depth estimation on image topics stored in ROS 2 bags.

Additional Links

Maintainers

  • Divagar

Authors

No additional authors.

mono_depth_viewer

Qt viewer for monocular depth estimation on image topics recorded in ROS 2 bags (sqlite3 .db3). Runs transformer models (Depth Anything V1, DPT-Hybrid MiDaS) from Hugging Face and shows the camera image next to a colourised depth map.

Install (ROS 2 Humble)

mkdir -p ~/ros2_ws/src && cd ~/ros2_ws/src
git clone https://github.com/divagarn/mono_depth_ros2.git mono_depth_viewer
cd ~/ros2_ws
rosdep install --from-paths src --ignore-src -y
pip install transformers==4.40.2           # plus torch/torchvision; see requirements.txt
colcon build --symlink-install --packages-select mono_depth_viewer
source install/setup.bash

If you keep torch/transformers in a virtualenv (created with --system-site-packages) instead of the system Python, tell the launch file which interpreter to use, once per shell or per launch:

export MONO_DEPTH_PYTHON=~/venvs/depth/bin/python        # or:  ... viewer.launch.py python:=~/venvs/depth/bin/python

Run with ros2 launch

# live, headless: subscribe to the camera topic, publish /mono_depth/points
ros2 launch mono_depth_viewer viewer.launch.py auto_level:=true hfov:=100
# without a camera, play a bag in another terminal:  ros2 bag play <bag> --topics /camera/image_raw --loop

# debug GUI with a bag file
ros2 launch mono_depth_viewer viewer.launch.py debug:=true bag:=/path/to/bag pointcloud:=true auto_level:=true play:=true

Launch arguments (all optional; ros2 launch mono_depth_viewer viewer.launch.py --show-args lists them): python, debug, bag, play, pointcloud, image_topic, model, input_size, pc_topic, pc_frame, pc_axes, pc_stamp, pc_stride, hfov, near, far, pitch, cam_height, auto_level.

Use

ros2 launch mono_depth_viewer viewer.launch.py debug:=true bag:=/path/to/bag_folder

Pick the topic (default /camera/image_raw), model, input size and colormap in the toolbar. You can play, scrub, save a frame (PNG + raw .npy) or export a side-by-side MP4. The first run downloads model weights from Hugging Face.

Point cloud output

The node has two modes:

  • Live (default, no window): subscribes to a camera topic, runs the depth model and publishes a coloured sensor_msgs/PointCloud2. Works with a real camera or with ros2 bag play.
  • --debug (GUI): opens the viewer to open a bag, play/scrub it and see the depth image. Add --pointcloud to publish clouds from the GUI as well.
# live, headless (e.g. with `ros2 bag play <bag> --topics /camera/image_raw --loop` in another terminal)
ros2 run mono_depth_viewer viewer --image-topic /camera/image_raw --auto-level --hfov 100

# debug GUI with a bag
ros2 run mono_depth_viewer viewer --debug /path/to/bag --pointcloud --auto-level --play --hfov 100

# same through launch
ros2 launch mono_depth_viewer viewer.launch.py image_topic:=/camera/image_raw auto_level:=true hfov:=100
ros2 launch mono_depth_viewer viewer.launch.py debug:=true bag:=/path/to/bag pointcloud:=true

Option Default Meaning
--debug off show the GUI instead of running headless
--image-topic /camera/image_raw live input (Image or CompressedImage)
--model small small, base, large or dpt
--input-size 364 network input short side in pixels; smaller = faster
--pointcloud off (--debug only) also publish; always on in live mode
--pc-topic /mono_depth/points topic name
--pc-axes ros ros: x forward, y left, z up (REP-103). optical: x right, y down, z forward
--pc-frame camera_link (camera_optical_frame for optical) frame_id (image = use each image’s own header frame)
--auto-level off fit the ground plane every frame, level it and put the ground at z = 0
--pitch 0 manual alternative: camera tilt-down angle in degrees
--cam-height 0 lift the cloud by this many metres (use with --pitch)
--pc-stamp image (live) / now (--debug) header stamp: the image’s own (image) or wall clock (now)
--pc-stride 4 use every Nth pixel (bigger = fewer points, faster)
--hfov 90 camera horizontal field of view in degrees (pinhole model)
--near / --far 0.5 / 20 metres assigned to the closest / farthest part of the scene
--play off (--debug) start playback as soon as the model is ready

View it in RViz with Fixed Frame = camera_link (the default --pc-frame) and a PointCloud2 display on the topic. With the default ros axes the ground is horizontal only if the camera is level; for a camera that looks down, add --auto-level (or --pitch <deg>).

The scale is an assumption. The network predicts relative depth, so --near/--far set the metric range; distances are plausible but not measured. Lens distortion is not corrected (pinhole model), so wide-angle or fisheye cameras give curved geometry. Clouds are published at the rate frames are processed (about 1 Hz on CPU); in live mode only the newest camera frame is processed, older ones are dropped.

Performance

File truncated at 100 lines see the full file

CHANGELOG

Changelog for package mono_depth_viewer

0.2.0 (2026-11-07)

  • Live mode (default): subscribe to an Image or CompressedImage topic (bag playback or a real camera) and publish a coloured sensor_msgs/PointCloud2 on /mono_depth/points. No window is opened.
  • Breaking: the Qt GUI now needs the --debug flag (viewer --debug <bag>); a bag path without --debug is an error.
  • Point cloud options: ROS (x forward, y left, z up) or optical axes, --auto-level ground fitting, manual --pitch/--cam-height, --hfov, --near/--far, --pc-stride, --pc-frame, --pc-stamp.
  • Launch file with arguments for all options; python:= / MONO_DEPTH_PYTHON selects a virtualenv interpreter.
  • Faster point cloud creation (about 127 ms to 7 ms per cloud at stride 4).
  • Clean shutdown on Ctrl+C.
  • Add PERFORMANCE.md (measured rates, tested hardware, 30 FPS requirements) and benchmarks/ scripts.
  • Contributors: Divagar

0.1.1 (2026-10-23)

  • Initial release.
  • Qt viewer that reads sensor_msgs/Image and CompressedImage topics from ROS 2 sqlite3 (.db3) bags.
  • Monocular depth estimation with transformer models (Depth Anything V1 Small/Base/Large, DPT-Hybrid MiDaS).
  • Playback, frame scrubbing, frame skipping, colormap and input size selection.
  • Save frames (PNG + raw .npy) and export side-by-side MP4 videos.
  • Contributors: Divagar

Dependant Packages

No known dependants.

Launch files

No launch files found

Messages

No message files found.

Services

No service files found

Plugins

No plugins found.

Recent questions tagged mono_depth_viewer at Robotics Stack Exchange

No version for distro lyrical showing humble. Known supported distros are highlighted in the buttons above.
Package symbol

mono_depth_viewer package from mono_depth_viewer repo

mono_depth_viewer

ROS Distro
humble

Package Summary

Version 0.2.0
License Apache-2.0
Build type AMENT_PYTHON
Use RECOMMENDED

Repository Summary

Description
Checkout URI https://github.com/divagarn/mono_depth_ros2.git
VCS Type git
VCS Version main
Last Updated 2026-11-07
Dev Status DEVELOPED
Released RELEASED
Contributing Help Wanted (-)
Good First Issues (-)
Pull Requests to Review (-)

Package Description

Qt viewer that runs transformer-based monocular depth estimation on image topics stored in ROS 2 bags.

Additional Links

Maintainers

  • Divagar

Authors

No additional authors.

mono_depth_viewer

Qt viewer for monocular depth estimation on image topics recorded in ROS 2 bags (sqlite3 .db3). Runs transformer models (Depth Anything V1, DPT-Hybrid MiDaS) from Hugging Face and shows the camera image next to a colourised depth map.

Install (ROS 2 Humble)

mkdir -p ~/ros2_ws/src && cd ~/ros2_ws/src
git clone https://github.com/divagarn/mono_depth_ros2.git mono_depth_viewer
cd ~/ros2_ws
rosdep install --from-paths src --ignore-src -y
pip install transformers==4.40.2           # plus torch/torchvision; see requirements.txt
colcon build --symlink-install --packages-select mono_depth_viewer
source install/setup.bash

If you keep torch/transformers in a virtualenv (created with --system-site-packages) instead of the system Python, tell the launch file which interpreter to use, once per shell or per launch:

export MONO_DEPTH_PYTHON=~/venvs/depth/bin/python        # or:  ... viewer.launch.py python:=~/venvs/depth/bin/python

Run with ros2 launch

# live, headless: subscribe to the camera topic, publish /mono_depth/points
ros2 launch mono_depth_viewer viewer.launch.py auto_level:=true hfov:=100
# without a camera, play a bag in another terminal:  ros2 bag play <bag> --topics /camera/image_raw --loop

# debug GUI with a bag file
ros2 launch mono_depth_viewer viewer.launch.py debug:=true bag:=/path/to/bag pointcloud:=true auto_level:=true play:=true

Launch arguments (all optional; ros2 launch mono_depth_viewer viewer.launch.py --show-args lists them): python, debug, bag, play, pointcloud, image_topic, model, input_size, pc_topic, pc_frame, pc_axes, pc_stamp, pc_stride, hfov, near, far, pitch, cam_height, auto_level.

Use

ros2 launch mono_depth_viewer viewer.launch.py debug:=true bag:=/path/to/bag_folder

Pick the topic (default /camera/image_raw), model, input size and colormap in the toolbar. You can play, scrub, save a frame (PNG + raw .npy) or export a side-by-side MP4. The first run downloads model weights from Hugging Face.

Point cloud output

The node has two modes:

  • Live (default, no window): subscribes to a camera topic, runs the depth model and publishes a coloured sensor_msgs/PointCloud2. Works with a real camera or with ros2 bag play.
  • --debug (GUI): opens the viewer to open a bag, play/scrub it and see the depth image. Add --pointcloud to publish clouds from the GUI as well.
# live, headless (e.g. with `ros2 bag play <bag> --topics /camera/image_raw --loop` in another terminal)
ros2 run mono_depth_viewer viewer --image-topic /camera/image_raw --auto-level --hfov 100

# debug GUI with a bag
ros2 run mono_depth_viewer viewer --debug /path/to/bag --pointcloud --auto-level --play --hfov 100

# same through launch
ros2 launch mono_depth_viewer viewer.launch.py image_topic:=/camera/image_raw auto_level:=true hfov:=100
ros2 launch mono_depth_viewer viewer.launch.py debug:=true bag:=/path/to/bag pointcloud:=true

Option Default Meaning
--debug off show the GUI instead of running headless
--image-topic /camera/image_raw live input (Image or CompressedImage)
--model small small, base, large or dpt
--input-size 364 network input short side in pixels; smaller = faster
--pointcloud off (--debug only) also publish; always on in live mode
--pc-topic /mono_depth/points topic name
--pc-axes ros ros: x forward, y left, z up (REP-103). optical: x right, y down, z forward
--pc-frame camera_link (camera_optical_frame for optical) frame_id (image = use each image’s own header frame)
--auto-level off fit the ground plane every frame, level it and put the ground at z = 0
--pitch 0 manual alternative: camera tilt-down angle in degrees
--cam-height 0 lift the cloud by this many metres (use with --pitch)
--pc-stamp image (live) / now (--debug) header stamp: the image’s own (image) or wall clock (now)
--pc-stride 4 use every Nth pixel (bigger = fewer points, faster)
--hfov 90 camera horizontal field of view in degrees (pinhole model)
--near / --far 0.5 / 20 metres assigned to the closest / farthest part of the scene
--play off (--debug) start playback as soon as the model is ready

View it in RViz with Fixed Frame = camera_link (the default --pc-frame) and a PointCloud2 display on the topic. With the default ros axes the ground is horizontal only if the camera is level; for a camera that looks down, add --auto-level (or --pitch <deg>).

The scale is an assumption. The network predicts relative depth, so --near/--far set the metric range; distances are plausible but not measured. Lens distortion is not corrected (pinhole model), so wide-angle or fisheye cameras give curved geometry. Clouds are published at the rate frames are processed (about 1 Hz on CPU); in live mode only the newest camera frame is processed, older ones are dropped.

Performance

File truncated at 100 lines see the full file

CHANGELOG

Changelog for package mono_depth_viewer

0.2.0 (2026-11-07)

  • Live mode (default): subscribe to an Image or CompressedImage topic (bag playback or a real camera) and publish a coloured sensor_msgs/PointCloud2 on /mono_depth/points. No window is opened.
  • Breaking: the Qt GUI now needs the --debug flag (viewer --debug <bag>); a bag path without --debug is an error.
  • Point cloud options: ROS (x forward, y left, z up) or optical axes, --auto-level ground fitting, manual --pitch/--cam-height, --hfov, --near/--far, --pc-stride, --pc-frame, --pc-stamp.
  • Launch file with arguments for all options; python:= / MONO_DEPTH_PYTHON selects a virtualenv interpreter.
  • Faster point cloud creation (about 127 ms to 7 ms per cloud at stride 4).
  • Clean shutdown on Ctrl+C.
  • Add PERFORMANCE.md (measured rates, tested hardware, 30 FPS requirements) and benchmarks/ scripts.
  • Contributors: Divagar

0.1.1 (2026-10-23)

  • Initial release.
  • Qt viewer that reads sensor_msgs/Image and CompressedImage topics from ROS 2 sqlite3 (.db3) bags.
  • Monocular depth estimation with transformer models (Depth Anything V1 Small/Base/Large, DPT-Hybrid MiDaS).
  • Playback, frame scrubbing, frame skipping, colormap and input size selection.
  • Save frames (PNG + raw .npy) and export side-by-side MP4 videos.
  • Contributors: Divagar

Dependant Packages

No known dependants.

Launch files

No launch files found

Messages

No message files found.

Services

No service files found

Plugins

No plugins found.

Recent questions tagged mono_depth_viewer at Robotics Stack Exchange

No version for distro rolling showing humble. Known supported distros are highlighted in the buttons above.
Package symbol

mono_depth_viewer package from mono_depth_viewer repo

mono_depth_viewer

ROS Distro
humble

Package Summary

Version 0.2.0
License Apache-2.0
Build type AMENT_PYTHON
Use RECOMMENDED

Repository Summary

Description
Checkout URI https://github.com/divagarn/mono_depth_ros2.git
VCS Type git
VCS Version main
Last Updated 2026-11-07
Dev Status DEVELOPED
Released RELEASED
Contributing Help Wanted (-)
Good First Issues (-)
Pull Requests to Review (-)

Package Description

Qt viewer that runs transformer-based monocular depth estimation on image topics stored in ROS 2 bags.

Additional Links

Maintainers

  • Divagar

Authors

No additional authors.

mono_depth_viewer

Qt viewer for monocular depth estimation on image topics recorded in ROS 2 bags (sqlite3 .db3). Runs transformer models (Depth Anything V1, DPT-Hybrid MiDaS) from Hugging Face and shows the camera image next to a colourised depth map.

Install (ROS 2 Humble)

mkdir -p ~/ros2_ws/src && cd ~/ros2_ws/src
git clone https://github.com/divagarn/mono_depth_ros2.git mono_depth_viewer
cd ~/ros2_ws
rosdep install --from-paths src --ignore-src -y
pip install transformers==4.40.2           # plus torch/torchvision; see requirements.txt
colcon build --symlink-install --packages-select mono_depth_viewer
source install/setup.bash

If you keep torch/transformers in a virtualenv (created with --system-site-packages) instead of the system Python, tell the launch file which interpreter to use, once per shell or per launch:

export MONO_DEPTH_PYTHON=~/venvs/depth/bin/python        # or:  ... viewer.launch.py python:=~/venvs/depth/bin/python

Run with ros2 launch

# live, headless: subscribe to the camera topic, publish /mono_depth/points
ros2 launch mono_depth_viewer viewer.launch.py auto_level:=true hfov:=100
# without a camera, play a bag in another terminal:  ros2 bag play <bag> --topics /camera/image_raw --loop

# debug GUI with a bag file
ros2 launch mono_depth_viewer viewer.launch.py debug:=true bag:=/path/to/bag pointcloud:=true auto_level:=true play:=true

Launch arguments (all optional; ros2 launch mono_depth_viewer viewer.launch.py --show-args lists them): python, debug, bag, play, pointcloud, image_topic, model, input_size, pc_topic, pc_frame, pc_axes, pc_stamp, pc_stride, hfov, near, far, pitch, cam_height, auto_level.

Use

ros2 launch mono_depth_viewer viewer.launch.py debug:=true bag:=/path/to/bag_folder

Pick the topic (default /camera/image_raw), model, input size and colormap in the toolbar. You can play, scrub, save a frame (PNG + raw .npy) or export a side-by-side MP4. The first run downloads model weights from Hugging Face.

Point cloud output

The node has two modes:

  • Live (default, no window): subscribes to a camera topic, runs the depth model and publishes a coloured sensor_msgs/PointCloud2. Works with a real camera or with ros2 bag play.
  • --debug (GUI): opens the viewer to open a bag, play/scrub it and see the depth image. Add --pointcloud to publish clouds from the GUI as well.
# live, headless (e.g. with `ros2 bag play <bag> --topics /camera/image_raw --loop` in another terminal)
ros2 run mono_depth_viewer viewer --image-topic /camera/image_raw --auto-level --hfov 100

# debug GUI with a bag
ros2 run mono_depth_viewer viewer --debug /path/to/bag --pointcloud --auto-level --play --hfov 100

# same through launch
ros2 launch mono_depth_viewer viewer.launch.py image_topic:=/camera/image_raw auto_level:=true hfov:=100
ros2 launch mono_depth_viewer viewer.launch.py debug:=true bag:=/path/to/bag pointcloud:=true

Option Default Meaning
--debug off show the GUI instead of running headless
--image-topic /camera/image_raw live input (Image or CompressedImage)
--model small small, base, large or dpt
--input-size 364 network input short side in pixels; smaller = faster
--pointcloud off (--debug only) also publish; always on in live mode
--pc-topic /mono_depth/points topic name
--pc-axes ros ros: x forward, y left, z up (REP-103). optical: x right, y down, z forward
--pc-frame camera_link (camera_optical_frame for optical) frame_id (image = use each image’s own header frame)
--auto-level off fit the ground plane every frame, level it and put the ground at z = 0
--pitch 0 manual alternative: camera tilt-down angle in degrees
--cam-height 0 lift the cloud by this many metres (use with --pitch)
--pc-stamp image (live) / now (--debug) header stamp: the image’s own (image) or wall clock (now)
--pc-stride 4 use every Nth pixel (bigger = fewer points, faster)
--hfov 90 camera horizontal field of view in degrees (pinhole model)
--near / --far 0.5 / 20 metres assigned to the closest / farthest part of the scene
--play off (--debug) start playback as soon as the model is ready

View it in RViz with Fixed Frame = camera_link (the default --pc-frame) and a PointCloud2 display on the topic. With the default ros axes the ground is horizontal only if the camera is level; for a camera that looks down, add --auto-level (or --pitch <deg>).

The scale is an assumption. The network predicts relative depth, so --near/--far set the metric range; distances are plausible but not measured. Lens distortion is not corrected (pinhole model), so wide-angle or fisheye cameras give curved geometry. Clouds are published at the rate frames are processed (about 1 Hz on CPU); in live mode only the newest camera frame is processed, older ones are dropped.

Performance

File truncated at 100 lines see the full file

CHANGELOG

Changelog for package mono_depth_viewer

0.2.0 (2026-11-07)

  • Live mode (default): subscribe to an Image or CompressedImage topic (bag playback or a real camera) and publish a coloured sensor_msgs/PointCloud2 on /mono_depth/points. No window is opened.
  • Breaking: the Qt GUI now needs the --debug flag (viewer --debug <bag>); a bag path without --debug is an error.
  • Point cloud options: ROS (x forward, y left, z up) or optical axes, --auto-level ground fitting, manual --pitch/--cam-height, --hfov, --near/--far, --pc-stride, --pc-frame, --pc-stamp.
  • Launch file with arguments for all options; python:= / MONO_DEPTH_PYTHON selects a virtualenv interpreter.
  • Faster point cloud creation (about 127 ms to 7 ms per cloud at stride 4).
  • Clean shutdown on Ctrl+C.
  • Add PERFORMANCE.md (measured rates, tested hardware, 30 FPS requirements) and benchmarks/ scripts.
  • Contributors: Divagar

0.1.1 (2026-10-23)

  • Initial release.
  • Qt viewer that reads sensor_msgs/Image and CompressedImage topics from ROS 2 sqlite3 (.db3) bags.
  • Monocular depth estimation with transformer models (Depth Anything V1 Small/Base/Large, DPT-Hybrid MiDaS).
  • Playback, frame scrubbing, frame skipping, colormap and input size selection.
  • Save frames (PNG + raw .npy) and export side-by-side MP4 videos.
  • Contributors: Divagar

Dependant Packages

No known dependants.

Launch files

No launch files found

Messages

No message files found.

Services

No service files found

Plugins

No plugins found.

Recent questions tagged mono_depth_viewer at Robotics Stack Exchange

No version for distro github showing humble. Known supported distros are highlighted in the buttons above.
Package symbol

mono_depth_viewer package from mono_depth_viewer repo

mono_depth_viewer

ROS Distro
humble

Package Summary

Version 0.2.0
License Apache-2.0
Build type AMENT_PYTHON
Use RECOMMENDED

Repository Summary

Description
Checkout URI https://github.com/divagarn/mono_depth_ros2.git
VCS Type git
VCS Version main
Last Updated 2026-11-07
Dev Status DEVELOPED
Released RELEASED
Contributing Help Wanted (-)
Good First Issues (-)
Pull Requests to Review (-)

Package Description

Qt viewer that runs transformer-based monocular depth estimation on image topics stored in ROS 2 bags.

Additional Links

Maintainers

  • Divagar

Authors

No additional authors.

mono_depth_viewer

Qt viewer for monocular depth estimation on image topics recorded in ROS 2 bags (sqlite3 .db3). Runs transformer models (Depth Anything V1, DPT-Hybrid MiDaS) from Hugging Face and shows the camera image next to a colourised depth map.

Install (ROS 2 Humble)

mkdir -p ~/ros2_ws/src && cd ~/ros2_ws/src
git clone https://github.com/divagarn/mono_depth_ros2.git mono_depth_viewer
cd ~/ros2_ws
rosdep install --from-paths src --ignore-src -y
pip install transformers==4.40.2           # plus torch/torchvision; see requirements.txt
colcon build --symlink-install --packages-select mono_depth_viewer
source install/setup.bash

If you keep torch/transformers in a virtualenv (created with --system-site-packages) instead of the system Python, tell the launch file which interpreter to use, once per shell or per launch:

export MONO_DEPTH_PYTHON=~/venvs/depth/bin/python        # or:  ... viewer.launch.py python:=~/venvs/depth/bin/python

Run with ros2 launch

# live, headless: subscribe to the camera topic, publish /mono_depth/points
ros2 launch mono_depth_viewer viewer.launch.py auto_level:=true hfov:=100
# without a camera, play a bag in another terminal:  ros2 bag play <bag> --topics /camera/image_raw --loop

# debug GUI with a bag file
ros2 launch mono_depth_viewer viewer.launch.py debug:=true bag:=/path/to/bag pointcloud:=true auto_level:=true play:=true

Launch arguments (all optional; ros2 launch mono_depth_viewer viewer.launch.py --show-args lists them): python, debug, bag, play, pointcloud, image_topic, model, input_size, pc_topic, pc_frame, pc_axes, pc_stamp, pc_stride, hfov, near, far, pitch, cam_height, auto_level.

Use

ros2 launch mono_depth_viewer viewer.launch.py debug:=true bag:=/path/to/bag_folder

Pick the topic (default /camera/image_raw), model, input size and colormap in the toolbar. You can play, scrub, save a frame (PNG + raw .npy) or export a side-by-side MP4. The first run downloads model weights from Hugging Face.

Point cloud output

The node has two modes:

  • Live (default, no window): subscribes to a camera topic, runs the depth model and publishes a coloured sensor_msgs/PointCloud2. Works with a real camera or with ros2 bag play.
  • --debug (GUI): opens the viewer to open a bag, play/scrub it and see the depth image. Add --pointcloud to publish clouds from the GUI as well.
# live, headless (e.g. with `ros2 bag play <bag> --topics /camera/image_raw --loop` in another terminal)
ros2 run mono_depth_viewer viewer --image-topic /camera/image_raw --auto-level --hfov 100

# debug GUI with a bag
ros2 run mono_depth_viewer viewer --debug /path/to/bag --pointcloud --auto-level --play --hfov 100

# same through launch
ros2 launch mono_depth_viewer viewer.launch.py image_topic:=/camera/image_raw auto_level:=true hfov:=100
ros2 launch mono_depth_viewer viewer.launch.py debug:=true bag:=/path/to/bag pointcloud:=true

Option Default Meaning
--debug off show the GUI instead of running headless
--image-topic /camera/image_raw live input (Image or CompressedImage)
--model small small, base, large or dpt
--input-size 364 network input short side in pixels; smaller = faster
--pointcloud off (--debug only) also publish; always on in live mode
--pc-topic /mono_depth/points topic name
--pc-axes ros ros: x forward, y left, z up (REP-103). optical: x right, y down, z forward
--pc-frame camera_link (camera_optical_frame for optical) frame_id (image = use each image’s own header frame)
--auto-level off fit the ground plane every frame, level it and put the ground at z = 0
--pitch 0 manual alternative: camera tilt-down angle in degrees
--cam-height 0 lift the cloud by this many metres (use with --pitch)
--pc-stamp image (live) / now (--debug) header stamp: the image’s own (image) or wall clock (now)
--pc-stride 4 use every Nth pixel (bigger = fewer points, faster)
--hfov 90 camera horizontal field of view in degrees (pinhole model)
--near / --far 0.5 / 20 metres assigned to the closest / farthest part of the scene
--play off (--debug) start playback as soon as the model is ready

View it in RViz with Fixed Frame = camera_link (the default --pc-frame) and a PointCloud2 display on the topic. With the default ros axes the ground is horizontal only if the camera is level; for a camera that looks down, add --auto-level (or --pitch <deg>).

The scale is an assumption. The network predicts relative depth, so --near/--far set the metric range; distances are plausible but not measured. Lens distortion is not corrected (pinhole model), so wide-angle or fisheye cameras give curved geometry. Clouds are published at the rate frames are processed (about 1 Hz on CPU); in live mode only the newest camera frame is processed, older ones are dropped.

Performance

File truncated at 100 lines see the full file

CHANGELOG

Changelog for package mono_depth_viewer

0.2.0 (2026-11-07)

  • Live mode (default): subscribe to an Image or CompressedImage topic (bag playback or a real camera) and publish a coloured sensor_msgs/PointCloud2 on /mono_depth/points. No window is opened.
  • Breaking: the Qt GUI now needs the --debug flag (viewer --debug <bag>); a bag path without --debug is an error.
  • Point cloud options: ROS (x forward, y left, z up) or optical axes, --auto-level ground fitting, manual --pitch/--cam-height, --hfov, --near/--far, --pc-stride, --pc-frame, --pc-stamp.
  • Launch file with arguments for all options; python:= / MONO_DEPTH_PYTHON selects a virtualenv interpreter.
  • Faster point cloud creation (about 127 ms to 7 ms per cloud at stride 4).
  • Clean shutdown on Ctrl+C.
  • Add PERFORMANCE.md (measured rates, tested hardware, 30 FPS requirements) and benchmarks/ scripts.
  • Contributors: Divagar

0.1.1 (2026-10-23)

  • Initial release.
  • Qt viewer that reads sensor_msgs/Image and CompressedImage topics from ROS 2 sqlite3 (.db3) bags.
  • Monocular depth estimation with transformer models (Depth Anything V1 Small/Base/Large, DPT-Hybrid MiDaS).
  • Playback, frame scrubbing, frame skipping, colormap and input size selection.
  • Save frames (PNG + raw .npy) and export side-by-side MP4 videos.
  • Contributors: Divagar

Dependant Packages

No known dependants.

Launch files

No launch files found

Messages

No message files found.

Services

No service files found

Plugins

No plugins found.

Recent questions tagged mono_depth_viewer at Robotics Stack Exchange

No version for distro galactic showing humble. Known supported distros are highlighted in the buttons above.
Package symbol

mono_depth_viewer package from mono_depth_viewer repo

mono_depth_viewer

ROS Distro
humble

Package Summary

Version 0.2.0
License Apache-2.0
Build type AMENT_PYTHON
Use RECOMMENDED

Repository Summary

Description
Checkout URI https://github.com/divagarn/mono_depth_ros2.git
VCS Type git
VCS Version main
Last Updated 2026-11-07
Dev Status DEVELOPED
Released RELEASED
Contributing Help Wanted (-)
Good First Issues (-)
Pull Requests to Review (-)

Package Description

Qt viewer that runs transformer-based monocular depth estimation on image topics stored in ROS 2 bags.

Additional Links

Maintainers

  • Divagar

Authors

No additional authors.

mono_depth_viewer

Qt viewer for monocular depth estimation on image topics recorded in ROS 2 bags (sqlite3 .db3). Runs transformer models (Depth Anything V1, DPT-Hybrid MiDaS) from Hugging Face and shows the camera image next to a colourised depth map.

Install (ROS 2 Humble)

mkdir -p ~/ros2_ws/src && cd ~/ros2_ws/src
git clone https://github.com/divagarn/mono_depth_ros2.git mono_depth_viewer
cd ~/ros2_ws
rosdep install --from-paths src --ignore-src -y
pip install transformers==4.40.2           # plus torch/torchvision; see requirements.txt
colcon build --symlink-install --packages-select mono_depth_viewer
source install/setup.bash

If you keep torch/transformers in a virtualenv (created with --system-site-packages) instead of the system Python, tell the launch file which interpreter to use, once per shell or per launch:

export MONO_DEPTH_PYTHON=~/venvs/depth/bin/python        # or:  ... viewer.launch.py python:=~/venvs/depth/bin/python

Run with ros2 launch

# live, headless: subscribe to the camera topic, publish /mono_depth/points
ros2 launch mono_depth_viewer viewer.launch.py auto_level:=true hfov:=100
# without a camera, play a bag in another terminal:  ros2 bag play <bag> --topics /camera/image_raw --loop

# debug GUI with a bag file
ros2 launch mono_depth_viewer viewer.launch.py debug:=true bag:=/path/to/bag pointcloud:=true auto_level:=true play:=true

Launch arguments (all optional; ros2 launch mono_depth_viewer viewer.launch.py --show-args lists them): python, debug, bag, play, pointcloud, image_topic, model, input_size, pc_topic, pc_frame, pc_axes, pc_stamp, pc_stride, hfov, near, far, pitch, cam_height, auto_level.

Use

ros2 launch mono_depth_viewer viewer.launch.py debug:=true bag:=/path/to/bag_folder

Pick the topic (default /camera/image_raw), model, input size and colormap in the toolbar. You can play, scrub, save a frame (PNG + raw .npy) or export a side-by-side MP4. The first run downloads model weights from Hugging Face.

Point cloud output

The node has two modes:

  • Live (default, no window): subscribes to a camera topic, runs the depth model and publishes a coloured sensor_msgs/PointCloud2. Works with a real camera or with ros2 bag play.
  • --debug (GUI): opens the viewer to open a bag, play/scrub it and see the depth image. Add --pointcloud to publish clouds from the GUI as well.
# live, headless (e.g. with `ros2 bag play <bag> --topics /camera/image_raw --loop` in another terminal)
ros2 run mono_depth_viewer viewer --image-topic /camera/image_raw --auto-level --hfov 100

# debug GUI with a bag
ros2 run mono_depth_viewer viewer --debug /path/to/bag --pointcloud --auto-level --play --hfov 100

# same through launch
ros2 launch mono_depth_viewer viewer.launch.py image_topic:=/camera/image_raw auto_level:=true hfov:=100
ros2 launch mono_depth_viewer viewer.launch.py debug:=true bag:=/path/to/bag pointcloud:=true

Option Default Meaning
--debug off show the GUI instead of running headless
--image-topic /camera/image_raw live input (Image or CompressedImage)
--model small small, base, large or dpt
--input-size 364 network input short side in pixels; smaller = faster
--pointcloud off (--debug only) also publish; always on in live mode
--pc-topic /mono_depth/points topic name
--pc-axes ros ros: x forward, y left, z up (REP-103). optical: x right, y down, z forward
--pc-frame camera_link (camera_optical_frame for optical) frame_id (image = use each image’s own header frame)
--auto-level off fit the ground plane every frame, level it and put the ground at z = 0
--pitch 0 manual alternative: camera tilt-down angle in degrees
--cam-height 0 lift the cloud by this many metres (use with --pitch)
--pc-stamp image (live) / now (--debug) header stamp: the image’s own (image) or wall clock (now)
--pc-stride 4 use every Nth pixel (bigger = fewer points, faster)
--hfov 90 camera horizontal field of view in degrees (pinhole model)
--near / --far 0.5 / 20 metres assigned to the closest / farthest part of the scene
--play off (--debug) start playback as soon as the model is ready

View it in RViz with Fixed Frame = camera_link (the default --pc-frame) and a PointCloud2 display on the topic. With the default ros axes the ground is horizontal only if the camera is level; for a camera that looks down, add --auto-level (or --pitch <deg>).

The scale is an assumption. The network predicts relative depth, so --near/--far set the metric range; distances are plausible but not measured. Lens distortion is not corrected (pinhole model), so wide-angle or fisheye cameras give curved geometry. Clouds are published at the rate frames are processed (about 1 Hz on CPU); in live mode only the newest camera frame is processed, older ones are dropped.

Performance

File truncated at 100 lines see the full file

CHANGELOG

Changelog for package mono_depth_viewer

0.2.0 (2026-11-07)

  • Live mode (default): subscribe to an Image or CompressedImage topic (bag playback or a real camera) and publish a coloured sensor_msgs/PointCloud2 on /mono_depth/points. No window is opened.
  • Breaking: the Qt GUI now needs the --debug flag (viewer --debug <bag>); a bag path without --debug is an error.
  • Point cloud options: ROS (x forward, y left, z up) or optical axes, --auto-level ground fitting, manual --pitch/--cam-height, --hfov, --near/--far, --pc-stride, --pc-frame, --pc-stamp.
  • Launch file with arguments for all options; python:= / MONO_DEPTH_PYTHON selects a virtualenv interpreter.
  • Faster point cloud creation (about 127 ms to 7 ms per cloud at stride 4).
  • Clean shutdown on Ctrl+C.
  • Add PERFORMANCE.md (measured rates, tested hardware, 30 FPS requirements) and benchmarks/ scripts.
  • Contributors: Divagar

0.1.1 (2026-10-23)

  • Initial release.
  • Qt viewer that reads sensor_msgs/Image and CompressedImage topics from ROS 2 sqlite3 (.db3) bags.
  • Monocular depth estimation with transformer models (Depth Anything V1 Small/Base/Large, DPT-Hybrid MiDaS).
  • Playback, frame scrubbing, frame skipping, colormap and input size selection.
  • Save frames (PNG + raw .npy) and export side-by-side MP4 videos.
  • Contributors: Divagar

Dependant Packages

No known dependants.

Launch files

No launch files found

Messages

No message files found.

Services

No service files found

Plugins

No plugins found.

Recent questions tagged mono_depth_viewer at Robotics Stack Exchange

No version for distro iron showing humble. Known supported distros are highlighted in the buttons above.
Package symbol

mono_depth_viewer package from mono_depth_viewer repo

mono_depth_viewer

ROS Distro
humble

Package Summary

Version 0.2.0
License Apache-2.0
Build type AMENT_PYTHON
Use RECOMMENDED

Repository Summary

Description
Checkout URI https://github.com/divagarn/mono_depth_ros2.git
VCS Type git
VCS Version main
Last Updated 2026-11-07
Dev Status DEVELOPED
Released RELEASED
Contributing Help Wanted (-)
Good First Issues (-)
Pull Requests to Review (-)

Package Description

Qt viewer that runs transformer-based monocular depth estimation on image topics stored in ROS 2 bags.

Additional Links

Maintainers

  • Divagar

Authors

No additional authors.

mono_depth_viewer

Qt viewer for monocular depth estimation on image topics recorded in ROS 2 bags (sqlite3 .db3). Runs transformer models (Depth Anything V1, DPT-Hybrid MiDaS) from Hugging Face and shows the camera image next to a colourised depth map.

Install (ROS 2 Humble)

mkdir -p ~/ros2_ws/src && cd ~/ros2_ws/src
git clone https://github.com/divagarn/mono_depth_ros2.git mono_depth_viewer
cd ~/ros2_ws
rosdep install --from-paths src --ignore-src -y
pip install transformers==4.40.2           # plus torch/torchvision; see requirements.txt
colcon build --symlink-install --packages-select mono_depth_viewer
source install/setup.bash

If you keep torch/transformers in a virtualenv (created with --system-site-packages) instead of the system Python, tell the launch file which interpreter to use, once per shell or per launch:

export MONO_DEPTH_PYTHON=~/venvs/depth/bin/python        # or:  ... viewer.launch.py python:=~/venvs/depth/bin/python

Run with ros2 launch

# live, headless: subscribe to the camera topic, publish /mono_depth/points
ros2 launch mono_depth_viewer viewer.launch.py auto_level:=true hfov:=100
# without a camera, play a bag in another terminal:  ros2 bag play <bag> --topics /camera/image_raw --loop

# debug GUI with a bag file
ros2 launch mono_depth_viewer viewer.launch.py debug:=true bag:=/path/to/bag pointcloud:=true auto_level:=true play:=true

Launch arguments (all optional; ros2 launch mono_depth_viewer viewer.launch.py --show-args lists them): python, debug, bag, play, pointcloud, image_topic, model, input_size, pc_topic, pc_frame, pc_axes, pc_stamp, pc_stride, hfov, near, far, pitch, cam_height, auto_level.

Use

ros2 launch mono_depth_viewer viewer.launch.py debug:=true bag:=/path/to/bag_folder

Pick the topic (default /camera/image_raw), model, input size and colormap in the toolbar. You can play, scrub, save a frame (PNG + raw .npy) or export a side-by-side MP4. The first run downloads model weights from Hugging Face.

Point cloud output

The node has two modes:

  • Live (default, no window): subscribes to a camera topic, runs the depth model and publishes a coloured sensor_msgs/PointCloud2. Works with a real camera or with ros2 bag play.
  • --debug (GUI): opens the viewer to open a bag, play/scrub it and see the depth image. Add --pointcloud to publish clouds from the GUI as well.
# live, headless (e.g. with `ros2 bag play <bag> --topics /camera/image_raw --loop` in another terminal)
ros2 run mono_depth_viewer viewer --image-topic /camera/image_raw --auto-level --hfov 100

# debug GUI with a bag
ros2 run mono_depth_viewer viewer --debug /path/to/bag --pointcloud --auto-level --play --hfov 100

# same through launch
ros2 launch mono_depth_viewer viewer.launch.py image_topic:=/camera/image_raw auto_level:=true hfov:=100
ros2 launch mono_depth_viewer viewer.launch.py debug:=true bag:=/path/to/bag pointcloud:=true

Option Default Meaning
--debug off show the GUI instead of running headless
--image-topic /camera/image_raw live input (Image or CompressedImage)
--model small small, base, large or dpt
--input-size 364 network input short side in pixels; smaller = faster
--pointcloud off (--debug only) also publish; always on in live mode
--pc-topic /mono_depth/points topic name
--pc-axes ros ros: x forward, y left, z up (REP-103). optical: x right, y down, z forward
--pc-frame camera_link (camera_optical_frame for optical) frame_id (image = use each image’s own header frame)
--auto-level off fit the ground plane every frame, level it and put the ground at z = 0
--pitch 0 manual alternative: camera tilt-down angle in degrees
--cam-height 0 lift the cloud by this many metres (use with --pitch)
--pc-stamp image (live) / now (--debug) header stamp: the image’s own (image) or wall clock (now)
--pc-stride 4 use every Nth pixel (bigger = fewer points, faster)
--hfov 90 camera horizontal field of view in degrees (pinhole model)
--near / --far 0.5 / 20 metres assigned to the closest / farthest part of the scene
--play off (--debug) start playback as soon as the model is ready

View it in RViz with Fixed Frame = camera_link (the default --pc-frame) and a PointCloud2 display on the topic. With the default ros axes the ground is horizontal only if the camera is level; for a camera that looks down, add --auto-level (or --pitch <deg>).

The scale is an assumption. The network predicts relative depth, so --near/--far set the metric range; distances are plausible but not measured. Lens distortion is not corrected (pinhole model), so wide-angle or fisheye cameras give curved geometry. Clouds are published at the rate frames are processed (about 1 Hz on CPU); in live mode only the newest camera frame is processed, older ones are dropped.

Performance

File truncated at 100 lines see the full file

CHANGELOG

Changelog for package mono_depth_viewer

0.2.0 (2026-11-07)

  • Live mode (default): subscribe to an Image or CompressedImage topic (bag playback or a real camera) and publish a coloured sensor_msgs/PointCloud2 on /mono_depth/points. No window is opened.
  • Breaking: the Qt GUI now needs the --debug flag (viewer --debug <bag>); a bag path without --debug is an error.
  • Point cloud options: ROS (x forward, y left, z up) or optical axes, --auto-level ground fitting, manual --pitch/--cam-height, --hfov, --near/--far, --pc-stride, --pc-frame, --pc-stamp.
  • Launch file with arguments for all options; python:= / MONO_DEPTH_PYTHON selects a virtualenv interpreter.
  • Faster point cloud creation (about 127 ms to 7 ms per cloud at stride 4).
  • Clean shutdown on Ctrl+C.
  • Add PERFORMANCE.md (measured rates, tested hardware, 30 FPS requirements) and benchmarks/ scripts.
  • Contributors: Divagar

0.1.1 (2026-10-23)

  • Initial release.
  • Qt viewer that reads sensor_msgs/Image and CompressedImage topics from ROS 2 sqlite3 (.db3) bags.
  • Monocular depth estimation with transformer models (Depth Anything V1 Small/Base/Large, DPT-Hybrid MiDaS).
  • Playback, frame scrubbing, frame skipping, colormap and input size selection.
  • Save frames (PNG + raw .npy) and export side-by-side MP4 videos.
  • Contributors: Divagar

Dependant Packages

No known dependants.

Launch files

No launch files found

Messages

No message files found.

Services

No service files found

Plugins

No plugins found.

Recent questions tagged mono_depth_viewer at Robotics Stack Exchange

No version for distro melodic showing humble. Known supported distros are highlighted in the buttons above.
Package symbol

mono_depth_viewer package from mono_depth_viewer repo

mono_depth_viewer

ROS Distro
humble

Package Summary

Version 0.2.0
License Apache-2.0
Build type AMENT_PYTHON
Use RECOMMENDED

Repository Summary

Description
Checkout URI https://github.com/divagarn/mono_depth_ros2.git
VCS Type git
VCS Version main
Last Updated 2026-11-07
Dev Status DEVELOPED
Released RELEASED
Contributing Help Wanted (-)
Good First Issues (-)
Pull Requests to Review (-)

Package Description

Qt viewer that runs transformer-based monocular depth estimation on image topics stored in ROS 2 bags.

Additional Links

Maintainers

  • Divagar

Authors

No additional authors.

mono_depth_viewer

Qt viewer for monocular depth estimation on image topics recorded in ROS 2 bags (sqlite3 .db3). Runs transformer models (Depth Anything V1, DPT-Hybrid MiDaS) from Hugging Face and shows the camera image next to a colourised depth map.

Install (ROS 2 Humble)

mkdir -p ~/ros2_ws/src && cd ~/ros2_ws/src
git clone https://github.com/divagarn/mono_depth_ros2.git mono_depth_viewer
cd ~/ros2_ws
rosdep install --from-paths src --ignore-src -y
pip install transformers==4.40.2           # plus torch/torchvision; see requirements.txt
colcon build --symlink-install --packages-select mono_depth_viewer
source install/setup.bash

If you keep torch/transformers in a virtualenv (created with --system-site-packages) instead of the system Python, tell the launch file which interpreter to use, once per shell or per launch:

export MONO_DEPTH_PYTHON=~/venvs/depth/bin/python        # or:  ... viewer.launch.py python:=~/venvs/depth/bin/python

Run with ros2 launch

# live, headless: subscribe to the camera topic, publish /mono_depth/points
ros2 launch mono_depth_viewer viewer.launch.py auto_level:=true hfov:=100
# without a camera, play a bag in another terminal:  ros2 bag play <bag> --topics /camera/image_raw --loop

# debug GUI with a bag file
ros2 launch mono_depth_viewer viewer.launch.py debug:=true bag:=/path/to/bag pointcloud:=true auto_level:=true play:=true

Launch arguments (all optional; ros2 launch mono_depth_viewer viewer.launch.py --show-args lists them): python, debug, bag, play, pointcloud, image_topic, model, input_size, pc_topic, pc_frame, pc_axes, pc_stamp, pc_stride, hfov, near, far, pitch, cam_height, auto_level.

Use

ros2 launch mono_depth_viewer viewer.launch.py debug:=true bag:=/path/to/bag_folder

Pick the topic (default /camera/image_raw), model, input size and colormap in the toolbar. You can play, scrub, save a frame (PNG + raw .npy) or export a side-by-side MP4. The first run downloads model weights from Hugging Face.

Point cloud output

The node has two modes:

  • Live (default, no window): subscribes to a camera topic, runs the depth model and publishes a coloured sensor_msgs/PointCloud2. Works with a real camera or with ros2 bag play.
  • --debug (GUI): opens the viewer to open a bag, play/scrub it and see the depth image. Add --pointcloud to publish clouds from the GUI as well.
# live, headless (e.g. with `ros2 bag play <bag> --topics /camera/image_raw --loop` in another terminal)
ros2 run mono_depth_viewer viewer --image-topic /camera/image_raw --auto-level --hfov 100

# debug GUI with a bag
ros2 run mono_depth_viewer viewer --debug /path/to/bag --pointcloud --auto-level --play --hfov 100

# same through launch
ros2 launch mono_depth_viewer viewer.launch.py image_topic:=/camera/image_raw auto_level:=true hfov:=100
ros2 launch mono_depth_viewer viewer.launch.py debug:=true bag:=/path/to/bag pointcloud:=true

Option Default Meaning
--debug off show the GUI instead of running headless
--image-topic /camera/image_raw live input (Image or CompressedImage)
--model small small, base, large or dpt
--input-size 364 network input short side in pixels; smaller = faster
--pointcloud off (--debug only) also publish; always on in live mode
--pc-topic /mono_depth/points topic name
--pc-axes ros ros: x forward, y left, z up (REP-103). optical: x right, y down, z forward
--pc-frame camera_link (camera_optical_frame for optical) frame_id (image = use each image’s own header frame)
--auto-level off fit the ground plane every frame, level it and put the ground at z = 0
--pitch 0 manual alternative: camera tilt-down angle in degrees
--cam-height 0 lift the cloud by this many metres (use with --pitch)
--pc-stamp image (live) / now (--debug) header stamp: the image’s own (image) or wall clock (now)
--pc-stride 4 use every Nth pixel (bigger = fewer points, faster)
--hfov 90 camera horizontal field of view in degrees (pinhole model)
--near / --far 0.5 / 20 metres assigned to the closest / farthest part of the scene
--play off (--debug) start playback as soon as the model is ready

View it in RViz with Fixed Frame = camera_link (the default --pc-frame) and a PointCloud2 display on the topic. With the default ros axes the ground is horizontal only if the camera is level; for a camera that looks down, add --auto-level (or --pitch <deg>).

The scale is an assumption. The network predicts relative depth, so --near/--far set the metric range; distances are plausible but not measured. Lens distortion is not corrected (pinhole model), so wide-angle or fisheye cameras give curved geometry. Clouds are published at the rate frames are processed (about 1 Hz on CPU); in live mode only the newest camera frame is processed, older ones are dropped.

Performance

File truncated at 100 lines see the full file

CHANGELOG

Changelog for package mono_depth_viewer

0.2.0 (2026-11-07)

  • Live mode (default): subscribe to an Image or CompressedImage topic (bag playback or a real camera) and publish a coloured sensor_msgs/PointCloud2 on /mono_depth/points. No window is opened.
  • Breaking: the Qt GUI now needs the --debug flag (viewer --debug <bag>); a bag path without --debug is an error.
  • Point cloud options: ROS (x forward, y left, z up) or optical axes, --auto-level ground fitting, manual --pitch/--cam-height, --hfov, --near/--far, --pc-stride, --pc-frame, --pc-stamp.
  • Launch file with arguments for all options; python:= / MONO_DEPTH_PYTHON selects a virtualenv interpreter.
  • Faster point cloud creation (about 127 ms to 7 ms per cloud at stride 4).
  • Clean shutdown on Ctrl+C.
  • Add PERFORMANCE.md (measured rates, tested hardware, 30 FPS requirements) and benchmarks/ scripts.
  • Contributors: Divagar

0.1.1 (2026-10-23)

  • Initial release.
  • Qt viewer that reads sensor_msgs/Image and CompressedImage topics from ROS 2 sqlite3 (.db3) bags.
  • Monocular depth estimation with transformer models (Depth Anything V1 Small/Base/Large, DPT-Hybrid MiDaS).
  • Playback, frame scrubbing, frame skipping, colormap and input size selection.
  • Save frames (PNG + raw .npy) and export side-by-side MP4 videos.
  • Contributors: Divagar

Dependant Packages

No known dependants.

Launch files

No launch files found

Messages

No message files found.

Services

No service files found

Plugins

No plugins found.

Recent questions tagged mono_depth_viewer at Robotics Stack Exchange

No version for distro noetic showing humble. Known supported distros are highlighted in the buttons above.
Package symbol

mono_depth_viewer package from mono_depth_viewer repo

mono_depth_viewer

ROS Distro
humble

Package Summary

Version 0.2.0
License Apache-2.0
Build type AMENT_PYTHON
Use RECOMMENDED

Repository Summary

Description
Checkout URI https://github.com/divagarn/mono_depth_ros2.git
VCS Type git
VCS Version main
Last Updated 2026-11-07
Dev Status DEVELOPED
Released RELEASED
Contributing Help Wanted (-)
Good First Issues (-)
Pull Requests to Review (-)

Package Description

Qt viewer that runs transformer-based monocular depth estimation on image topics stored in ROS 2 bags.

Additional Links

Maintainers

  • Divagar

Authors

No additional authors.

mono_depth_viewer

Qt viewer for monocular depth estimation on image topics recorded in ROS 2 bags (sqlite3 .db3). Runs transformer models (Depth Anything V1, DPT-Hybrid MiDaS) from Hugging Face and shows the camera image next to a colourised depth map.

Install (ROS 2 Humble)

mkdir -p ~/ros2_ws/src && cd ~/ros2_ws/src
git clone https://github.com/divagarn/mono_depth_ros2.git mono_depth_viewer
cd ~/ros2_ws
rosdep install --from-paths src --ignore-src -y
pip install transformers==4.40.2           # plus torch/torchvision; see requirements.txt
colcon build --symlink-install --packages-select mono_depth_viewer
source install/setup.bash

If you keep torch/transformers in a virtualenv (created with --system-site-packages) instead of the system Python, tell the launch file which interpreter to use, once per shell or per launch:

export MONO_DEPTH_PYTHON=~/venvs/depth/bin/python        # or:  ... viewer.launch.py python:=~/venvs/depth/bin/python

Run with ros2 launch

# live, headless: subscribe to the camera topic, publish /mono_depth/points
ros2 launch mono_depth_viewer viewer.launch.py auto_level:=true hfov:=100
# without a camera, play a bag in another terminal:  ros2 bag play <bag> --topics /camera/image_raw --loop

# debug GUI with a bag file
ros2 launch mono_depth_viewer viewer.launch.py debug:=true bag:=/path/to/bag pointcloud:=true auto_level:=true play:=true

Launch arguments (all optional; ros2 launch mono_depth_viewer viewer.launch.py --show-args lists them): python, debug, bag, play, pointcloud, image_topic, model, input_size, pc_topic, pc_frame, pc_axes, pc_stamp, pc_stride, hfov, near, far, pitch, cam_height, auto_level.

Use

ros2 launch mono_depth_viewer viewer.launch.py debug:=true bag:=/path/to/bag_folder

Pick the topic (default /camera/image_raw), model, input size and colormap in the toolbar. You can play, scrub, save a frame (PNG + raw .npy) or export a side-by-side MP4. The first run downloads model weights from Hugging Face.

Point cloud output

The node has two modes:

  • Live (default, no window): subscribes to a camera topic, runs the depth model and publishes a coloured sensor_msgs/PointCloud2. Works with a real camera or with ros2 bag play.
  • --debug (GUI): opens the viewer to open a bag, play/scrub it and see the depth image. Add --pointcloud to publish clouds from the GUI as well.
# live, headless (e.g. with `ros2 bag play <bag> --topics /camera/image_raw --loop` in another terminal)
ros2 run mono_depth_viewer viewer --image-topic /camera/image_raw --auto-level --hfov 100

# debug GUI with a bag
ros2 run mono_depth_viewer viewer --debug /path/to/bag --pointcloud --auto-level --play --hfov 100

# same through launch
ros2 launch mono_depth_viewer viewer.launch.py image_topic:=/camera/image_raw auto_level:=true hfov:=100
ros2 launch mono_depth_viewer viewer.launch.py debug:=true bag:=/path/to/bag pointcloud:=true

Option Default Meaning
--debug off show the GUI instead of running headless
--image-topic /camera/image_raw live input (Image or CompressedImage)
--model small small, base, large or dpt
--input-size 364 network input short side in pixels; smaller = faster
--pointcloud off (--debug only) also publish; always on in live mode
--pc-topic /mono_depth/points topic name
--pc-axes ros ros: x forward, y left, z up (REP-103). optical: x right, y down, z forward
--pc-frame camera_link (camera_optical_frame for optical) frame_id (image = use each image’s own header frame)
--auto-level off fit the ground plane every frame, level it and put the ground at z = 0
--pitch 0 manual alternative: camera tilt-down angle in degrees
--cam-height 0 lift the cloud by this many metres (use with --pitch)
--pc-stamp image (live) / now (--debug) header stamp: the image’s own (image) or wall clock (now)
--pc-stride 4 use every Nth pixel (bigger = fewer points, faster)
--hfov 90 camera horizontal field of view in degrees (pinhole model)
--near / --far 0.5 / 20 metres assigned to the closest / farthest part of the scene
--play off (--debug) start playback as soon as the model is ready

View it in RViz with Fixed Frame = camera_link (the default --pc-frame) and a PointCloud2 display on the topic. With the default ros axes the ground is horizontal only if the camera is level; for a camera that looks down, add --auto-level (or --pitch <deg>).

The scale is an assumption. The network predicts relative depth, so --near/--far set the metric range; distances are plausible but not measured. Lens distortion is not corrected (pinhole model), so wide-angle or fisheye cameras give curved geometry. Clouds are published at the rate frames are processed (about 1 Hz on CPU); in live mode only the newest camera frame is processed, older ones are dropped.

Performance

File truncated at 100 lines see the full file

CHANGELOG

Changelog for package mono_depth_viewer

0.2.0 (2026-11-07)

  • Live mode (default): subscribe to an Image or CompressedImage topic (bag playback or a real camera) and publish a coloured sensor_msgs/PointCloud2 on /mono_depth/points. No window is opened.
  • Breaking: the Qt GUI now needs the --debug flag (viewer --debug <bag>); a bag path without --debug is an error.
  • Point cloud options: ROS (x forward, y left, z up) or optical axes, --auto-level ground fitting, manual --pitch/--cam-height, --hfov, --near/--far, --pc-stride, --pc-frame, --pc-stamp.
  • Launch file with arguments for all options; python:= / MONO_DEPTH_PYTHON selects a virtualenv interpreter.
  • Faster point cloud creation (about 127 ms to 7 ms per cloud at stride 4).
  • Clean shutdown on Ctrl+C.
  • Add PERFORMANCE.md (measured rates, tested hardware, 30 FPS requirements) and benchmarks/ scripts.
  • Contributors: Divagar

0.1.1 (2026-10-23)

  • Initial release.
  • Qt viewer that reads sensor_msgs/Image and CompressedImage topics from ROS 2 sqlite3 (.db3) bags.
  • Monocular depth estimation with transformer models (Depth Anything V1 Small/Base/Large, DPT-Hybrid MiDaS).
  • Playback, frame scrubbing, frame skipping, colormap and input size selection.
  • Save frames (PNG + raw .npy) and export side-by-side MP4 videos.
  • Contributors: Divagar

Dependant Packages

No known dependants.

Launch files

No launch files found

Messages

No message files found.

Services

No service files found

Plugins

No plugins found.

Recent questions tagged mono_depth_viewer at Robotics Stack Exchange