From b659765d587bc252307cb526b5e663721cc7dfce Mon Sep 17 00:00:00 2001 From: pokormat Date: Thu, 5 May 2011 20:23:57 +0200 Subject: [PATCH] eb_jaws_11: update jaws min, max position robofsm: update jaws min, max position, now is open, close, catch values as defines in header file --- src/eb_jaws_11/main.c | 8 ++++---- src/robofsm/actuators.c | 18 +++++++++--------- src/robofsm/actuators.h | 9 +++++++++ 3 files changed, 22 insertions(+), 13 deletions(-) diff --git a/src/eb_jaws_11/main.c b/src/eb_jaws_11/main.c index 434642bc..68eea98b 100644 --- a/src/eb_jaws_11/main.c +++ b/src/eb_jaws_11/main.c @@ -358,14 +358,14 @@ int main(void) //close jaw, max_pos, open jaw min_pos //letf jaw potenciometer on ADC 0, header J32 on board - fsm_jaw_left.max_pos=0x310; //max 0x324 - fsm_jaw_left.min_pos=0xB0; //min 0xC0 + fsm_jaw_left.max_pos=0x320; //max 0x324 + fsm_jaw_left.min_pos=0xB0; //min 0xC3 fsm_jaw_left.act_pos = adc_val[0]; //close jaw, max_pos, open jaw min_pos //letf jaw potenciometer on ADC 1, header J33 on board - fsm_jaw_right.max_pos=0x370; //max 0x382 - fsm_jaw_right.min_pos=0x080; //min 0x8D + fsm_jaw_right.max_pos=0x380; //max 0x382 + fsm_jaw_right.min_pos=0x010; //min 0xF5 fsm_jaw_right.act_pos = adc_val[1]; //left jaw engine is engine A, conector MOTA on board diff --git a/src/robofsm/actuators.c b/src/robofsm/actuators.c index 1d8cfb5f..4ca6d166 100644 --- a/src/robofsm/actuators.c +++ b/src/robofsm/actuators.c @@ -58,20 +58,20 @@ void act_jaws(jaws_cmds cmd) { switch (cmd) { case OPEN: - orte->jaws_cmd.req_pos.left=0x1C3; - orte->jaws_cmd.req_pos.right=0x1B3; - break; + orte->jaws_cmd.req_pos.left = JAW_LEFT_OPEN; + orte->jaws_cmd.req_pos.right = JAW_RIGHT_OPEN; + break; case CLOSE: - orte->jaws_cmd.req_pos.left=0x30F; - orte->jaws_cmd.req_pos.right=0x36F; + orte->jaws_cmd.req_pos.left = JAW_LEFT_CLOSE; + orte->jaws_cmd.req_pos.right = JAW_RIGHT_CLOSE; break; case CATCH: - orte->jaws_cmd.req_pos.left = 0x25F; - orte->jaws_cmd.req_pos.right = 0x27F; + orte->jaws_cmd.req_pos.left = JAW_LEFT_CATCH; + orte->jaws_cmd.req_pos.right = JAW_RIGHT_CATCH; break; default: - orte->jaws_cmd.req_pos.left=0x1C3; - orte->jaws_cmd.req_pos.right=0x1B3; + orte->jaws_cmd.req_pos.left = JAW_LEFT_OPEN; + orte->jaws_cmd.req_pos.right = JAW_RIGHT_OPEN; } } diff --git a/src/robofsm/actuators.h b/src/robofsm/actuators.h index 09b198f5..cf76f34d 100644 --- a/src/robofsm/actuators.h +++ b/src/robofsm/actuators.h @@ -39,6 +39,15 @@ typedef enum { CATCH } jaws_cmds; +#define JAW_LEFT_OPEN 0x1C3 +#define JAW_RIGHT_OPEN 0x1B3 + +#define JAW_LEFT_CLOSE 0x31F +#define JAW_RIGHT_CLOSE 0x37F + +#define JAW_LEFT_CATCH 0x25F +#define JAW_RIGHT_CATCH 0x27F + #ifdef __cplusplus extern "C" { #endif -- 2.39.2