command_aux.c
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 #include <math.h>
22 #include <stdio.h>
23 #include <strings.h>
24 #include <unistd.h>
25 
26 #include <fcntl.h>
27 #include <sys/time.h>
28 #include <sys/types.h>
29 #include <time.h>
30 
31 #ifdef HAVE_CONFIG_H
32 #include <config.h>
33 #endif // HAVE_CONFIG_H
34 
35 /* ボディパラメータ */
36 #include <shvel-param.h>
37 
38 /* yp-spur用 */
39 #include <serial.h>
40 #include <adinput.h>
41 #include <param.h>
42 #include <odometry.h>
43 
44 /* ライブラリ用 */
45 #include <ypspur.h>
46 #include <cartesian2d.h>
47 
48 void get_ad_com(double *data, double *resdata)
49 {
50  int num;
51 
52  num = (int)data[0];
53  resdata[0] = get_addata(num);
54 }
55 
56 void set_io_dir_com(double *data, double *resdata)
57 {
58  int num;
59 
60  num = (int)data[0];
61  parameter_set(PARAM_io_dir, 0, num);
62 }
63 
64 void set_io_data_com(double *data, double *resdata)
65 {
66  int num;
67 
68  num = (int)data[0];
70 }
71 
72 void get_error_state_com(double *data, double *resdata)
73 {
74  int num = (int)data[0];
76 
77  resdata[0] = err->state[num];
78  resdata[1] = err->time[num];
79 }
void get_ad_com(double *data, double *resdata)
Definition: command_aux.c:48
int parameter_set(char param, char id, long long int value64)
Definition: param.c:379
ErrorStatePtr get_error_state_ptr()
Definition: odometry.c:337
void set_io_dir_com(double *data, double *resdata)
Definition: command_aux.c:56
void set_io_data_com(double *data, double *resdata)
Definition: command_aux.c:64
int get_addata(int num)
Definition: adinput.c:76
void get_error_state_com(double *data, double *resdata)
Definition: command_aux.c:72
double time[YP_PARAM_MAX_MOTOR_NUM]
Definition: odometry.h:52
YPSpur_shvel_error_state state[YP_PARAM_MAX_MOTOR_NUM]
Definition: odometry.h:51


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