/*
 * flipper_plugin.h
 *
 * Gazebo plugin to listen to joint controls and publish to transmission the joint states
 *
 *  Created on: 17 Oct 2014
 *      Author: timothyw
 */

#ifndef NEGOTIATOR_GAZEBO_FLIPPER_NODE_H_
#define NEGOTIATOR_GAZEBO_FLIPPER_NODE_H_

#include <ros/ros.h>
#include <sensor_msgs/JointState.h>

namespace negotiator {
namespace gazebo {

class FlipperPositionGazebo {
private:
    ros::Subscriber jointControlSub;
    ros::Publisher transmissionLeftPub;
    ros::Publisher transmissionRightPub;

    // Last position
    ros::Time lastTime;
    float leftPosition;
    float rightPosition;

public:
    FlipperPositionGazebo();
    ~FlipperPositionGazebo();

    void start();
    void stop();

    // Subscriber callback
    void callbackJointControl(sensor_msgs::JointStateConstPtr joints);
};

} // namespace gazebo
} // namespace negotiator

#endif /* NEGOTIATOR_GAZEBO_FLIPPER_NODE_H_ */
