/*
 * hardware.h
 *
 *  Common hardware interface for Arduino or Pololu Flipper control
 *
 *  Created on: 19 Aug 2015
 *      Author: timothyw
 */

#ifndef INCLUDE_NEGOTIATOR_DRIVERS_FLIPPERS_HARDWARE_INTERFACE_H_
#define INCLUDE_NEGOTIATOR_DRIVERS_FLIPPERS_HARDWARE_INTERFACE_H_

#include <crosbot/config.hpp>

namespace casualty {

class FlippersHardwareInterface {
public:

    FlippersHardwareInterface() {};
    virtual ~FlippersHardwareInterface() {};

    virtual void configure(crosbot::ConfigElementPtr cf) = 0;

    virtual void start() = 0;
    virtual void stop() = 0;

    /**
     * Emergency Stop command
     */
    virtual void command_EMStop() = 0;

    /**
     * Move at velocity, positive velocity is forward, negative velocity is reverse.
     * Velocity is a value between -1 and 1 representing the ratio of the maximum speed of
     * the joint to move at.
     */
    virtual void command_Velocity(double velocity) = 0;

    /**
     * Reads a single set of values from the hardware
     */
    virtual void readValues(double &pot_val, double &setPoint, double &battery) = 0;

private:
};

} // namespace casualty

#endif /* INCLUDE_NEGOTIATOR_DRIVERS_FLIPPERS_HARDWARE_INTERFACE_H_ */
