odometry.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 ODOMETRY_H
22 #define ODOMETRY_H
23 
24 #include <shvel-param.h>
25 
26 #include <cartesian2d.h>
27 #include <ypparam.h>
28 #include <ypspur.h>
29 
30 typedef struct _odometry *OdometryPtr;
31 typedef struct _odometry
32 {
33  double x;
34  double y;
35  double theta;
36  double v;
37  double w;
38  double time;
44  double torque_trans;
46 } Odometry;
47 
48 typedef struct _error_state *ErrorStatePtr;
49 typedef struct _error_state
50 {
53 } ErrorState;
54 
55 double time_estimate(int readnum);
56 void cstrans_odometry(YPSpur_cs cs, OdometryPtr dst_odm);
57 void cstrans_xy(YPSpur_cs src, YPSpur_cs dest, double *x, double *y, double *theta);
58 void odometry(OdometryPtr xp, short *cnt, short *pwm, double dt, double time);
59 void process_int(
60  OdometryPtr xp, ErrorStatePtr err, int param_id, int id, int value, double receive_time);
61 void odm_logging(OdometryPtr, double, double);
62 int odm_read(OdometryPtr odm, double *v, double *w);
63 void cs_odometry(YPSpur_cs cs, OdometryPtr dst_odm);
64 void init_odometry(void);
65 void init_coordinate_systems(void);
66 int odometry_receive_loop(void);
67 OdometryPtr get_odometry_ptr();
68 ErrorStatePtr get_error_state_ptr();
70 void set_cs(YPSpur_cs cs, double x, double y, double theta);
71 
72 #endif // ODOMETRY_H
double torque_angular
Definition: odometry.h:45
double y
Definition: odometry.h:34
struct _odometry Odometry
int enc_init[YP_PARAM_MAX_MOTOR_NUM]
Definition: odometry.h:42
int odm_read(OdometryPtr odm, double *v, double *w)
void cstrans_xy(YPSpur_cs src, YPSpur_cs dest, double *x, double *y, double *theta)
Definition: odometry.c:131
void odometry(OdometryPtr xp, short *cnt, short *pwm, double dt, double time)
Definition: odometry.c:144
void init_odometry(void)
Definition: odometry.c:80
void process_int(OdometryPtr xp, ErrorStatePtr err, int param_id, int id, int value, double receive_time)
Definition: odometry.c:247
double time
Definition: odometry.h:38
short enc[YP_PARAM_MAX_MOTOR_NUM]
Definition: odometry.h:41
double wang[YP_PARAM_MAX_MOTOR_NUM]
Definition: odometry.h:40
struct _odometry * OdometryPtr
Definition: odometry.h:30
void odm_logging(OdometryPtr, double, double)
int odometry_receive_loop(void)
Definition: odometry.c:585
double wtorque[YP_PARAM_MAX_MOTOR_NUM]
Definition: odometry.h:43
CSptr get_cs_pointer(YPSpur_cs cs)
Definition: odometry.c:102
double w
Definition: odometry.h:37
YPSpur_shvel_error_state
Definition: shvel-param.h:99
void cstrans_odometry(YPSpur_cs cs, OdometryPtr dst_odm)
Definition: odometry.c:316
double v
Definition: odometry.h:36
ErrorStatePtr get_error_state_ptr()
Definition: odometry.c:337
#define YP_PARAM_MAX_MOTOR_NUM
Definition: ypparam.h:430
double theta
Definition: odometry.h:35
double wvel[YP_PARAM_MAX_MOTOR_NUM]
Definition: odometry.h:39
void set_cs(YPSpur_cs cs, double x, double y, double theta)
Definition: odometry.c:138
double torque_trans
Definition: odometry.h:44
void cs_odometry(YPSpur_cs cs, OdometryPtr dst_odm)
OdometryPtr get_odometry_ptr()
Definition: odometry.c:332
int state(YPSpur_state id)
Definition: param.c:64
void init_coordinate_systems(void)
Definition: odometry.c:69
struct _error_state ErrorState
double time_estimate(int readnum)
時刻の推定 (n回目の計測結果の時刻を計算する)
Definition: odometry.c:346
YPSpur_cs
Definition: ypparam.h:462
double x
Definition: odometry.h:33
struct _error_state * ErrorStatePtr
Definition: odometry.h:48


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