control.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 CONTROL_H
22 #define CONTROL_H
23 
24 #include <command.h>
25 #include <odometry.h>
26 
32 
34 
35 double timeoptimal_servo(double err, double vel_max, double vel, double acc);
36 double timeoptimal_servo2(double err, double vel_max, double vel, double acc, double vel_end);
37 
39 double trans_q(double theta);
40 
48 void wheel_torque(OdometryPtr odm, SpurUserParamsPtr spur, double *torque);
49 
50 double regurator(double d, double q, double r, double v_max, double w_max, SpurUserParamsPtr spur);
51 
54 void control_loop(void);
55 
56 void init_control_thread(pthread_t *thread);
57 
58 void set_run_mode(SpurRunMode mode);
60 
61 #endif // CONTROL_H
double trans_q(double theta)
void robot_speed(SpurUserParamsPtr spur)
SpurRunMode get_run_mode(void)
void update_ref_speed(SpurUserParamsPtr spur)
int robot_speed_smooth(SpurUserParamsPtr spur)
double spin(OdometryPtr odm, SpurUserParamsPtr spur)
double dist_pos(OdometryPtr odm, SpurUserParamsPtr spur)
void wheel_vel(OdometryPtr odm, SpurUserParamsPtr spur)
void odometry(OdometryPtr xp, short *cnt, short *pwm, double dt, double time)
Definition: odometry.c:144
double timeoptimal_servo(double err, double vel_max, double vel, double acc)
void apply_motor_torque(SpurUserParamsPtr spur)
void run_control(Odometry odometry, SpurUserParamsPtr spur)
void init_control_thread(pthread_t *thread)
void set_run_mode(SpurRunMode mode)
static YPSpur spur
Definition: libypspur.c:42
SpurRunMode
Definition: command.h:28
double gravity_compensation(OdometryPtr odm, SpurUserParamsPtr spur)
double line_follow(OdometryPtr odm, SpurUserParamsPtr spur)
double timeoptimal_servo2(double err, double vel_max, double vel, double acc, double vel_end)
void wheel_angle(OdometryPtr odm, SpurUserParamsPtr spur)
double orient(OdometryPtr odm, SpurUserParamsPtr spur)
double circle_follow(OdometryPtr odm, SpurUserParamsPtr spur)
void apply_motor_speed(SpurUserParamsPtr spur)
void wheel_torque(OdometryPtr odm, SpurUserParamsPtr spur, double *torque)
void control_loop(void)
double regurator(double d, double q, double r, double v_max, double w_max, SpurUserParamsPtr spur)
int stop_line(OdometryPtr odm, SpurUserParamsPtr spur)
int motor_control(SpurUserParamsPtr spur)


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