Skip to content

Renderer add recording / video export #25 - #70

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

alislaiman496 wants to merge 10 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

@alislaiman496

Copy link
Copy Markdown
Collaborator Author

need to add README.md

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants