]> 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 472a0ade25ec95583f531f2cee1f568f76632bde..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,47 +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
+/* Hokuyo pitch angle limits */ // FIXME: obsolete: delete or update
+#define HOKUYO_PITCH_MAX       0xF8
+#define HOKUYO_PITCH_HORIZONTAL 0xC0
+#define HOKUYO_PITCH_MIN       0x00
 
-/* Chelas: */
-#define CHELA_CLOSED 0xFF
-#define CHELA_TIGHT  0xD8
-#define CHELA_OPEN   0x20
-#define CHELA_LOOSE  0xA8
+#include <stdint.h>
 
-/* 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             0xE
-/* Positions of lift */
-#define LIFT_GROUND_POS                0x001A
-#define LIFT_BELOW_HOLDER_POS  0x00E0
-#define LIFT_FLOOR1            0x00E0
-#define LIFT_FLOOR2            0x01A0
-#define LIFT_FLOOR3            0x0264
-#define LIFT_FLOOR4            0x0322
-#define FLOOR2 3478
-
-/* Holder positions */
-#define HOLDER_CLOSED 0xFF
-#define HOLDER_LOOSE  0xD0
-#define HOLDER_OPENED 0
-
-/* 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" {
@@ -73,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
 }