Skip to content

Conversation

@JSenart
Copy link

@JSenart JSenart commented Mar 21, 2025

Add Basler Camera Driver

This PR adds a new driver for Basler cameras using the pypylon SDK. The driver and this message were developed using Cursor AI with guidance from the author. It supports all Basler cameras compatible with the pypylon SDK, with specific testing on the acA2000-165umNIR model.

Features

  • Full support for basic camera operations:
    • Image capture (single grab, live video, capture sequence)
    • Exposure time control with proper unit handling
    • Gain control
    • ROI configuration
    • Binning settings
  • Proper error handling and parameter validation
  • Support for multiple pixel formats (Mono8, Mono12, RGB8)

Technical Details

  • Attempted to follow Instrumental's driver development guidelines
  • Uses the @check_units decorator for exposure time to ensure proper unit handling
  • Implements proper cleanup in close() method
  • Includes detailed documentation with usage examples and troubleshooting guide

Testing

The driver includes a comprehensive test script (test_basler.py) that verifies:

  • Camera discovery and connection
  • Parameter configuration (exposure time, gain, ROI, binning)
  • Image capture in various modes
  • Error handling
  • Live video functionality

Documentation

Added detailed documentation in docs/basler.rst covering:

  • Installation requirements
  • Usage examples with proper unit handling
  • Supported parameters and pixel formats
  • Troubleshooting guide
  • Known limitations

Dependencies

  • pypylon (available via pip)
  • numpy

Notes

  • The driver has been tested with the acA2000-165umNIR model but should work with other compatible Basler cameras
  • Some advanced features (trigger modes, multiple ROI) are not yet implemented

Future Improvements

Potential future enhancements could include:

  • Support for trigger modes
  • Multiple ROI support
  • Additional pixel format support
  • More advanced camera features specific to certain models

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.

1 participant