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
dist_pos
double dist_pos(OdometryPtr odm, SpurUserParamsPtr spur)
Definition: control_motion.c:172
wheel_vel
void wheel_vel(OdometryPtr odm, SpurUserParamsPtr spur)
Definition: control_vehicle.c:279
_odometry
Definition: odometry.h:31
apply_motor_torque
void apply_motor_torque(SpurUserParamsPtr spur)
Definition: control_vehicle.c:208
trans_q
double trans_q(double theta)
Definition: control_motion.c:54
robot_speed
void robot_speed(SpurUserParamsPtr spur)
Definition: control_vehicle.c:244
run_control
void run_control(Odometry odometry, SpurUserParamsPtr spur)
Definition: control_vehicle.c:511
update_ref_speed
void update_ref_speed(SpurUserParamsPtr spur)
Definition: control_vehicle.c:229
timeoptimal_servo
double timeoptimal_servo(double err, double vel_max, double vel, double acc)
Definition: control_motion.c:224
init_control_thread
void init_control_thread(pthread_t *thread)
Definition: control_vehicle.c:671
spin
double spin(OdometryPtr odm, SpurUserParamsPtr spur)
Definition: control_motion.c:134
odometry.h
gravity_compensation
double gravity_compensation(OdometryPtr odm, SpurUserParamsPtr spur)
Definition: control_vehicle.c:439
set_run_mode
void set_run_mode(SpurRunMode mode)
command.h
circle_follow
double circle_follow(OdometryPtr odm, SpurUserParamsPtr spur)
Definition: control_motion.c:64
line_follow
double line_follow(OdometryPtr odm, SpurUserParamsPtr spur)
Definition: control_motion.c:90
wheel_torque
void wheel_torque(OdometryPtr odm, SpurUserParamsPtr spur, double *torque)
Definition: control_vehicle.c:315
apply_motor_speed
void apply_motor_speed(SpurUserParamsPtr spur)
Definition: control_vehicle.c:137
_spur_user_params
Definition: command.h:55
timeoptimal_servo2
double timeoptimal_servo2(double err, double vel_max, double vel, double acc, double vel_end)
Definition: control_motion.c:253
wheel_angle
void wheel_angle(OdometryPtr odm, SpurUserParamsPtr spur)
Definition: control_vehicle.c:297
SpurRunMode
SpurRunMode
Definition: command.h:28
orient
double orient(OdometryPtr odm, SpurUserParamsPtr spur)
Definition: control_motion.c:153
stop_line
int stop_line(OdometryPtr odm, SpurUserParamsPtr spur)
Definition: control_motion.c:181
regurator
double regurator(double d, double q, double r, double v_max, double w_max, SpurUserParamsPtr spur)
Definition: control_motion.c:103
control_loop
void control_loop(void)
Definition: control_vehicle.c:461
motor_control
int motor_control(SpurUserParamsPtr spur)
Definition: control_vehicle.c:60
odometry
void odometry(OdometryPtr xp, short *cnt, short *pwm, double dt, double time)
Definition: odometry.c:145
robot_speed_smooth
int robot_speed_smooth(SpurUserParamsPtr spur)
Definition: control_vehicle.c:335
spur
static YPSpur spur
Definition: libypspur.c:42
get_run_mode
SpurRunMode get_run_mode(void)


yp-spur
Author(s):
autogenerated on Fri Oct 20 2023 03:02:42