-
Notifications
You must be signed in to change notification settings - Fork 105
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
improved SkinGUI for fingertip (#930)
- Loading branch information
1 parent
bffe9bf
commit d393231
Showing
12 changed files
with
571 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
// -*- mode:C++; tab-width:4; c-basic-offset:4; indent-tabs-mode:nil -*- | ||
|
||
/* | ||
* Copyright (C) 2009 RobotCub Consortium | ||
* Author: Marco Maggiali marco.maggiali@iit.it | ||
* CopyPolicy: Released under the terms of the GNU GPL v2.0. | ||
* | ||
*/ | ||
|
||
#include "include/Fingertip4Left.h" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
// -*- mode:C++; tab-width:4; c-basic-offset:4; indent-tabs-mode:nil -*- | ||
|
||
/* | ||
* Copyright (C) 2009 RobotCub Consortium | ||
* Author: Marco Maggiali marco.maggiali@iit.it | ||
* CopyPolicy: Released under the terms of the GNU GPL v2.0. | ||
* | ||
*/ | ||
|
||
#include "include/Fingertip4Right.h" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
// -*- mode:C++; tab-width:4; c-basic-offset:4; indent-tabs-mode:nil -*- | ||
|
||
/* | ||
* Copyright (C) 2009 RobotCub Consortium | ||
* Author: Marco Maggiali marco.maggiali@iit.it | ||
* CopyPolicy: Released under the terms of the GNU GPL v2.0. | ||
* | ||
*/ | ||
|
||
#include "include/FingertipMID.h" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
// -*- mode:C++; tab-width:4; c-basic-offset:4; indent-tabs-mode:nil -*- | ||
|
||
/* | ||
* Copyright (C) 2009 RobotCub Consortium | ||
* Author: Marco Maggiali marco.maggiali@iit.it | ||
* CopyPolicy: Released under the terms of the GNU GPL v2.0. | ||
* | ||
*/ | ||
|
||
#include "include/fakePalm.h" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,117 @@ | ||
// -*- mode:C++; tab-width:4; c-basic-offset:4; indent-tabs-mode:nil -*- | ||
|
||
/* | ||
* Copyright (C) 2009 RobotCub Consortium | ||
* Author: Marco Maggiali marco.maggiali@iit.it | ||
* CopyPolicy: Released under the terms of the GNU GPL v2.0. | ||
* | ||
*/ | ||
|
||
#include "include/TouchSensor.h" | ||
|
||
#ifndef __ALE_FINGERTIP4_L_H__ | ||
#define __ALE_FINGERTIP4_L_H__ | ||
|
||
class Fingertip4L : public TouchSensor | ||
{ | ||
public: | ||
Fingertip4L(double cx,double cy,double th,double gain=1.0,int layoutNum=0,int lrMirror=0) | ||
{ | ||
dGain=gain; | ||
ilrMirror=lrMirror; | ||
ilayoutNum=layoutNum; | ||
nVerts=7; | ||
nTaxels=12; | ||
|
||
/* dX[0]= 41.0; dY[0]=10.0; | ||
dX[1]= 15.0; dY[1]=10.0; | ||
dX[2]= 15.0; dY[2]=35.0; | ||
dX[3]= 41.0; dY[3]=35.0; | ||
dX[4]= 30.0; dY[4]=64.0; | ||
dX[5]= 11.0; dY[5]=58.0; | ||
dX[6]= 0.0; dY[6]=82.0; | ||
dX[7]=-11.0; dY[7]=58.0; | ||
dX[8]=-30.0; dY[8]=64.0; | ||
dX[9]=-41.0; dY[9]=35.0; | ||
dX[10]=-15.0; dY[10]=35.0; | ||
dX[11]=-15.0; dY[11]=10.0; | ||
*/ | ||
dY[0]=-25.0; dX[0]= 20.0; | ||
dY[1]=-25.0; dX[1]= 0.0; | ||
dY[2]=-25.0; dX[2]= -20.0; | ||
dY[3]=-39.0; dX[3]= -35.0; | ||
dY[4]=-39.0; dX[4]= 35.0; | ||
dY[5]=-53.0; dX[5]= -20.0; | ||
dY[6]=-53.0; dX[6]= 0.0; | ||
dY[7]=-53.0; dX[7]= 20.0; | ||
dY[8]= -2.0; dX[8]= 22.0; | ||
dY[9]= 10.0; dX[9]= 5.0; | ||
dY[10]= 28.0; dX[10]= -4.; | ||
dY[11]= 30.0; dX[11]= 32.0; | ||
|
||
dXv[0]=53.0; dYv[0]= 0.0; | ||
dXv[1]=53.0; dYv[1]=45.0; | ||
dXv[2]=dX[4]+10.0; dYv[2]=dY[4]+10.0; | ||
dXv[3]=0.0; dYv[3]=dY[6]+12.0; | ||
dXv[4]=-dXv[2]; dYv[4]=dYv[2]; | ||
dXv[5]=-dXv[1]; dYv[5]=dYv[1]; | ||
dXv[6]=-dXv[0]; dYv[6]=dYv[0]; | ||
|
||
const double scale=2.7/15.3; | ||
for (int i=0; i<nTaxels; ++i) | ||
{ | ||
dX[i]*=scale; | ||
dY[i]*=scale; | ||
} | ||
for (int i=0; i<nVerts; ++i) | ||
{ | ||
dXv[i]*=scale; | ||
dYv[i]*=scale; | ||
} | ||
|
||
m_RadiusOrig=1.5; | ||
|
||
const double DEG2RAD=M_PI/180.0; | ||
const double CST=cos(DEG2RAD*th); | ||
const double SNT=sin(DEG2RAD*th); | ||
|
||
for (int i=0; i<nTaxels; ++i) | ||
{ | ||
double x=dX[i]; | ||
double y=dY[i]; | ||
if (lrMirror==1) x=-x; | ||
|
||
dX[i]=cx+CST*x-SNT*y; | ||
dY[i]=cy+SNT*x+CST*y; | ||
} | ||
|
||
for (int i=0; i<nVerts; ++i) | ||
{ | ||
double x=dXv[i]; | ||
double y=dYv[i]; | ||
if (lrMirror==1) x=-x; | ||
|
||
// dXv[i]=cx+CST*x-SNT*y; | ||
// dYv[i]=cy+SNT*x+CST*y; | ||
dXv[i]=0; | ||
dYv[i]=0; | ||
} | ||
|
||
// in static definition | ||
//dXmin=dYmin= HUGE; | ||
//dXmax=dYmax=-HUGE; | ||
|
||
/*for (int i=0; i<nVerts; ++i) | ||
{ | ||
if (dXv[i]<dXmin) dXmin=dXv[i]; | ||
if (dXv[i]>dXmax) dXmax=dXv[i]; | ||
if (dYv[i]<dYmin) dYmin=dYv[i]; | ||
if (dYv[i]>dYmax) dYmax=dYv[i]; | ||
}*/ | ||
|
||
dXc=cx; | ||
dYc=cy; | ||
} | ||
}; | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,104 @@ | ||
// -*- mode:C++; tab-width:4; c-basic-offset:4; indent-tabs-mode:nil -*- | ||
|
||
/* | ||
* Copyright (C) 2009 RobotCub Consortium | ||
* Author: Marco Maggiali marco.maggiali@iit.it | ||
* CopyPolicy: Released under the terms of the GNU GPL v2.0. | ||
* | ||
*/ | ||
|
||
#include "include/TouchSensor.h" | ||
|
||
#ifndef __ALE_FINGERTIP4_R_H__ | ||
#define __ALE_FINGERTIP4_R_H__ | ||
|
||
class Fingertip4R : public TouchSensor | ||
{ | ||
public: | ||
Fingertip4R(double cx,double cy,double th,double gain=1.0,int layoutNum=0,int lrMirror=0) | ||
{ | ||
dGain=gain; | ||
ilrMirror=lrMirror; | ||
ilayoutNum=layoutNum; | ||
nVerts=7; | ||
nTaxels=12; | ||
|
||
dY[4]=-25.0; dX[4]= -20.0; | ||
dY[5]=-25.0; dX[5]= 0.0; | ||
dY[6]=-25.0; dX[6]= 20.0; | ||
dY[8]=-39.0; dX[8]= 35.0; | ||
dY[7]=-39.0; dX[7]= -35.0; | ||
dY[9]=-53.0; dX[9]= 20.0; | ||
dY[10]=-53.0; dX[10]= 0.0; | ||
dY[11]=-53.0; dX[11]= -20.0; | ||
dY[3]= -2.0; dX[3]= -22.0; | ||
dY[2]= 10.0; dX[2]= -5.0; | ||
dY[1]= 28.0; dX[1]= 4.0; | ||
dY[0]= 30.0; dX[0]= -32.0; | ||
|
||
lrMirror=0; //forcing mirror | ||
|
||
dXv[0]=53.0; dYv[0]= 0.0; | ||
dXv[1]=53.0; dYv[1]=45.0; | ||
dXv[2]=dX[3]+10.0; dYv[2]=dY[3]+10.0; | ||
dXv[3]=0.0; dYv[3]=dY[5]+12.0; | ||
dXv[4]=-dXv[2]; dYv[4]=dYv[2]; | ||
dXv[5]=-dXv[1]; dYv[5]=dYv[1]; | ||
dXv[6]=-dXv[0]; dYv[6]=dYv[0]; | ||
|
||
const double scale=2.7/15.3; | ||
for (int i=0; i<nTaxels; ++i) | ||
{ | ||
dX[i]*=scale; | ||
dY[i]*=scale; | ||
} | ||
for (int i=0; i<nVerts; ++i) | ||
{ | ||
dXv[i]*=scale; | ||
dYv[i]*=scale; | ||
} | ||
|
||
m_RadiusOrig=1.5; | ||
|
||
const double DEG2RAD=M_PI/180.0; | ||
const double CST=cos(DEG2RAD*th); | ||
const double SNT=sin(DEG2RAD*th); | ||
|
||
for (int i=0; i<nTaxels; ++i) | ||
{ | ||
double x=dX[i]; | ||
double y=dY[i]; | ||
if (lrMirror==1) x=-x; | ||
|
||
dX[i]=cx+CST*x-SNT*y; | ||
dY[i]=cy+SNT*x+CST*y; | ||
} | ||
|
||
for (int i=0; i<nVerts; ++i) | ||
{ | ||
double x=dXv[i]; | ||
double y=dYv[i]; | ||
if (lrMirror==1) x=-x; | ||
|
||
dXv[i]=0; | ||
dYv[i]=0; | ||
} | ||
|
||
// in static definition | ||
//dXmin=dYmin= HUGE; | ||
//dXmax=dYmax=-HUGE; | ||
|
||
for (int i=0; i<nVerts; ++i) | ||
{ | ||
if (dXv[i]<dXmin) dXmin=dXv[i]; | ||
if (dXv[i]>dXmax) dXmax=dXv[i]; | ||
if (dYv[i]<dYmin) dYmin=dYv[i]; | ||
if (dYv[i]>dYmax) dYmax=dYv[i]; | ||
} | ||
|
||
dXc=cx; | ||
dYc=cy; | ||
} | ||
}; | ||
|
||
#endif |
Oops, something went wrong.