ypspur.h
Go to the documentation of this file.
1 // Copyright (c) 2010-2016 The YP-Spur Authors, except where otherwise indicated.
2 //
3 // Permission is hereby granted, free of charge, to any person obtaining a copy
4 // of this software and associated documentation files (the "Software"), to
5 // deal in the Software without restriction, including without limitation the
6 // rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
7 // sell copies of the Software, and to permit persons to whom the Software is
8 // furnished to do so, subject to the following conditions:
9 //
10 // The above copyright notice and this permission notice shall be included in
11 // all copies or substantial portions of the Software.
12 //
13 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14 // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15 // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
16 // THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17 // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18 // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
19 // SOFTWARE.
20 
21 #ifndef YPSPUR_H
22 #define YPSPUR_H
23 
24 #include <ypparam.h>
25 
26 #ifdef __cplusplus
27 extern "C" {
28 #endif // __cplusplus
29 
30 /* YPSpurコマンド集 */
31 #define Spur_init() YPSpur_init()
32 #define Spur_initex(msq) YPSpur_initex(msq)
33 #define Spur_init_socket(ip, port) YPSpur_init_socket(ip, port)
34 #define Spur_stop() YPSpur_stop()
35 #define Spur_free() YPSpur_free()
36 
37 #define Spur_freeze() YPSpur_freeze()
38 #define Spur_isfreeze() YPSpur_isfreeze()
39 #define Spur_unfreeze() YPSpur_unfreeze()
40 
41 #define Spur_line_GL(x, y, th) YPSpur_line(CS_GL, x, y, th)
42 #define Spur_line_LC(x, y, th) YPSpur_line(CS_LC, x, y, th)
43 #define Spur_line_FS(x, y, th) YPSpur_line(CS_FS, x, y, th)
44 #define Spur_line_BS(x, y, th) YPSpur_line(CS_BS, x, y, th)
45 #define Spur_line_BL(x, y, th) YPSpur_line(CS_BL, x, y, th)
46 
47 #define Spur_stop_line_GL(x, y, th) YPSpur_stop_line(CS_GL, x, y, th)
48 #define Spur_stop_line_LC(x, y, th) YPSpur_stop_line(CS_LC, x, y, th)
49 #define Spur_stop_line_FS(x, y, th) YPSpur_stop_line(CS_FS, x, y, th)
50 #define Spur_stop_line_BS(x, y, th) YPSpur_stop_line(CS_BS, x, y, th)
51 #define Spur_stop_line_BL(x, y, th) YPSpur_stop_line(CS_BL, x, y, th)
52 
53 #define Spur_circle_GL(x, y, d) YPSpur_circle(CS_GL, x, y, d)
54 #define Spur_circle_LC(x, y, d) YPSpur_circle(CS_LC, x, y, d)
55 #define Spur_circle_FS(x, y, d) YPSpur_circle(CS_FS, x, y, d)
56 #define Spur_circle_BS(x, y, d) YPSpur_circle(CS_BS, x, y, d)
57 #define Spur_circle_BL(x, y, d) YPSpur_circle(CS_BL, x, y, d)
58 
59 #define Spur_spin_GL(th) YPSpur_spin(CS_GL, th)
60 #define Spur_spin_LC(th) YPSpur_spin(CS_LC, th)
61 #define Spur_spin_FS(th) YPSpur_spin(CS_FS, th)
62 #define Spur_spin_BS(th) YPSpur_spin(CS_BS, th)
63 #define Spur_spin_BL(th) YPSpur_spin(CS_BL, th)
64 
65 #define Spur_orient_GL(th) YPSpur_orient(CS_GL, th)
66 #define Spur_orient_LC(th) YPSpur_orient(CS_LC, th)
67 #define Spur_orient_FS(th) YPSpur_orient(CS_FS, th)
68 #define Spur_orient_BS(th) YPSpur_orient(CS_BS, th)
69 #define Spur_orient_BL(th) YPSpur_orient(CS_BL, th)
70 
71 #define Spur_set_pos_GL(x, y, th) YPSpur_set_pos(CS_GL, x, y, th)
72 #define Spur_set_pos_LC(x, y, th) YPSpur_set_pos(CS_LC, x, y, th)
73 #define Spur_set_pos_BL(x, y, th) YPSpur_set_pos(CS_BL, x, y, th)
74 
75 #define Spur_set_vel(v) YPSpur_set_vel(v)
76 #define Spur_set_angvel(w) YPSpur_set_angvel(w)
77 #define Spur_set_accel(v) YPSpur_set_accel(v)
78 #define Spur_set_angaccel(w) YPSpur_set_angaccel(w)
79 
80 #define Spur_adjust_pos_GL(x, y, th) YPSpur_adjust_pos(CS_GL, x, y, th)
81 #define Spur_adjust_pos_LC(x, y, th) YPSpur_adjust_pos(CS_LC, x, y, th)
82 #define Spur_adjust_pos_FS(x, y, th) YPSpur_adjust_pos(CS_FS, x, y, th)
83 #define Spur_adjust_pos_BS(x, y, th) YPSpur_adjust_pos(CS_BS, x, y, th)
84 #define Spur_adjust_pos_BL(x, y, th) YPSpur_adjust_pos(CS_BL, x, y, th)
85 
86 #define Spur_get_pos_GL(x, y, th) YPSpur_get_pos(CS_GL, x, y, th)
87 #define Spur_get_pos_LC(x, y, th) YPSpur_get_pos(CS_LC, x, y, th)
88 #define Spur_get_pos_BS(x, y, th) YPSpur_get_pos(CS_BS, x, y, th)
89 #define Spur_get_pos_BL(x, y, th) YPSpur_get_pos(CS_BL, x, y, th)
90 
91 #define Spur_get_vel(v, w) YPSpur_get_vel(v, w)
92 #define Spur_get_force(trans, angular) YPSpur_get_force(trans, angular)
93 
94 #define Spur_near_pos_GL(x, y, r) YPSpur_near_pos(CS_GL, x, y, r)
95 #define Spur_near_pos_LC(x, y, r) YPSpur_near_pos(CS_LC, x, y, r)
96 #define Spur_near_pos_BS(x, y, r) YPSpur_near_pos(CS_BS, x, y, r)
97 #define Spur_near_pos_BL(x, y, r) YPSpur_near_pos(CS_BL, x, y, r)
98 
99 #define Spur_near_ang_GL(th, d) YPSpur_near_ang(CS_GL, th, d)
100 #define Spur_near_ang_LC(th, d) YPSpur_near_ang(CS_LC, th, d)
101 #define Spur_near_ang_BS(th, d) YPSpur_near_ang(CS_BS, th, d)
102 #define Spur_near_ang_BL(th, d) YPSpur_near_ang(CS_BL, th, d)
103 
104 #define Spur_over_line_GL(x, y, th) YPSpur_over_line(CS_GL, x, y, th)
105 #define Spur_over_line_LC(x, y, th) YPSpur_over_line(CS_LC, x, y, th)
106 #define Spur_over_line_BS(x, y, th) YPSpur_over_line(CS_BS, x, y, th)
107 #define Spur_over_line_BL(x, y, th) YPSpur_over_line(CS_BL, x, y, th)
108 
109 #define Spur_vel(v, w) YPSpur_vel(v, w)
110 
111 #define Spur_tilt_GL(d, t) YPSpur_tilt(CS_GL, d, t)
112 #define Spur_tilt_LC(d, t) YPSpur_tilt(CS_LC, d, t)
113 #define Spur_tilt_FS(d, t) YPSpur_tilt(CS_FS, d, t)
114 #define Spur_tilt_BS(d, t) YPSpur_tilt(CS_BS, d, t)
115 #define Spur_tilt_BL(d, t) YPSpur_tilt(CS_BL, d, t)
116 
118 int YPSpur_init(void);
119 int YPSpur_initex(int msq_key);
120 int YPSpur_init_socket(char *ip, int port);
121 
123 int YPSpur_isfreeze(void);
124 int YPSpur_freeze(void);
125 int YPSpur_unfreeze(void);
126 
128 int YPSpur_stop(void);
129 int YPSpur_free(void);
130 int YP_openfree(void);
131 
133 int YPSpur_line(int cs, double x, double y, double theta);
134 int YPSpur_stop_line(int cs, double x, double y, double theta);
135 int YPSpur_circle(int cs, double x, double y, double r);
136 int YPSpur_spin(int cs, double theta);
137 int YPSpur_orient(int cs, double theta);
138 
140 int YPSpur_set_pos(int cs, double x, double y, double theta);
141 int YPSpur_adjust_pos(int cs, double x, double y, double theta);
142 int YPSpur_set_vel(double v);
143 int YPSpur_set_angvel(double w);
144 int YPSpur_set_accel(double v);
145 int YPSpur_set_angaccel(double w);
146 
148 double YPSpur_get_pos(int cs, double *x, double *y, double *theta);
149 double YPSpur_get_vel(double *v, double *w);
150 double YPSpur_get_force(double *trans, double *angular);
151 
153 int YPSpur_near_pos(int cs, double x, double y, double r);
154 int YPSpur_near_ang(int cs, double th, double d);
155 int YPSpur_over_line(int cs, double x, double y, double theta);
156 
158 int YPSpur_vel(double v, double w);
159 
161 int YPSpur_tilt(int cs, double dir, double tilt);
162 
163 /* 裏コマンド集 */
164 int YP_get_error_state(void);
165 
166 int YP_set_parameter(int param_id, double value);
167 int YP_set_parameter_array(int param_id, double *value);
168 int YP_get_parameter(int param_id, double *value);
169 int YP_get_parameter_array(int param_id, double *value);
170 int YP_set_control_state(int control_id, int state);
171 
172 int YP_get_ad_value(int num);
173 int YP_set_io_dir(unsigned char dir);
174 int YP_set_io_data(unsigned char data);
175 double YP_get_device_error_state(int id, int *err);
176 int YP_wheel_vel(double r, double l);
177 int YP_wheel_torque(double r, double l);
178 double YP_get_wheel_vel(double *wr, double *wl);
179 double YP_get_wheel_ang(double *theta_r, double *theta_l);
180 double YP_get_wheel_torque(double *torque_r, double *torque_l);
181 int YP_wheel_ang(double r, double l);
182 int YP_set_wheel_accel(double r, double l);
183 int YP_set_wheel_vel(double r, double l);
184 double YP_get_vref(double *vref, double *wref);
185 double YP_get_wheel_vref(double *wrref, double *wlref);
186 
187 int YP_joint_torque(int id, double t);
188 int YP_joint_vel(int id, double v);
189 int YP_joint_ang(int id, double a);
190 int YP_joint_ang_vel(int id, double a, double v);
191 int YP_set_joint_accel(int id, double a);
192 int YP_set_joint_vel(int id, double v);
193 double YP_get_joint_vel(int id, double *v);
194 double YP_get_joint_vref(int id, double *v);
195 double YP_get_joint_ang(int id, double *a);
196 double YP_get_joint_torque(int id, double *t);
197 
198 #define YPSPUR_JOINT_SUPPORT 1
199 #define YPSPUR_JOINT_ANG_VEL_SUPPORT 1
200 #define YPSPUR_GET_DEVICE_ERROR_STATE_SUPPORT 1
201 
202 #ifdef __cplusplus
203 }
204 #endif // __cplusplus
205 #endif // YPSPUR_H
double YP_get_wheel_vref(double *wrref, double *wlref)
Definition: libypspur.c:187
int YP_set_control_state(int control_id, int state)
Definition: libypspur.c:253
double YPSpur_get_force(double *trans, double *angular)
Definition: libypspur.c:211
int YPSpur_over_line(int cs, double x, double y, double theta)
Definition: libypspur.c:277
int YP_get_parameter_array(int param_id, double *value)
Definition: libypspur.c:247
double YP_get_joint_vref(int id, double *v)
Definition: libypspur.c:359
int YPSpur_initex(int msq_key)
Definition: libypspur.c:56
int YPSpur_tilt(int cs, double dir, double tilt)
Definition: libypspur.c:259
int YPSpur_near_ang(int cs, double th, double d)
Definition: libypspur.c:271
int YPSpur_unfreeze(void)
Definition: libypspur.c:115
int YPSpur_near_pos(int cs, double x, double y, double r)
Definition: libypspur.c:265
int YP_set_io_data(unsigned char data)
Definition: libypspur.c:293
int YP_get_ad_value(int num)
Definition: libypspur.c:283
double YP_get_joint_ang(int id, double *a)
Definition: libypspur.c:364
int YPSpur_vel(double v, double w)
Definition: libypspur.c:223
double YPSpur_get_vel(double *v, double *w)
Definition: libypspur.c:175
int YPSpur_set_pos(int cs, double x, double y, double theta)
Definition: libypspur.c:133
int YP_joint_ang_vel(int id, double a, double v)
Definition: libypspur.c:339
int YP_wheel_ang(double r, double l)
Definition: libypspur.c:319
int YPSpur_set_angaccel(double w)
Definition: libypspur.c:163
double YPSpur_get_pos(int cs, double *x, double *y, double *theta)
Definition: libypspur.c:169
int YP_wheel_vel(double r, double l)
Definition: libypspur.c:299
int YP_openfree(void)
Definition: libypspur.c:127
int YP_set_io_dir(unsigned char dir)
Definition: libypspur.c:288
int YPSpur_freeze(void)
Definition: libypspur.c:109
int YPSpur_circle(int cs, double x, double y, double r)
Definition: libypspur.c:85
double YP_get_joint_torque(int id, double *t)
Definition: libypspur.c:369
int YP_set_parameter(int param_id, double value)
Definition: libypspur.c:229
double YP_get_device_error_state(int id, int *err)
Definition: libypspur.c:50
int YPSpur_isfreeze(void)
Definition: libypspur.c:217
int YP_set_wheel_vel(double r, double l)
Definition: libypspur.c:309
int YP_get_parameter(int param_id, double *value)
Definition: libypspur.c:241
int YP_joint_ang(int id, double a)
Definition: libypspur.c:334
int YPSpur_spin(int cs, double theta)
Definition: libypspur.c:91
int YPSpur_set_angvel(double w)
Definition: libypspur.c:151
int YP_joint_torque(int id, double t)
Definition: libypspur.c:324
int YPSpur_line(int cs, double x, double y, double theta)
Definition: libypspur.c:73
int YPSpur_free(void)
Definition: libypspur.c:121
int YPSpur_init_socket(char *ip, int port)
Definition: libypspur.c:61
int YPSpur_stop(void)
Definition: libypspur.c:103
int YPSpur_set_vel(double v)
Definition: libypspur.c:145
int YPSpur_set_accel(double v)
Definition: libypspur.c:157
double YP_get_wheel_vel(double *wr, double *wl)
Definition: libypspur.c:193
int state(YPSpur_state id)
Definition: param.c:64
int YP_set_joint_vel(int id, double v)
Definition: libypspur.c:349
int YPSpur_stop_line(int cs, double x, double y, double theta)
Definition: libypspur.c:79
int YP_get_error_state(void)
Definition: libypspur.c:45
int YP_joint_vel(int id, double v)
Definition: libypspur.c:329
double YP_get_wheel_torque(double *torque_r, double *torque_l)
Definition: libypspur.c:205
int YPSpur_init(void)
Definition: libypspur.c:67
int YPSpur_adjust_pos(int cs, double x, double y, double theta)
Definition: libypspur.c:139
int YP_set_wheel_accel(double r, double l)
Definition: libypspur.c:314
int YP_set_parameter_array(int param_id, double *value)
Definition: libypspur.c:235
double YP_get_vref(double *vref, double *wref)
Definition: libypspur.c:181
double YP_get_joint_vel(int id, double *v)
Definition: libypspur.c:354
int YPSpur_orient(int cs, double theta)
Definition: libypspur.c:97
int YP_wheel_torque(double r, double l)
Definition: libypspur.c:304
double YP_get_wheel_ang(double *theta_r, double *theta_l)
Definition: libypspur.c:199
int YP_set_joint_accel(int id, double a)
Definition: libypspur.c:344


yp-spur
Author(s):
autogenerated on Sat May 11 2019 02:08:24