printf("Publishing commands: right %d left %d\n", orte.motion_speed.right, orte.motion_speed.left);
}
-/* Hokuyo handling ********************************** */
-
-static int hokuyo_pitch_angle = HOKUYO_PITCH_HORIZONTAL;
-#define HOKUYO_STEP 8
-
-static void change_hokuyo_pitch_angle_by(signed char delta)
-{
- hokuyo_pitch_angle += delta;
- if (hokuyo_pitch_angle > HOKUYO_PITCH_MAX)
- hokuyo_pitch_angle = HOKUYO_PITCH_MAX;
- else if (hokuyo_pitch_angle < HOKUYO_PITCH_MIN)
- hokuyo_pitch_angle = HOKUYO_PITCH_MIN;
- act_hokuyo(hokuyo_pitch_angle);
- printf("hokuyo pitch angle set to %d\n", hokuyo_pitch_angle);
-}
-
-static void set_hokuyo_pitch_horizontal()
-{
- hokuyo_pitch_angle = HOKUYO_PITCH_HORIZONTAL;
- act_hokuyo(hokuyo_pitch_angle);
- printf("hokuyo pitch angle set to %d\n", hokuyo_pitch_angle);
-}
-
/* ************************************************** */
static void button_act(char state, int id)
/* creating publishers */
robottype_publisher_motion_speed_create(&orte, send_dummy_cb, &orte);
- robottype_publisher_hokuyo_pitch_create(&orte, send_dummy_cb, &orte);
if(open_joystick(joy_name, &num_of_axis, &num_of_buttons) == -1) {
printf("Joystick not found, exiting...\n");
axis_prev = (int *) calloc( num_of_axis, sizeof( int ) );
buttons_prev = (char *) calloc( num_of_buttons, sizeof( char ) );
- /* hokuyo pitch angle initialization */
- set_hokuyo_pitch_horizontal();
-
while(1) {
timer.tv_sec = 0;
timer.tv_nsec = 100000000;