16 seqplay(
unsigned int i_dof,
double i_dt,
unsigned int i_fnum = 0,
unsigned int optional_data_dim = 1);
20 bool isEmpty(
const char *gname);
22 void setJointAngles(
const double *i_qRef,
double i_tm=0.0);
23 void getJointAngles(
double *i_qRef);
24 void setZmp(
const double *i_zmp,
double i_tm=0.0);
25 void setBasePos(
const double *i_pos,
double i_tm=0.0);
26 void setBaseRpy(
const double *i_rpy,
double i_tm=0.0);
27 void setBaseAcc(
const double *i_acc,
double i_tm=0.0);
28 void setWrenches(
const double *i_wrenches,
double i_tm=0.0);
29 void playPattern(std::vector<const double*>
pos, std::vector<const double*> zmp, std::vector<const double*> rpy, std::vector<double> tm,
const double *qInit,
unsigned int len);
31 bool addJointGroup(
const char *gname,
const std::vector<int>& indices);
32 bool getJointGroup(
const char *gname, std::vector<int>& indices);
33 bool removeJointGroup(
const char *gname,
double time=2.5);
34 bool setJointAnglesOfGroup(
const char *gname,
const double* i_qRef,
const size_t i_qsize,
double i_tm=0.0);
35 void clearOfGroup(
const char *gname,
double i_timeLimit);
36 bool playPatternOfGroup(
const char *gname, std::vector<const double*> pos, std::vector<double> tm,
const double *qInit,
unsigned int len);
38 bool resetJointGroup(
const char *gname,
const double *full);
40 bool setJointAnglesSequence(std::vector<const double*> pos, std::vector<double> tm);
41 bool setJointAnglesSequenceOfGroup(
const char *gname, std::vector<const double*> pos, std::vector<double> tm,
const size_t pos_size);
42 bool setJointAnglesSequenceFull(std::vector<const double*> pos, std::vector<const double*> vel, std::vector<const double*> torques, std::vector<const double*> bpos, std::vector<const double*> brpy, std::vector<const double*> bacc, std::vector<const double*> zmps, std::vector<const double*> wrenches, std::vector<const double*> optionals, std::vector<double> tm);
43 bool clearJointAngles();
44 bool clearJointAnglesOfGroup(
const char *gname);
46 void setJointAngle(
unsigned int i_rank,
double jv,
double tm);
47 void loadPattern(
const char *i_basename,
double i_tm);
48 void clear(
double i_timeLimit=0);
49 void get(
double *o_q,
double *o_zmp,
double *o_accel,
50 double *o_basePos,
double *o_baseRpy,
double *o_tq,
double *o_wrenches,
double *o_optional_data);
51 void go(
const double *i_q,
const double *i_zmp,
const double *i_acc,
52 const double *i_p,
const double *i_rpy,
const double *i_tq,
const double *i_wrenches,
const double *i_optional_data,
double i_time,
54 void go(
const double *i_q,
const double *i_zmp,
const double *i_acc,
55 const double *i_p,
const double *i_rpy,
const double *i_tq,
const double *i_wrenches,
const double *i_optional_data,
56 const double *ii_q,
const double *ii_zmp,
const double *ii_acc,
57 const double *ii_p,
const double *ii_rpy,
const double *ii_tq,
const double *ii_wrenches,
const double *ii_optional_data,
58 double i_time,
bool immediate=
true);
65 : indices(i_indices),
state(created){
71 void get(
double *full,
double *dfull = NULL,
bool popp=
true){
72 if (
state == created)
return;
73 if (
state == removing){
74 double x[indices.size()];
75 double v[indices.size()];
76 for (
size_t i=0;
i<indices.size();
i++){
77 x[
i] = full[indices[
i]];
78 v[
i] = dfull ? dfull[indices[
i]] : 0;
80 inter->setGoal(x, v, time2remove);
81 time2remove -= inter->deltaT();
82 if (time2remove <= 0)
state = removed;
84 double x[indices.size()], v[indices.size()];
85 inter->get(x, v, popp);
86 for (
size_t i=0;
i<indices.size();
i++){
87 full[indices[
i]] = x[
i];
88 if (dfull) dfull[indices[
i]] = v[
i];
91 void set(
const double *full,
const double *dfull=NULL){
92 double x[indices.size()], v[indices.size()];
93 for (
size_t i=0;
i<indices.size();
i++){
94 x[
i] = full[indices[
i]];
95 v[
i] = dfull ? dfull[indices[
i]] : 0;
102 for (
size_t i=0;
i<indices.size();
i++){
103 dst[
i] = src[indices[
i]];
107 void go(
const double *g,
double tm){
111 void go(
const double *g,
const double *v,
double tm){
116 inter->setGoal(g, tm);
120 void setGoal(
const double *g,
const double *v,
double tm){
121 inter->setGoal(g, v, tm);
125 void remove(
double time){
145 enum {Q,
ZMP, ACC, P, RPY, TQ, WRENCHES, OPTIONAL_DATA, NINTERPOLATOR};
std::map< std::string, groupInterpolator * > groupInterpolators
unsigned long long tick_t
void clear(CorbaSequence &seq)
void setGoal(const double *g, double tm)
def loadPattern(basename, tm=1.0)
groupInterpolator(const std::vector< int > &i_indices, double i_dt)
void go(const double *g, const double *v, double tm)
void extract(double *dst, const double *src)
void clear(double i_timeLimit=0)
void setGoal(const double *g, const double *v, double tm)
#define tick2sec(t)
convert time stamp counter into sec
std::vector< int > indices
void go(const double *g, double tm)
tick_t get_tick()
get time stamp counter