]> rtime.felk.cvut.cz Git - eurobot/public.git/blob - src/robofsm/actuators.h
actuators.h: LIFT_SHIFT increased
[eurobot/public.git] / src / robofsm / actuators.h
1 /**
2  * @file actuators.h
3  * @author Martin Zidek
4  * @date 09/03/25
5  *
6  * @brief Acttuators library
7  */
8
9 /*
10  * actuators.h                  09/02/25
11  *
12  * Robot's actuators control.
13  *
14  * Copyright: (c) 2008 CTU Dragons
15  *            CTU FEE - Department of Control Engineering
16  * License: GNU GPL v.2
17  */
18 /**
19 \defgroup actlib Actuators control library
20
21 Actuators library serves as a single control point for all the actuators 
22 of the robot.
23  */
24
25 #ifndef ACTUATORS_H
26 #define ACTUATORS_H
27
28 /* Chelas: original values */
29 //#define CHELA_CLOSED 0xFF
30 //#define CHELA_TIGHT  0xA0
31 //#define CHELA_OPEN   0x20
32 //#define CHELA_LOOSE  0x80
33
34 /* Chelas: */
35 #define CHELA_CLOSED 0xFF
36 //#define CHELA_TIGHT  0xD8
37 #define CHELA_TIGHT  0xE0
38 #define CHELA_OPEN   0x20
39 #define CHELA_LOOSE  0xA8
40
41 /* FIXME: (temporary, LPCs not ready) Timeout */
42 #define CHELA_TIMEOUT 0x07
43
44 /* Belts */
45 #define BELTS_IN 0xA0  // 160
46 #define BELTS_OFF 0x64 // 100
47 #define BELTS_OUT 0x28 //  40
48
49 #define LIFT_SHIFT              0x21
50 /* Positions of lift */
51 #define LIFT_MIN                0x0
52 #define LIFT_GROUND_POS         0x0028 // used for pucks loading
53 #define LIFT_TRAVEL_POS         0x0030
54 #define LIFT_BELOW_HOLDER_POS   0x00E0
55 #define LIFT_IN_HOLDER_POS      0x0118
56 #define LIFT_FLOOR0             0x0030 // used for unloading
57 #define LIFT_FLOOR1             0x00E0
58 #define LIFT_FLOOR2             0x01A0
59 #define LIFT_FLOOR3             0x0264
60 #define LIFT_FLOOR4             0x0322
61 #define LIFT_MAX                0x03C0 // this is not the HW maximum
62
63 /* Holder positions */
64 #define HOLDER_CLOSED 0xFF
65 #define HOLDER_TIGHT  0xE0
66 #define HOLDER_LOOSE  0xDA
67 #define HOLDER_OPENED 0x10
68
69 /* Pusher position */
70 #define PUSHER_INSIDE  0
71 #define PUSHER_LINTEL_BOUNDARY 0xC0
72 #define PUSHER_OUTSIDE PUSHER_LINTEL_BOUNDARY
73 #define PUSHER_FULLY_OUTSIDE 0x200
74
75 /* Hokuyo pitch angle limits */
76 #define HOKUYO_PITCH_MAX        0xF8
77 #define HOKUYO_PITCH_HORIZONTAL 0xC0
78 #define HOKUYO_PITCH_MIN        0x00
79
80 /* Actuators status bits */
81 #define ACT_ST_LIFT_ERR 0x01    /* TODO */
82
83 #ifdef __cplusplus
84 extern "C" {
85 #endif 
86
87 void act_init(struct robottype_orte_data *ortedata);
88
89 void act_lift(unsigned short int position);
90 void act_chelae(unsigned char left, unsigned char right);
91 void act_belts(unsigned char left, unsigned char right);
92 void act_holder(unsigned char position);
93 void act_pusher(unsigned short int position);
94 void act_hokuyo(unsigned char angle);
95 void act_camera_on(void);
96 void act_camera_off(void);
97
98 #ifdef __cplusplus
99 }
100 #endif 
101
102 #endif /* ACTUATORS_H */