diff --git a/UDPclient.depend b/UDPclient.depend index 471f30b..41a3082 100644 --- a/UDPclient.depend +++ b/UDPclient.depend @@ -29,7 +29,7 @@ -1392499886 source:/home/chch/HengLongUDPclient/main.c +1394056611 source:/home/chch/HengLongUDPclient/main.c @@ -51,13 +51,14 @@ "henglong.h" + "wansview.h" -1392494240 /home/chch/HengLongUDPclient/henglong.h +1393293088 /home/chch/HengLongUDPclient/henglong.h -1392494235 source:/home/chch/HengLongUDPclient/henglong.c +1393293088 source:/home/chch/HengLongUDPclient/henglong.c "henglong.h" 1393274981 source:/home/stefan/Proj/HengLongUDPclient/henglong.c @@ -101,3 +102,13 @@ 1393290504 source:/home/stefan/Proj/HengLongUDPclient/wansview.c "wansview.h" +1394056760 /home/chch/HengLongUDPclient/wansview.h + + + + + + +1394060723 source:/home/chch/HengLongUDPclient/wansview.c + "wansview.h" + diff --git a/bin/Debug/UDPclient b/bin/Debug/UDPclient index 7ac107e..f9247b9 100755 Binary files a/bin/Debug/UDPclient and b/bin/Debug/UDPclient differ diff --git a/client.config b/client.config index acf2378..6c13ef1 100644 --- a/client.config +++ b/client.config @@ -3,6 +3,6 @@ JOYSTICK /dev/input/js0 CAM 192.168.1.23 CAMINTERVAL 100000 FRAME_US 100000 -SERVER 10.8.245.47:32000 +SERVER 192.168.1.18:32000 TIMEOUT 250 CLINBR 0 diff --git a/main.c b/main.c index ec7e44c..a836f24 100644 --- a/main.c +++ b/main.c @@ -89,19 +89,6 @@ void *keyboard_thread_fcn(void * arg) args->outtty.motor_r = (2*0b01111 - args->hl.velocity - args->hl.direction)*40; args->outtty.motor_l = (- args->hl.velocity + args->hl.direction)*40; - /* - args->outtty.servo_pan += args->hl.pan_left - args->hl.pan_right; - if(args->outtty.servo_pan>50) args->outtty.servo_pan = 50; - if(args->outtty.servo_pan<-50) args->outtty.servo_pan = -50; - if(args->outtty.servo_tilt>50) args->outtty.servo_tilt = 50; - if(args->outtty.servo_tilt<-50) args->outtty.servo_tilt = -50; - args->outtty.servo_tilt += args->hl.tilt_up - args->hl.tilt_down; - if(args->hl.ignation) { - args->outtty.servo_pan = 0; - args->outtty.servo_tilt= 0; - } - */ - } // quit @@ -335,7 +322,7 @@ henglongconf_t getconfig(char* conffilename) typedef struct cam_ctrl_thread_t { char* ip; - int up, down, cw, ccw, end; + int up, down, cw, ccw, nul, end; uint32_t caminterval; } cam_ctrl_thread_t; @@ -354,6 +341,10 @@ void *cam_ctrl_thread_fcn(void* arg) if(args->down) cam_down(args->ip); if(args->cw) cam_cw(args->ip); if(args->ccw) cam_ccw(args->ip); + if(args->nul) { + cam_nul(args->ip); + args->nul = 0; + } } pthread_exit(0); @@ -363,8 +354,6 @@ void *cam_ctrl_thread_fcn(void* arg) int main(int argc, char* argv[]) { - - pthread_t keybthread, joythread, refl_thread, cam_ctrl_thread; input_thread_t keyboard_thread_args; input_thread_t joystick_thread_args; @@ -434,6 +423,7 @@ int main(int argc, char* argv[]) frame_nbr = 0; senddata.outtty.servo_pan = 0; senddata.outtty.servo_tilt = 0; + cam_ctrl_thread_args.nul = 1; while(1){ usleep(conf.frame_us); @@ -485,6 +475,7 @@ int main(int argc, char* argv[]) if(keyboard_thread_args.hl.ignation | joystick_thread_args.hl.ignation){ senddata.outtty.servo_pan = 0; senddata.outtty.servo_tilt = 0; + cam_ctrl_thread_args.nul = 1; } if(1022 #include +#include int wvcamctrl(char* ip, int cmd); @@ -13,5 +14,6 @@ int cam_down(char* ip); int cam_up(char* ip); int cam_cw(char* ip); int cam_ccw(char* ip); +int cam_nul(char* ip); #endif // WANSVIEW_H_INCLUDED