LibCu Software Library

The LibCu C++/Java software library supports Copperforge devices including the Lasershark (Cu//2A21). Both online and offline installations are supported.

LibCu follows WPILib/FRC vendor library standards and is compatible with WPILib 2020.+

Installation

Warning

LibCu is C++/Java only, and is not available for LabVIEW

Online Installation

If your development computer is connected to the internet, you should use the online method to install the LibCu C++/Java API:

  1. Open your robot project in VSCode.

  2. Click the WPILib icon in the top right or press Ctrl+Shift+P to open the WPILib/VS Code Command Palette.

  3. Select Manage Vendor Libraries.

  4. Select Install new library (online).

  5. Enter the following installation URL and press Enter:

Offline Installation

  1. Download the latest LibCu C++/Java API from the following URL:

  2. Download and unzip the file into the C:\Users\Public\wpilib\{year}\ directory:

    C:\Users\Public\wpilib\{year}\maven

    C:\Users\Public\wpilib\{year}\vendordeps

  3. Follow the offline installation instructions on WPILib’s FRC-Docs Adding an Offline-installed Library page.

API Docs

namespace libcu
{
class Lasershark : public nt::NTSendable,
                   public wpi::SendableHelper<Lasershark>
{
public:
    /**
     * Construct a new Lasershark on a given digital input channel.
     *
     * @param channel The channel to which to attach.
     */
    explicit Lasershark(int channel);

    /**
     * Construct a new Lasershark attached to a DigitalSource object.
     *
     * @param source The digital source to which to attach.
     */
    explicit Lasershark(frc::DigitalSource &source);

    /**
     * Construct a new Lasershark attached to a DigitalSource object.
     *
     * @param source The digital source to which to attach.
     */
    explicit Lasershark(frc::DigitalSource *source);

    /**
     * Construct a new Lasershark attached to a DigitalSource object.
     *
     * @param source The digital source to which to attach.
     */
    explicit Lasershark(std::shared_ptr<frc::DigitalSource> source);

    /**
     * Get the distance reported by the LiDAR sensor. See WPILib Units library guide.
     */
    units::foot_t GetDistance();
};
} // namespace libcu