Class DriverInterface

Inheritance Relationships

Derived Type

Class Documentation

class DriverInterface

Abstract class that provides functionality for managing motor drivers.

Subclassed by husarion_ugv_hardware_interfaces::RoboteqDriver

Public Types

using SharedPtr = std::shared_ptr<DriverInterface>

Alias for a shared pointer to a Driver object.

Public Functions

virtual std::future<void> Boot() = 0

Triggers boot operations.

Throws:

std::runtime_error – if triggering boot fails

virtual bool IsCANError() const = 0

Returns true if CAN error was detected.

virtual bool IsHeartbeatTimeout() const = 0

Returns true if heartbeat timeout encountered.

virtual DriverState ReadState() = 0

Reads driver state data returned from (PDO 3 and 4): error flags, battery voltage, battery currents (for channel 1 and 2, they are not the same as motor currents), temperatures. Also saves the last timestamps.

virtual void ResetScript() = 0
Throws:

std::runtime_error – if any operation returns error

virtual void TurnOnEStop() = 0
Throws:

std::runtime_error – if any operation returns error

virtual void TurnOffEStop() = 0
Throws:

std::runtime_error – if any operation returns error

virtual void AddMotorDriver(const MotorNames name, std::shared_ptr<MotorDriverInterface> motor_driver) = 0

Adds a motor driver to the driver.

virtual std::shared_ptr<MotorDriverInterface> GetMotorDriver(const MotorNames name) = 0