]> rtime.felk.cvut.cz Git - eurobot/public.git/blob - src/robofsm/actuators.c
actuators: added camera control functions
[eurobot/public.git] / src / robofsm / actuators.c
1 /*
2  * actuators.c                  09/02/25
3  *
4  * Robot's actuators control.
5  *
6  * Copyright: (c) 2008 CTU Dragons
7  *            CTU FEE - Department of Control Engineering
8  * License: GNU GPL v.2
9  */
10
11 #include <robot.h>
12 #include <actuators.h>
13
14 static struct robottype_orte_data *orte = NULL;
15
16 /* SERVOS */
17
18 void act_init(struct robottype_orte_data *ortedata)
19 {
20         orte = ortedata;
21 }
22
23 void act_lift(unsigned short int position)
24 {
25         orte->lift.pos = position;
26         ORTEPublicationSend(orte->publication_lift);
27 }
28
29 void act_chelae(unsigned char left, unsigned char right)
30 {
31         orte->chelae.left = left;
32         orte->chelae.right = right; // the hardware (chelae) responds asymetrically
33         ORTEPublicationSend(orte->publication_chelae);
34 }
35
36 void act_belts(unsigned char left, unsigned char right)
37 {
38         orte->belts.left = left;
39         orte->belts.right = right;
40         ORTEPublicationSend(orte->publication_belts);
41 }
42
43 void act_holder(unsigned char position)
44 {
45         orte->holder.pos = position;
46         ORTEPublicationSend(orte->publication_holder);
47 }
48
49 void act_pusher(unsigned short int position)
50 {
51         orte->pusher.pos = position;
52         ORTEPublicationSend(orte->publication_pusher);
53 }
54
55 void act_hokuyo(unsigned char angle)
56 {
57         orte->hokuyo_pitch.angle = angle;
58         ORTEPublicationSend(orte->publication_hokuyo_pitch);
59 }
60
61 void act_camera_on(void)
62 {
63         orte->camera_control.on = 1;
64         ORTEPublicationSend(orte->publication_camera_control);
65 }
66
67 void act_camera_off(void)
68 {
69         orte->camera_control.on = 0;
70         ORTEPublicationSend(orte->publication_camera_control);
71 }
72