| Line |
Branch |
Exec |
Source |
| 1 |
|
|
/* |
| 2 |
|
|
* Copyright 2010, |
| 3 |
|
|
* François Bleibel, |
| 4 |
|
|
* Olivier Stasse, |
| 5 |
|
|
* |
| 6 |
|
|
* CNRS/AIST |
| 7 |
|
|
* |
| 8 |
|
|
*/ |
| 9 |
|
|
|
| 10 |
|
|
#ifndef __SOT_SMOOTHREACH_H_H |
| 11 |
|
|
#define __SOT_SMOOTHREACH_H_H |
| 12 |
|
|
|
| 13 |
|
|
/* --------------------------------------------------------------------- */ |
| 14 |
|
|
/* --- INCLUDE --------------------------------------------------------- */ |
| 15 |
|
|
/* --------------------------------------------------------------------- */ |
| 16 |
|
|
|
| 17 |
|
|
/* Matrix */ |
| 18 |
|
|
#include <dynamic-graph/linear-algebra.h> |
| 19 |
|
|
|
| 20 |
|
|
/* SOT */ |
| 21 |
|
|
#include <dynamic-graph/all-signals.h> |
| 22 |
|
|
#include <dynamic-graph/entity.h> |
| 23 |
|
|
|
| 24 |
|
|
/* --------------------------------------------------------------------- */ |
| 25 |
|
|
/* --- API ------------------------------------------------------------- */ |
| 26 |
|
|
/* --------------------------------------------------------------------- */ |
| 27 |
|
|
|
| 28 |
|
|
#if defined(WIN32) |
| 29 |
|
|
#if defined(com_freezer_EXPORTS) |
| 30 |
|
|
#define SOTSMOOTHREACH_EXPORT __declspec(dllexport) |
| 31 |
|
|
#else |
| 32 |
|
|
#define SOTSMOOTHREACH_EXPORT __declspec(dllimport) |
| 33 |
|
|
#endif |
| 34 |
|
|
#else |
| 35 |
|
|
#define SOTSMOOTHREACH_EXPORT |
| 36 |
|
|
#endif |
| 37 |
|
|
|
| 38 |
|
|
namespace dynamicgraph { |
| 39 |
|
|
namespace sot { |
| 40 |
|
|
|
| 41 |
|
|
/* --------------------------------------------------------------------- */ |
| 42 |
|
|
/* --- CLASS ----------------------------------------------------------- */ |
| 43 |
|
|
/* --------------------------------------------------------------------- */ |
| 44 |
|
|
|
| 45 |
|
|
class SOTSMOOTHREACH_EXPORT SmoothReach : public dynamicgraph::Entity { |
| 46 |
|
|
public: |
| 47 |
|
|
static const std::string CLASS_NAME; |
| 48 |
|
✗ |
virtual const std::string &getClassName() const { return CLASS_NAME; } |
| 49 |
|
|
|
| 50 |
|
|
private: |
| 51 |
|
|
dynamicgraph::Vector start, goal; |
| 52 |
|
|
int startTime, lengthTime; |
| 53 |
|
|
bool isStarted, isParam; |
| 54 |
|
|
int smoothMode; |
| 55 |
|
|
double smoothParam; |
| 56 |
|
|
|
| 57 |
|
|
double smoothFunction(double x); |
| 58 |
|
|
|
| 59 |
|
|
public: /* --- CONSTRUCTION --- */ |
| 60 |
|
|
SmoothReach(const std::string &name); |
| 61 |
|
✗ |
virtual ~SmoothReach(void){}; |
| 62 |
|
|
|
| 63 |
|
|
public: /* --- SIGNAL --- */ |
| 64 |
|
|
dynamicgraph::SignalPtr<dynamicgraph::Vector, int> startSIN; |
| 65 |
|
|
dynamicgraph::SignalTimeDependent<dynamicgraph::Vector, int> goalSOUT; |
| 66 |
|
|
|
| 67 |
|
|
public: /* --- FUNCTION --- */ |
| 68 |
|
|
dynamicgraph::Vector &goalSOUT_function(dynamicgraph::Vector &goal, |
| 69 |
|
|
const int &time); |
| 70 |
|
|
|
| 71 |
|
|
void set(const dynamicgraph::Vector &goal, const int &length); |
| 72 |
|
|
const dynamicgraph::Vector &getGoal(void); |
| 73 |
|
|
const int &getLength(void); |
| 74 |
|
|
const int &getStart(void); |
| 75 |
|
|
|
| 76 |
|
|
void setSmoothing(const int &mode, const double ¶m); |
| 77 |
|
|
|
| 78 |
|
|
public: /* --- PARAMS --- */ |
| 79 |
|
|
virtual void display(std::ostream &os) const; |
| 80 |
|
|
void initCommands(void); |
| 81 |
|
|
}; |
| 82 |
|
|
|
| 83 |
|
|
} /* namespace sot */ |
| 84 |
|
|
} /* namespace dynamicgraph */ |
| 85 |
|
|
|
| 86 |
|
|
#endif /* #ifndef __SOT_SMOOTHREACH_H_H */ |
| 87 |
|
|
|