34 # include "keyboard.h" 59 std::cout <<
"--- Trajectory Menu ------------------------------" << std::endl;
60 std::cout <<
"?: Display this help o: Switch on/off " << std::endl;
61 std::cout <<
"v: Change velocity a: Change acceleration " << std::endl;
62 std::cout <<
"p: Add PTP movement l: Add LINEAR movement " << std::endl;
63 std::cout <<
"u: Unblock Esc: Exit to main menu " << std::endl;
64 std::cout <<
"--------------------------------------------------" << std::endl;
65 std::cout << std::endl;
68 std::cout <<
"--- Main Menu ------------------------------------" << std::endl;
69 std::cout <<
"?: Display this help o: Switch on/off " << std::endl;
70 std::cout <<
"t: Add trajectory r: Run trajectory " << std::endl;
71 std::cout <<
"u: Unblock f: Flush movebuffers " << std::endl;
72 std::cout <<
"Esc: Exit program " << std::endl;
73 std::cout <<
"--------------------------------------------------" << std::endl;
74 std::cout << std::endl;
77 std::cout <<
"Name of Trajectory to create / add? ";
80 char * name =
new char(strlen(name_str.c_str()));
81 strcpy(name,name_str.c_str());
82 std::cout << std::endl;
83 std::cout <<
"current velocity: " <<
velocity <<
", current acceleration: " <<
acceleration << std::endl;
84 std::cout << std::endl;
104 std::cout <<
"Motors on" << std::endl << std::endl;
108 std::cout <<
"Motors off" << std::endl << std::endl;
112 std::cout <<
"New velocity: ";
113 std::cin >> new_value;
114 if ((new_value >= 10) && (new_value <= 200)) {
116 std::cout <<
" ... OK" << std::endl << std::endl;
118 std::cout <<
" ... FAILED, has to be min. 10 and max. 200" << std::endl << std::endl;
122 std::cout <<
"New acceleration: ";
123 std::cin >> new_value;
124 if ((new_value >= 1) && (new_value <= 2)) {
126 std::cout <<
" ... OK" << std::endl << std::endl;
128 std::cout <<
" ... FAILED, has to be min. 1 and max. 2" << std::endl << std::endl;
138 std::cout <<
"Added PTP movement with v=" <<
velocity <<
" and a=" <<
acceleration <<
" to point:" << std::endl;
139 std::cout.precision(3);
140 std::cout.setf(std::ios::fixed,std::ios::floatfield);
141 std::cout <<
" X=" << current_move->
pos.
X;
142 std::cout <<
", Y=" << current_move->
pos.
Y;
143 std::cout <<
", Z=" << current_move->
pos.
Z;
144 std::cout <<
", phi=" << current_move->
pos.
phi;
145 std::cout <<
", theta=" << current_move->
pos.
theta;
146 std::cout <<
", psi=" << current_move->
pos.
psi;
147 std::cout << std::endl << std::endl;
156 std::cout <<
"Added LINEAR movement with v=" <<
velocity <<
" and a=" <<
acceleration <<
" to point:" << std::endl;
157 std::cout.precision(3);
158 std::cout.setf(std::ios::fixed,std::ios::floatfield);
159 std::cout <<
" X=" << current_move->
pos.
X;
160 std::cout <<
", Y=" << current_move->
pos.
Y;
161 std::cout <<
", Z=" << current_move->
pos.
Z;
162 std::cout <<
", phi=" << current_move->
pos.
phi;
163 std::cout <<
", theta=" << current_move->
pos.
theta;
164 std::cout <<
", psi=" << current_move->
pos.
psi;
165 std::cout << std::endl << std::endl;
169 std::cout <<
"Unblocked" << std::endl << std::endl;
172 std::cout <<
"'" << input <<
"' is not a valid command." << std::endl << std::endl;
178 int main(
int argc,
char *argv[]) {
180 std::cout <<
"usage: wrapper_control CONFIGFILE IP_ADDR" << std::endl;
188 std::cout <<
"ERROR: " << e.
message() << std::endl;
191 std::cout <<
"-------------------------------------------" << std::endl;
192 std::cout <<
"success: katana initiated" << std::endl;
193 std::cout <<
"-------------------------------------------" << std::endl;
199 std::string name_str;
216 std::cout <<
"Motors on" << std::endl << std::endl;
220 std::cout <<
"Motors off" << std::endl << std::endl;
228 std::cout <<
"Name of Trajectory to run? ";
229 std::cin >> name_str;
230 name =
new char(strlen(name_str.c_str()));
231 strcpy(name,name_str.c_str());
232 std::cout << std::endl;
233 std::cout <<
"Number of repetitions? ";
235 std::cout << std::endl;
241 std::cout <<
"Unblocked" << std::endl << std::endl;
245 std::cout <<
"MoveBuffers flushed" << std::endl << std::endl;
248 std::cout <<
"\n'" << input <<
"' is not a valid command.\n" << std::endl << std::endl;
264 std::cout <<
"ERROR: " << e.
message() << std::endl;
double phi
the orientation of the TCP
std::string message() const
const int DEFAULT_VELOCITY
ETransition transition
the transition to this position, PTP or LINEAR
TPos pos
The position, see above struct TPos.
extern C because we want to access these interfaces from anywhere:
int velocity
The velocitiy for this particular movement.
void displayTrajectoryHelp()
std::vector< TMovement * > movement_vector
TMovement * allocateMovement()
int acceleration
the acceleration for this particular movement
double X
The position in cartesian space.
DLLEXPORT int flushMoveBuffers()
flush all the movebuffers
int main(int argc, char *argv[])
const int DEFAULT_ACCELERATION