-
Notifications
You must be signed in to change notification settings - Fork 29
/
9000-set_linear_track.cc
48 lines (35 loc) · 1.1 KB
/
9000-set_linear_track.cc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
/**
* Software License Agreement (MIT License)
*
* Copyright (c) 2022, UFACTORY, Inc.
*
* All rights reserved.
*
* @author Vinman <[email protected]> <[email protected]>
*/
#include "xarm/wrapper/xarm_api.h"
int main(int argc, char **argv) {
if (argc < 2) {
printf("Please enter IP address\n");
return 0;
}
std::string port(argv[1]);
XArmAPI *arm = new XArmAPI(port);
sleep_milliseconds(500);
int ret;
ret = arm->clean_linear_track_error();
printf("clean_linear_track_error, ret=%d\n", ret);
ret = arm->set_linear_track_back_origin();
printf("set_linear_track_back_origin, ret=%d\n", ret);
ret = arm->set_linear_track_enable(true);
printf("set_linear_track_enable, ret=%d\n", ret);
ret = arm->set_linear_track_speed(100);
printf("set_linear_track_speed, ret=%d\n", ret);
ret = arm->set_linear_track_pos(500);
printf("set_linear_track_pos, ret=%d\n", ret);
ret = arm->set_linear_track_pos(200);
printf("set_linear_track_pos, ret=%d\n", ret);
ret = arm->set_linear_track_stop();
printf("set_linear_track_stop, ret=%d\n", ret);
return 0;
}