Home
FAQ
Player
Stage
Gazebo
Contrib
Documentation
Publications
Contributors
Users

Project
Download
Bugs/Feedback
Mailing lists

Radish

Old news
Old stuff

playerjoy.cc File Reference

#include <termios.h>
#include <assert.h>
#include <unistd.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <sys/ioctl.h>
#include <fcntl.h>
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <playerclient.h>
#include <time.h>
#include <pthread.h>
#include <list>

Defines

#define KEYBOARD_SUPPORT   1
#define JOYSTICK_SUPPORT   0
#define USAGE
#define DEFAULT_HOST   "localhost"
#define DEFAULT_PORT   PLAYER_PORTNUM
#define KEYCODE_I   0x69
#define KEYCODE_J   0x6a
#define KEYCODE_K   0x6b
#define KEYCODE_L   0x6c
#define KEYCODE_Q   0x71
#define KEYCODE_Z   0x7a
#define KEYCODE_W   0x77
#define KEYCODE_X   0x78
#define KEYCODE_E   0x65
#define KEYCODE_C   0x63
#define KEYCODE_U   0x75
#define KEYCODE_O   0x6F
#define KEYCODE_M   0x6d
#define KEYCODE_COMMA   0x2c
#define KEYCODE_PERIOD   0x2e
#define COMMAND_TIMEOUT_SEC   0.2
#define XAXIS   0
#define YAXIS   1
#define XAXIS2   2
#define YAXIS2   3
#define PAN   4
#define TILT   5
#define XAXIS4   6
#define YAXIS4   7
#define AXIS_MAX   32767.0
#define PERCENT(X)   ((X) * 100.0 / AXIS_MAX)
#define PERCENT_POSITIVE(X)   (((PERCENT(X)) + 100.0) / 2.0)
#define KNORMALIZE(X)   ((((X) * 1024.0 / AXIS_MAX)+1024.0) / 2.0)
#define NORMALIZE_SPEED(X)   ( (X) * max_speed / AXIS_MAX )
#define NORMALIZE_TURN(X)   ( (X) * max_turn / AXIS_MAX )

Typedefs

typedef std::list< Client * > ClientList

Functions

void * keyboard_handler (void *arg)
int main (int argc, char **argv)

Variables

int idx = 0
int g_verbose = false
bool threed = false
bool always_command = false
bool debug_mode = false
bool print_speeds = false
bool use_keyboard = false
int jfd
int protocol = PLAYER_TRANSPORT_TCP
double max_speed = 0.500
double max_turn = DTOR(60)


Define Documentation

#define KEYBOARD_SUPPORT   1
 

#define JOYSTICK_SUPPORT   0
 

#define USAGE
 

Value:

"USAGE: playerjoy [options] <host:port> [<host:port>] ... \n" \
  "       -v   : verbose mode; print Player device state on stdout\n" \
  "       -3d  : connect to position3d interface (instead of position)\n" \
  "       -c   : continuously send commands\n" \
  "       -n   : dont send commands or enable motors (debugging)\n" \
  "       -k   : use keyboard control\n" \
  "       -p   : print out speeds on the console\n" \
  "       -udp : use UDP instead of TCP\n" \
  "       -speed     : maximum linear speed (m/sec)\n" \
  "       -turnspeed : maximum angular speed (deg/sec)\n" \
  "       <host:port> : connect to a Player on this host and port\n"

#define DEFAULT_HOST   "localhost"
 

#define DEFAULT_PORT   PLAYER_PORTNUM
 

#define KEYCODE_I   0x69
 

#define KEYCODE_J   0x6a
 

#define KEYCODE_K   0x6b
 

#define KEYCODE_L   0x6c
 

#define KEYCODE_Q   0x71
 

#define KEYCODE_Z   0x7a
 

#define KEYCODE_W   0x77
 

#define KEYCODE_X   0x78
 

#define KEYCODE_E   0x65
 

#define KEYCODE_C   0x63
 

#define KEYCODE_U   0x75
 

#define KEYCODE_O   0x6F
 

#define KEYCODE_M   0x6d
 

#define KEYCODE_COMMA   0x2c
 

#define KEYCODE_PERIOD   0x2e
 

#define COMMAND_TIMEOUT_SEC   0.2
 

#define XAXIS   0
 

#define YAXIS   1
 

#define XAXIS2   2
 

#define YAXIS2   3
 

#define PAN   4
 

#define TILT   5
 

#define XAXIS4   6
 

#define YAXIS4   7
 

#define AXIS_MAX   32767.0
 

#define PERCENT  )     ((X) * 100.0 / AXIS_MAX)
 

#define PERCENT_POSITIVE  )     (((PERCENT(X)) + 100.0) / 2.0)
 

#define KNORMALIZE  )     ((((X) * 1024.0 / AXIS_MAX)+1024.0) / 2.0)
 

#define NORMALIZE_SPEED  )     ( (X) * max_speed / AXIS_MAX )
 

#define NORMALIZE_TURN  )     ( (X) * max_turn / AXIS_MAX )
 


Typedef Documentation

typedef std::list<Client*> ClientList
 


Function Documentation

void* keyboard_handler void *  arg  ) 
 

int main int  argc,
char **  argv
 


Variable Documentation

int idx = 0
 

int g_verbose = false
 

bool threed = false
 

bool always_command = false
 

bool debug_mode = false
 

bool print_speeds = false
 

bool use_keyboard = false
 

int jfd
 

int protocol = PLAYER_TRANSPORT_TCP
 

double max_speed = 0.500
 

double max_turn = DTOR(60)
 


Generated on Tue May 3 14:15:42 2005 for Player by doxygen 1.3.6