/**
* @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
*/
/*
*
* 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
*/
#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" {
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
}