]> rtime.felk.cvut.cz Git - eurobot/public.git/commitdiff
joyd: Update actuator positions and assign buttons for jaw actuator.
authorMichal Vokac <vokac.m@gmail.com>
Tue, 3 May 2011 18:35:02 +0000 (20:35 +0200)
committerMichal Vokac <vokac.m@gmail.com>
Tue, 3 May 2011 18:35:02 +0000 (20:35 +0200)
src/joyd/joyd.cc

index 380109875494ea6ebc112ffd7627123857d99703..090c798da120981ea2ccfe5c43ebdc2a2735e0ce 100644 (file)
@@ -63,6 +63,7 @@ static void button_act(char state, int id)
                case BT1:
                        if(state) {
                                //act ON
+                               act_jaws(CATCH);
                        } else {
                                ;//act OFF
                        }
@@ -154,9 +155,11 @@ static void process_axis(int value, int id)
                case AXIS_S1:
                        switch (value) {
                        case 32767:
+                               act_jaws(CLOSE);
                                printf("jaws CLOSE\n");
                                break;
                        case -32767:
+                               act_jaws(OPEN);
                                printf("jaws OPEN\n");
                                break;
                        case 0:
@@ -170,11 +173,11 @@ static void process_axis(int value, int id)
                case AXIS_S2:
                        switch (value) {
                        case 32767:
-                               act_lift(40000, 0);
+                               act_lift(0, 0);
                                printf("lift DOWN\n");
                                break;
                        case -32767:
-                               act_lift(2000, 0);
+                               act_lift(0x190, 0);
                                printf("lift UP\n");
                                break;
                        case 0:
@@ -286,6 +289,7 @@ int main(int argc, char *argv[])
        /* creating publishers */
        robottype_publisher_motion_speed_create(&orte, send_dummy_cb, &orte);
        robottype_publisher_lift_cmd_create(&orte, send_dummy_cb, &orte);
+       robottype_publisher_jaws_cmd_create(&orte, send_dummy_cb, &orte);
 
        if(open_joystick(joy_name, &num_of_axis, &num_of_buttons) == -1) {
                printf("Joystick not found, exiting...\n");