Update of /cvsroot/playerstage/code/player/utils/playerjoy
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2377/utils/playerjoy

Modified Files:
        playerjoy.cc 
Log Message:
Added car-like velocity command to obot driver, -dev jsdev option to playerjoy

Index: playerjoy.cc
===================================================================
RCS file: /cvsroot/playerstage/code/player/utils/playerjoy/playerjoy.cc,v
retrieving revision 1.36
retrieving revision 1.37
diff -C2 -d -r1.36 -r1.37
*** playerjoy.cc        10 Jul 2006 16:55:38 -0000      1.36
--- playerjoy.cc        20 Sep 2006 22:55:04 -0000      1.37
***************
*** 42,45 ****
--- 42,46 ----
  - -speed     : maximum linear speed (m/sec)
  - -turnspeed : maximum angular speed (deg/sec)
+ - -dev <dev> : Joystick device file (default /dev/js0)
  - <host:port> : connect to a Player on this host and port
  
***************
*** 111,114 ****
--- 112,116 ----
    "       -speed     : maximum linear speed (m/sec)\n" \
    "       -turnspeed : maximum angular speed (deg/sec)\n" \
+   "       -dev <dev> : joystick device file (default /dev/js0)\n" \
    "       <host:port> : connect to a Player on this host and port\n"
  
***************
*** 208,211 ****
--- 210,216 ----
  double max_speed = 0.500; // m/second
  double max_turn = DTOR(60); // rad/second
+ char jsdev[PATH_MAX]; // joystick device file
+ 
+ #define DEFAULT_DEV "/dev/js0"
  
  // this is the speed that the camera will pan when you press the
***************
*** 631,634 ****
--- 636,649 ----
      }
        }
+     else if( strcmp( argv[i], "-dev" ) == 0 )
+       {
+         if(i++ < argc)
+           strncpy(jsdev,argv[i],PATH_MAX);
+         else
+         {
+           puts(USAGE);
+           exit(-1);
+         }
+       }
  /*    else if( strcmp( argv[i], "-udp" ) == 0 )
        protocol = PLAYER_TRANSPORT_UDP;*/
***************
*** 653,657 ****
    {
  #if JOYSTICK_SUPPORT
!     jfd = open ("/dev/js0", O_RDONLY);
  
      if(jfd < 1)
--- 668,675 ----
    {
  #if JOYSTICK_SUPPORT
!     if(!strlen(jsdev))
!       jfd = open (DEFAULT_DEV, O_RDONLY);
!     else
!       jfd = open (jsdev, O_RDONLY);
  
      if(jfd < 1)


-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys -- and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Playerstage-commit mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/playerstage-commit

Reply via email to