Skip to content

Renderer add recording / video export #25#71

Open
alislaiman496 wants to merge 11 commits into
rp-itmo:masterfrom
alislaiman496:Renderer-Add-Recording-/-Video-Export_#25
Open

Renderer add recording / video export #25#71
alislaiman496 wants to merge 11 commits into
rp-itmo:masterfrom
alislaiman496:Renderer-Add-Recording-/-Video-Export_#25

Conversation

@alislaiman496

Copy link
Copy Markdown
Collaborator

Add Video Recording Capability to Robot Simulator

Summary

This PR adds the ability to record robot simulations as video files (MP4/AVI) using OpenCV.

Changes

New Files

  • src/simulator/video_recorder.py - OpenCV-based video recording class
  • src/simulator/spatial/__init__.py - Package initialization for relative imports

Modified Files

  • src/simulator/renderer.py - Integrated frame capture and recording
  • src/simulator/main.py - Added CLI arguments for recording control
  • src/simulator/world.py - Simplified recording setup
  • src/simulator/dynamics/ab_algorithm.py - Fixed scalar extraction bug
  • pyproject.toml - Added opencv-python dependency

Fixed Bugs

  • Fixed TypeError: setting an array element with a sequence in ABA dynamics
  • Fixed ModuleNotFoundError by using relative imports within package

Why OpenCV?

For robotics + AI projects, OpenCV is preferred over alternatives because:

  • Industry standard for computer vision
  • Real-time camera feed support
  • ML/AI integration capability
  • Object detection (YOLO, Haar cascades)
  • Image processing pipelines

Usage

# Record simulation to MP4
python src/simulator/main.py --record robot_demo.mp4 --steps 200 --fps 15

# Record with a different robot
python src/simulator/main.py --robot tree7 --record tree7_sim.mp4

# Auto-saves to recording_simulation/ folder
python src/simulator/main.py --record my_video.mp4

Comment thread src/simulator/dynamics/ab_algorithm.py
@kirillin kirillin self-requested a review June 20, 2026 18:31
@kirillin kirillin added the done label Jun 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants