]> rtime.felk.cvut.cz Git - eurobot/public.git/blobdiff - src/robofsm/actuators.h
robofsm: Fix jaw actuator function parameter and update position for holding figure.
[eurobot/public.git] / src / robofsm / actuators.h
index 7f6d053657e856614e6f241fe7f95833a8d6cecc..09b198f5e9072c3d0347c58b33ea577d6492f821 100644 (file)
@@ -1,9 +1,10 @@
 /**
  * @file actuators.h
  * @author Martin Zidek
- * @date 09/03/25
+ * @author Filip Jares (?)
+ * @date 2009-2010
  *
- * @brief Acttuators library
+ * @brief Robot's actuators control library
  */
 
 /*
@@ -11,7 +12,7 @@
  *
  * Robot's actuators control.
  *
- * Copyright: (c) 2008 CTU Dragons
+ * Copyright: (c) 2008-2010 CTU Dragons
  *            CTU FEE - Department of Control Engineering
  * License: GNU GPL v.2
  */
@@ -25,35 +26,18 @@ of the robot.
 #ifndef ACTUATORS_H
 #define ACTUATORS_H
 
-/* Chelas */
-#define CHELA_CLOSED 0xFF
-#define CHELA_TIGHT  0xA0
-#define CHELA_OPEN   0x20
-#define CHELA_LOOSE  0x80
+/* Hokuyo pitch angle limits */ // FIXME: obsolete: delete or update
+#define HOKUYO_PITCH_MAX       0xF8
+#define HOKUYO_PITCH_HORIZONTAL 0xC0
+#define HOKUYO_PITCH_MIN       0x00
 
-/* FIXME: (temporary, LPCs not ready) Timeout */
-#define CHELA_TIMEOUT 0x07
+#include <stdint.h>
 
-/* Belts */
-#define BELTS_IN 0xA0  // 160
-#define BELTS_OFF 0x64 // 100
-#define BELTS_OUT 0x28 //  40
-
-/* Positions of lift */
-#define FLOOR1 647
-#define FLOOR2 3478
-
-/* Holder positions */
-#define HOLDER_CLOSED 0
-#define HOLDER_OPEN_MID 20
-#define HOLDER_OPENED 100
-
-/* Pusher position */
-#define PUSHER_INSIDE 0
-#define PUSHER_OUTSIDE 100
-
-/* Actuators status bits */
-#define ACT_ST_LIFT_ERR 0x01   /* TODO */
+typedef enum {  
+  OPEN,
+  CLOSE,
+  CATCH
+} jaws_cmds;
 
 #ifdef __cplusplus
 extern "C" {
@@ -61,15 +45,15 @@ extern "C" {
 
 void act_init(struct robottype_orte_data *ortedata);
 
-void act_lift(unsigned short int position);
-void act_chelae(unsigned char left, unsigned char right);
-void act_belts(unsigned char left, unsigned char right);
-void act_holder(unsigned char position);
-void act_pusher(unsigned short int position);
-/* FIXME: temporary function (LPCs not ready yet) */
-void act_picker(unsigned char leftchela, unsigned char rightchela, 
-               unsigned char leftbelt, unsigned char rightbelt, 
-               unsigned char timeout);
+void act_camera_on(void);
+void act_camera_off(void);
+
+void act_lift(uint16_t position, char speed);
+void act_jaws(jaws_cmds cmd);
+
+uint16_t act_jaw_left_get_last_reqest(void);
+uint16_t act_jaw_right_get_last_reqest(void);
+uint16_t act_lift_get_last_reqest(void);
 
 #ifdef __cplusplus
 }