]> 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 1e97b30c155438c43d13e8b013393f9c4706a070..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,60 +26,18 @@ of the robot.
 #ifndef ACTUATORS_H
 #define ACTUATORS_H
 
-/* Chelas: original values */
-//#define CHELA_CLOSED 0xFF
-//#define CHELA_TIGHT  0xA0
-//#define CHELA_OPEN   0x20
-//#define CHELA_LOOSE  0x80
-
-/* Chelas: */
-#define CHELA_CLOSED 0xFF
-//#define CHELA_TIGHT  0xD8
-#define CHELA_TIGHT  0xE0
-#define CHELA_OPEN   0x20
-#define CHELA_LOOSE  0xA8
-
-/* FIXME: (temporary, LPCs not ready) Timeout */
-#define CHELA_TIMEOUT 0x07
-
-/* Belts */
-#define BELTS_IN 0xA0  // 160
-#define BELTS_OFF 0x64 // 100
-#define BELTS_OUT 0x28 //  40
-
-#define LIFT_SHIFT             0x1C
-/* Positions of lift */
-#define LIFT_MIN               0x0
-#define LIFT_GROUND_POS                0x0028 // used for pucks loading
-#define LIFT_TRAVEL_POS                0x0030
-#define LIFT_BELOW_HOLDER_POS  0x00E0
-#define LIFT_IN_HOLDER_POS     0x0118
-#define LIFT_FLOOR0            0x0030 // used for unloading
-#define LIFT_FLOOR1            0x00E0
-#define LIFT_FLOOR2            0x01A0
-#define LIFT_FLOOR3            0x0264
-#define LIFT_FLOOR4            0x0322
-#define LIFT_MAX               0x03C0 // this is not the HW maximum
-
-/* Holder positions */
-#define HOLDER_CLOSED 0xFF
-#define HOLDER_TIGHT  0xE0
-#define HOLDER_LOOSE  0xDA
-#define HOLDER_OPENED 0x10
-
-/* Pusher position */
-#define PUSHER_INSIDE  0
-#define PUSHER_LINTEL_BOUNDARY 0xC0
-#define PUSHER_OUTSIDE PUSHER_LINTEL_BOUNDARY
-#define PUSHER_FULLY_OUTSIDE 0x200
-
-/* Hokuyo pitch angle limits */
+/* Hokuyo pitch angle limits */ // FIXME: obsolete: delete or update
 #define HOKUYO_PITCH_MAX       0xF8
 #define HOKUYO_PITCH_HORIZONTAL 0xC0
 #define HOKUYO_PITCH_MIN       0x00
 
-/* Actuators status bits */
-#define ACT_ST_LIFT_ERR 0x01   /* TODO */
+#include <stdint.h>
+
+typedef enum {  
+  OPEN,
+  CLOSE,
+  CATCH
+} jaws_cmds;
 
 #ifdef __cplusplus
 extern "C" {
@@ -86,12 +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);
-void act_hokuyo(unsigned char angle);
+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
 }