Page MenuHomec4science

WebotsSynchronizer.h
No OneTemporary

File Metadata

Created
Tue, Nov 5, 00:16

WebotsSynchronizer.h

/**
* \file WebotsSynchronizer.h
*
* \date Aug 22, 2010
* \author tuleu
* \author anordman
*/
#pragma once
#include <boost/smart_ptr/shared_ptr.hpp>
#include <rci/processing/Synchronizer.h>
#include <libamarsi-quad/libamarsi-quad.h>
#include "libamarsi-quad/controller/internals/ControllerPrimpleAmarsi.h"
#include <rcioncilla/QuadTrunkNode.h>
#include <rcioncilla/QuadHipNode.h>
#include <rcioncilla/QuadKneeNode.h>
#include <rcioncilla/QuadAnkleNode.h>
namespace cca {
namespace rci {
namespace driver {
class WebotsSynchronizer;
typedef boost::shared_ptr<WebotsSynchronizer> WebotsSynchronizerPtr;
/**
* @todo Use amarsi::Clock?
*/
class WebotsSynchronizer: public Synchronizer, public amarsi::Controller {
public:
WebotsSynchronizer(int &argc, char** argv);
virtual ~WebotsSynchronizer();
virtual int run();
virtual void userInitSimulation();
virtual void userInitEnvironment();
/* CCA-specific */
static CCANodePtr create(int &argc, char** argv);
virtual std::string print() const;
virtual void send();
virtual void receive();
void registerQuadNode(CCANodePtr node, amarsi::ActuatorID index);
bool _running;
protected:
amarsi::ControllerPrimpleAmarsi *_primpleAmarsi;
private:
//amplitude of oscillation for the Hip joints.
double d_amplitudeHip;
//offset of the oscillations for the Hip Joint.
double d_offsetHip;
//amplitude of the extension/contraction of the leg
double d_amplitudeKnee;
//offset of the knee command
double d_offsetKnee;
//frequency of the oscillations
double d_frequency;
// angle of the slope
double d_angle;
std::vector<std::string> _actuatorNames;
std::vector<std::string> _servoNames;
void prepareNodeWebotsMapping();
};
}
}
}

Event Timeline