29 tcgetattr( STDIN_FILENO, &term);
30 term.c_lflag |= ICANON | ECHO;
31 tcsetattr( STDIN_FILENO, TCSANOW, &term);
36 int main(
int argc,
char **argv)
38 ros::init(argc, argv,
"THORMANG3 Action Editor");
41 std::string offset_file = nh.
param<std::string>(
"offset_table",
"");
42 std::string robot_file = nh.
param<std::string>(
"robot_file_path",
"");
43 std::string dxl_init_file = nh.
param<std::string>(
"init_file_path",
"");
97 else if (ch >=
'A' && ch <=
'z')
99 char input[128] = { 0, };
111 input[idx++] = (char) ch;
131 else if ((ch >=
'A' && ch <=
'z') || ch ==
' ' || (ch >=
'0' && ch <=
'9'))
136 input[idx++] = (char) ch;
142 input_len = strlen(input);
145 token = strtok(input,
" ");
149 token = strtok(0,
" ");
153 iparam[num_param++] = atoi(token);
154 token = strtok(0,
" ");
157 if (strcmp(cmd,
"exit") == 0)
162 else if (strcmp(cmd,
"re") == 0)
164 else if (strcmp(cmd,
"help") == 0)
166 else if (strcmp(cmd,
"n") == 0)
168 else if (strcmp(cmd,
"b") == 0)
170 else if (strcmp(cmd,
"time") == 0)
172 else if (strcmp(cmd,
"speed") == 0)
174 else if (strcmp(cmd,
"page") == 0)
181 else if (strcmp(cmd,
"play") == 0)
185 else if (strcmp(cmd,
"playboth") == 0)
192 else if (strcmp(cmd,
"set") == 0)
199 else if (strcmp(cmd,
"list") == 0)
201 else if (strcmp(cmd,
"on") == 0)
203 else if (strcmp(cmd,
"off") == 0)
205 else if (strcmp(cmd,
"mrl") == 0)
213 else if (strcmp(cmd,
"murl") == 0)
221 else if (strcmp(cmd,
"mlrl") == 0)
229 else if (strcmp(cmd,
"mlr") == 0)
237 else if (strcmp(cmd,
"mulr") == 0)
245 else if (strcmp(cmd,
"mllr") == 0)
253 else if (strcmp(cmd,
"ms") == 0)
261 else if (strcmp(cmd,
"w") == 0)
268 else if (strcmp(cmd,
"d") == 0)
275 else if (strcmp(cmd,
"i") == 0)
282 else if (strcmp(cmd,
"copy") == 0)
289 else if (strcmp(cmd,
"new") == 0)
291 else if (strcmp(cmd,
"g") == 0)
294 editor.
goCmd(iparam[0]);
298 else if (strcmp(cmd,
"save") == 0)
300 else if (strcmp(cmd,
"name") == 0)
303 editor.
printCmd(
"Bad command! please input 'help'");
void deleteStepCmd(int index)
bool initializeActionEditor(std::string robot_file_path, std::string init_file_path, std::string offset_file_path)
int main(int argc, char **argv)
void writeStepCmd(int index)
ROSCPP_DECL void init(int &argc, char **argv, const std::string &name, uint32_t options=0)
void setValueUpDown(int offset)
void printCmd(const char *message)
void insertStepCmd(int index)
bool param(const std::string ¶m_name, T ¶m_val, const T &default_val) const
void mirrorStepCmd(int index, int mirror_type, int target_type)
void turnOnOffCmd(bool on, int num_param, int *list)