A ROS2-based motion capture system using thermal cameras for 3D target localization through triangulation in Gazebo simulation.
Eight thermal cameras are arranged around a simulated room. Each camera runs a detector node that publishes 2D pixel coordinates of the thermal target. A triangulation node fuses all detections into a real-time 3D position estimate published on /thermal_target/position.
Two ROS2 packages:
- mocap_ir_ros2 — Gazebo simulation world with thermal cameras (C++/ament_cmake)
- thermal_3d_localization — detector nodes + triangulation + RViz visualization (Python/ament_python)
- Multi-camera triangulation using 8 thermal cameras
- Ground-plane intersection and linear least-squares triangulation methods
- Outlier filtering via reprojection error
- Static TF broadcast for all camera frames
- RViz markers for camera FOV, detection rays, and target position
- JSON-based camera calibration
- 4 corner cameras — room corners, 5 m height, looking down
- 4 wall cameras — mid-walls, 2.5 m height, side coverage
- World frame:
map(configurable) - Camera frames:
cam1…cam8 - Target frame:
thermal_target
Docker is the easiest way to run on any OS. No ROS2 install required.
Install Docker:
curl -fsSL https://get.docker.com | sh
sudo usermod -aG docker $USER
newgrp docker
sudo apt-get install -y docker-compose-plugincd Gazebo-Motion-Capture
docker build -t gazebo-mocap .xhost +local:dockerdocker compose updocker exec -it gazebo-motion-capture-gazebo_mocap-1 bash
source /opt/ros/humble/setup.bash && source /ros2_ws/install/setup.bash
ros2 launch mocap_ir_ros2 mocap_ir.launch.pydocker exec -it gazebo-motion-capture-gazebo_mocap-1 bash
source /opt/ros/humble/setup.bash && source /ros2_ws/install/setup.bash
ros2 launch thermal_3d_localization all.launch.pydocker exec -it gazebo-motion-capture-gazebo_mocap-1 bash
source /opt/ros/humble/setup.bash && source /ros2_ws/install/setup.bash
ros2 run rviz2 rviz2Add these topics in RViz:
/triangulation_markers(MarkerArray) — camera FOV and detection rays/thermal_target/position(PointStamped) — 3D target position
docker run --rm -it --network host gazebo-mocap \
ros2 run thermal_3d_localization triangulation_nodeROS2 Humble only supports Ubuntu 22.04. It will not install on any other version.
sudo apt-get install -y \
ros-humble-desktop-full \
ros-humble-ros-gz-sim ros-humble-ros-gz-bridge ros-humble-ros-gz-image \
ros-humble-tf2-ros ros-humble-tf-transformations ros-humble-message-filters \
ros-humble-cv-bridge ros-humble-ament-cmake-auto \
python3-opencv python3-numpy python3-pip python3-transforms3d
pip3 install transforms3dgit clone https://github.com/SIMETRAL55/Gazebo-Motion-Capture.git
mkdir -p ~/ros2_ws/src
cp -r Gazebo-Motion-Capture ~/ros2_ws/src/
cd ~/ros2_ws
source /opt/ros/humble/setup.bash
colcon build --symlink-install
source install/setup.bashTerminal 1 — Gazebo:
source /opt/ros/humble/setup.bash && source install/setup.bash
ros2 launch mocap_ir_ros2 mocap_ir.launch.pyTerminal 2 — Detection + triangulation:
source /opt/ros/humble/setup.bash && source install/setup.bash
ros2 launch thermal_3d_localization all.launch.py- Detection — each of 8
thermal_detector_nodeinstances processes its camera feed and publishes the target's 2D pixel location - Triangulation —
triangulation_nodecollects rays from all cameras, runs ground-plane intersection for an initial estimate, then refines with linear least-squares - Outlier removal — detections with high reprojection error are dropped before the final estimate
- Output — 3D position published to
/thermal_target/position(PointStamped); TF broadcast asmap → thermal_target