Classes | Defines | Typedefs | Functions | Variables
Ndirect.c File Reference
#include <arpa/inet.h>
#include <fcntl.h>
#include <termios.h>
#include <signal.h>
#include <memory.h>
#include <errno.h>
#include <netdb.h>
#include <netinet/in.h>
#include <stdarg.h>
#include <stdio.h>
#include <unistd.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <sys/time.h>
#include "Nclient.h"
Include dependency graph for Ndirect.c:

Go to the source code of this file.

Classes

struct  _PosDataAll

Defines

#define AC   1
#define ADD_OBS   32
#define CONF_CP   16
#define CONF_IR   14
#define CONF_LS   17
#define CONF_SER   35
#define CONF_SG   28
#define CONF_SN   15
#define CONF_TM   18
#define CONNECT_TIMEOUT   10 /* 10 seconds */
#define CT   6
#define DA   30
#define DELETE_OBS   33
#define DP   12
#define GET_BP   27
#define GET_CP   24
#define GET_IR   19
#define GET_LS   25
#define GET_RA   23
#define GET_RC   21
#define GET_RV   22
#define GET_SG   29
#define GET_SN   20
#define GS   7
#define LONG_B(x, y, z, q)
#define LP   10
#define MOVE_OBS   34
#define MV   43
#define NAK   8
#define NORMAL_TIMEOUT   1 /* 1 second */
#define NUM_COMMANDS   36
#define PA   4
#define PLACE_ROBOT   36
#define POS_BUMPER_PI(x)   ( ( (x) & POS_BUMPER ) ? 1 : 0 )
#define POS_COMPASS_PI(x)   ( ( (x) & POS_COMPASS ) ? 1 : 0 )
#define POS_INFRARED_PI(x)   ( ( (x) & POS_INFRARED ) ? 1 : 0 )
#define POS_LASER_PI(x)   ( ( (x) & POS_LASER ) ? 1 : 0 )
#define POS_SONAR_PI(x)   ( ( (x) & POS_SONAR ) ? 1 : 0 )
#define PR   3
#define RANGE_CPU_VOLTAGE   12.0
#define RANGE_MOTOR_VOLTAGE   12.85
#define RE_XMIT   0 /* not re-transmit when failed */
#define SERIAL_OPEN_ERROR   1
#define SERIAL_PKG_ERROR   4
#define SERIAL_READ_ERROR   3
#define SERIAL_TIMEOUT_ERROR   5
#define SERIAL_WRITE_ERROR   2
#define SETUP_LS   26
#define SP   2
#define SPECIAL   128
#define SPECIAL_TIMEOUT   30 /* used for user define package */
#define ST   9
#define TK   11
#define USER_BUFFER_LENGTH   0xFFFF
#define VM   5
#define WS   31
#define ZR   13

Typedefs

typedef struct _PosDataAll PosDataAll

Functions

int ac (int t_ac, int s_ac, int r_ac)
int add_Obs (long obs[2 *MAX_VERTICES+1])
int add_obstacle (long obs[2 *MAX_VERTICES+1])
long arm_mv (long l_mode, long l_v, long g_mode, long g_v)
long arm_ws (short l, short g, long timeout, long *time_remain)
long arm_zr (short override)
static unsigned char bits_to_byte (char bt0, char bt1, char bt2, char bt3, char bt4, char bt5, char bt6, char bt7)
static unsigned char buf_fill (int fd, int conn_type)
static long combine_bumper_vector (unsigned char b1, unsigned char b2, unsigned char b3)
static int Comm_Robot (int fd, unsigned char command[BUFSIZE])
int conf_cp (int mode)
int conf_ir (int history, int order[16])
int conf_ls (unsigned int mode, unsigned int threshold, unsigned int width, unsigned int num_data, unsigned int processing)
int conf_ser (unsigned char port, unsigned short baud)
int conf_sg (unsigned int threshold, unsigned int min_points, unsigned int gap)
int conf_sn (int rate, int order[16])
int conf_tm (unsigned char timeout)
int connect_robot (long robot_id,...)
static void convert_laser (int *laser)
static char * convertAddr (char *name, char *addr)
int create_robot (long robot_id)
int ct ()
int da (int th, int tu)
int delete_Obs (long obs[2 *MAX_VERTICES+1])
int delete_obstacle (long obs[2 *MAX_VERTICES+1])
int disconnect_robot (long robot_id)
int dp (int x, int y)
int draw_arc (long x_0, long y_0, long w, long h, int th1, int th2, int mode)
int draw_line (long x_1, long y_1, long x_2, long y_2, int mode)
int draw_robot (long x, long y, int th, int tu, int mode)
signed short extract2byteint (unsigned char *buffer, unsigned short *index)
unsigned short extract2byteuint (unsigned char *buffer, unsigned short *index)
signed long extract4byteint (unsigned char *buffer, unsigned short *index)
unsigned long extract4byteuint (unsigned char *buffer, unsigned short *index)
int extract_receive_buffer_header (unsigned short *length, unsigned char *serial_number, unsigned char *packet_type, unsigned char *buffer)
signed char extractchar (unsigned char *buffer, unsigned short *index)
double extractdouble (unsigned char *buffer, unsigned short *index)
unsigned char extractuchar (unsigned char *buffer, unsigned short *index)
int get_bp ()
int get_cp ()
int get_ir ()
int get_laser (int laser[2 *NUM_LASER+1])
int get_ls ()
int get_mask (int mask[NUM_MASK])
int get_ra ()
int get_rc ()
int get_robot_conf (long *conf)
int get_rpx (long *robot_pos)
int get_rv ()
int get_sg ()
int get_sn ()
int get_state (long state[NUM_STATE])
static unsigned char GETC (int fd, int conn_type)
int gs ()
static int high_half (unsigned char num)
void init_mask (void)
int init_receive_buffer (unsigned short *index)
int init_send_buffer (unsigned short *index)
int init_sensors ()
static int low_half (unsigned char num)
int lp ()
int motion_check (long type, double a1, double a2, double a3, double a4, double a5, double a6, double a7, double collide[3])
int move_Obs (long obs[2 *MAX_VERTICES+1], long dx, long dy)
int move_obstacle (long obs[2 *MAX_VERTICES+1], long dx, long dy)
int mv (int t_mode, int t_mv, int s_mode, int s_mv, int r_mode, int r_mv)
int new_world (void)
int open_serial (char *port, unsigned short baud)
int pa (int t_pa, int s_pa, int r_pa)
int place_robot (int x, int y, int th, int tu)
int posBumperGet (PosData *posData)
int posCompassGet (PosData *posData)
int posDataCheck (void)
int posDataRequest (int posRequest)
int posInfraredGet (PosData *posData, int infraredNumber)
int posInfraredRingGet (PosData posData[INFRAREDS])
int posLaserGet (PosData *posData)
static long posLongExtract (unsigned char *inbuf)
static int posPackageProcess (unsigned char *inbuf, PosData *posData)
int posSonarGet (PosData *posData, int sonarNumber)
int posSonarRingGet (PosData posData[SONARS])
int posTimeGet (void)
static unsigned long posUnsignedLongExtract (unsigned char *inbuf)
int pr (int t_pr, int s_pr, int r_pr)
int predict_sensors (int x, int y, int th, int tu, long *state, int *laser)
static void Process_Acceleration_Pkg (unsigned char inbuf[BUFSIZE])
static void Process_Bumper_Pkg (unsigned char inbuf[BUFSIZE])
static void Process_Compass_Conf_Pkg (unsigned char inbuf[BUFSIZE])
static void Process_Compass_Pkg (unsigned char inbuf[BUFSIZE])
static void Process_Configuration_Pkg (unsigned char inbuf[BUFSIZE])
static void Process_Infrared_Pkg (unsigned char inbuf[BUFSIZE])
static void Process_Laser_Line_Pkg (unsigned char inbuf[BUFSIZE])
static void Process_Laser_Point_Pkg (unsigned char inbuf[BUFSIZE])
static int Process_Robot_Resp (unsigned char inbuf[BUFSIZE])
static void Process_Sonar_Pkg (unsigned char inbuf[BUFSIZE])
static void Process_Special_Pkg (unsigned char inbuf[BUFSIZE])
static void Process_State_Pkg (unsigned char inbuf[BUFSIZE])
static void Process_Velocity_Pkg (unsigned char inbuf[BUFSIZE])
static void ProjectPhy (double xi1, double yi1, double *x, double *y)
int quit_server (void)
static int Read_Pkg (int fd, int conn_type, unsigned char *inbuf)
int real_robot (void)
static int serial_ready (int fd, int wait)
int server_is_running ()
int set_mask (int mask[NUM_MASK])
int set_serv_tcp_port (int port)
int set_server_machine_name (char *sname)
static void signed_int_to_two_bytes (int n, unsigned char *byte_ptr)
int simulated_robot (void)
int sp (int t_sp, int s_sp, int r_sp)
int special_request (unsigned char *user_send_buffer, unsigned char *user_receive_buffer)
int st ()
int stuff2byteint (signed short data, unsigned char *buffer, unsigned short *index)
int stuff2byteuint (unsigned short data, unsigned char *buffer, unsigned short *index)
int stuff4byteint (signed long data, unsigned char *buffer, unsigned short *index)
int stuff4byteuint (unsigned long data, unsigned char *buffer, unsigned short *index)
void stuff_length_type (int length, int ptype, unsigned char *byte_ptr)
int stuff_send_buffer_header (unsigned short index, unsigned char serial_number, unsigned char packet_type, unsigned char *buffer)
void stuff_three_signed_int (int length, int ptype, int num1, int num2, int num3, unsigned char *byte_ptr)
void stuff_three_unsigned_int (int length, int ptype, int num1, int num2, int num3, unsigned char *byte_ptr)
void stuff_two_signed_int (int length, int ptype, int num1, int num2, unsigned char *byte_ptr)
int stuffchar (signed char data, unsigned char *buffer, unsigned short *index)
int stuffdouble (double data, unsigned char *buffer, unsigned short *index)
int stuffuchar (unsigned char data, unsigned char *buffer, unsigned short *index)
static int timePackageProcess (unsigned char *inbuf, unsigned long *timeS)
int tk (char *talk_string)
static int two_bytes_to_signed_int (unsigned char low_byte, unsigned char high_byte)
static unsigned int two_bytes_to_unsigned_int (unsigned char low_byte, unsigned char high_byte)
static void unsigned_int_to_two_bytes (int n, unsigned char *byte_ptr)
int vm (int t_v, int s_v, int r_v)
static float voltConvert (unsigned char reading, float range)
float voltCpuGet (void)
float voltMotorGet (void)
static int voltPackageProcess (unsigned char *inbuf, unsigned char *voltCPU, unsigned char *voltMotor)
static int Write_Pkg (int fd, unsigned char *outbuf)
int ws (unsigned char t_ws, unsigned char s_ws, unsigned char r_ws, unsigned char timeout)
int zr ()

Variables

static unsigned char buf [BUFSIZE]
static unsigned char * bufe
static unsigned char * bufp
int conn_value
int connect_type = 1
char cvsid_host_client_Ndirect_c [] = "$Header: /home/cvs/host/client/direct.c,v 1.4 1999/11/12 07:28:19 jake Exp $"
int DEFAULT_ROBOT_TCP_PORT = 65001
int DEFAULT_SERIAL_BAUD = 38400
char * device
static int errorp = 0
static int Fd = -1
char Host_name [255] = ""
int Laser [2 *NUM_LASER+1]
double LASER_CALIBRATION [8]
static int laser_mode = 51
double LASER_OFFSET [2] = { 0, 0 }
int model
static PosDataAll posDataAll
static unsigned long posDataTime
static int Robot_id = -1
int SERV_TCP_PORT = -1
char SERVER_MACHINE_NAME [80] = ""
int Smask [NUM_MASK]
static unsigned short special_answer_size
static unsigned char * special_buffer
long State [NUM_STATE]
static int usedSmask [NUM_MASK]
static unsigned char voltageCPU
static unsigned char voltageMotor
static int wait_time

Define Documentation

#define AC   1

Definition at line 36 of file Ndirect.c.

#define ADD_OBS   32

Definition at line 71 of file Ndirect.c.

#define CONF_CP   16

Definition at line 52 of file Ndirect.c.

#define CONF_IR   14

Definition at line 50 of file Ndirect.c.

#define CONF_LS   17

Definition at line 53 of file Ndirect.c.

#define CONF_SER   35

Definition at line 75 of file Ndirect.c.

#define CONF_SG   28

Definition at line 65 of file Ndirect.c.

#define CONF_SN   15

Definition at line 51 of file Ndirect.c.

#define CONF_TM   18

Definition at line 54 of file Ndirect.c.

#define CONNECT_TIMEOUT   10 /* 10 seconds */

Definition at line 92 of file Ndirect.c.

#define CT   6

Definition at line 42 of file Ndirect.c.

#define DA   30

Definition at line 68 of file Ndirect.c.

#define DELETE_OBS   33

Definition at line 72 of file Ndirect.c.

#define DP   12

Definition at line 48 of file Ndirect.c.

#define GET_BP   27

Definition at line 63 of file Ndirect.c.

#define GET_CP   24

Definition at line 60 of file Ndirect.c.

#define GET_IR   19

Definition at line 55 of file Ndirect.c.

#define GET_LS   25

Definition at line 61 of file Ndirect.c.

#define GET_RA   23

Definition at line 59 of file Ndirect.c.

#define GET_RC   21

Definition at line 57 of file Ndirect.c.

#define GET_RV   22

Definition at line 58 of file Ndirect.c.

#define GET_SG   29

Definition at line 66 of file Ndirect.c.

#define GET_SN   20

Definition at line 56 of file Ndirect.c.

#define GS   7

Definition at line 43 of file Ndirect.c.

#define LONG_B (   x,
  y,
  z,
 
)
Value:
((((x) << 24) & 0xFF000000) | \
                         (((y) << 16) & 0x00FF0000) | \
                         (((z) <<  8) & 0x0000FF00) | \
                         ( (q)        & 0x000000FF) )

Definition at line 121 of file Ndirect.c.

#define LP   10

Definition at line 46 of file Ndirect.c.

#define MOVE_OBS   34

Definition at line 73 of file Ndirect.c.

#define MV   43

Definition at line 41 of file Ndirect.c.

#define NAK   8

Definition at line 44 of file Ndirect.c.

#define NORMAL_TIMEOUT   1 /* 1 second */

Definition at line 91 of file Ndirect.c.

#define NUM_COMMANDS   36

Definition at line 78 of file Ndirect.c.

#define PA   4

Definition at line 39 of file Ndirect.c.

#define PLACE_ROBOT   36

Definition at line 76 of file Ndirect.c.

#define POS_BUMPER_PI (   x)    ( ( (x) & POS_BUMPER ) ? 1 : 0 )

Definition at line 112 of file Ndirect.c.

#define POS_COMPASS_PI (   x)    ( ( (x) & POS_COMPASS ) ? 1 : 0 )

Definition at line 114 of file Ndirect.c.

#define POS_INFRARED_PI (   x)    ( ( (x) & POS_INFRARED ) ? 1 : 0 )

Definition at line 110 of file Ndirect.c.

#define POS_LASER_PI (   x)    ( ( (x) & POS_LASER ) ? 1 : 0 )

Definition at line 113 of file Ndirect.c.

#define POS_SONAR_PI (   x)    ( ( (x) & POS_SONAR ) ? 1 : 0 )

Definition at line 111 of file Ndirect.c.

#define PR   3

Definition at line 38 of file Ndirect.c.

#define RANGE_CPU_VOLTAGE   12.0

Definition at line 131 of file Ndirect.c.

#define RANGE_MOTOR_VOLTAGE   12.85

Definition at line 132 of file Ndirect.c.

#define RE_XMIT   0 /* not re-transmit when failed */

Definition at line 90 of file Ndirect.c.

#define SERIAL_OPEN_ERROR   1

Definition at line 83 of file Ndirect.c.

#define SERIAL_PKG_ERROR   4

Definition at line 86 of file Ndirect.c.

#define SERIAL_READ_ERROR   3

Definition at line 85 of file Ndirect.c.

#define SERIAL_TIMEOUT_ERROR   5

Definition at line 87 of file Ndirect.c.

#define SERIAL_WRITE_ERROR   2

Definition at line 84 of file Ndirect.c.

#define SETUP_LS   26

Definition at line 62 of file Ndirect.c.

#define SP   2

Definition at line 37 of file Ndirect.c.

#define SPECIAL   128

Definition at line 80 of file Ndirect.c.

#define SPECIAL_TIMEOUT   30 /* used for user define package */

Definition at line 93 of file Ndirect.c.

#define ST   9

Definition at line 45 of file Ndirect.c.

#define TK   11

Definition at line 47 of file Ndirect.c.

#define USER_BUFFER_LENGTH   0xFFFF

Definition at line 100 of file Ndirect.c.

#define VM   5

Definition at line 40 of file Ndirect.c.

#define WS   31

Definition at line 69 of file Ndirect.c.

#define ZR   13

Definition at line 49 of file Ndirect.c.


Typedef Documentation

typedef struct _PosDataAll PosDataAll

Function Documentation

int ac ( int  t_ac,
int  s_ac,
int  r_ac 
)

Definition at line 1867 of file Ndirect.c.

int add_Obs ( long  obs[2 *MAX_VERTICES+1])

Definition at line 2649 of file Ndirect.c.

int add_obstacle ( long  obs[2 *MAX_VERTICES+1])

Definition at line 2640 of file Ndirect.c.

long arm_mv ( long  l_mode,
long  l_v,
long  g_mode,
long  g_v 
)

Definition at line 3901 of file Ndirect.c.

long arm_ws ( short  l,
short  g,
long  timeout,
long *  time_remain 
)

Definition at line 3870 of file Ndirect.c.

long arm_zr ( short  override)

Definition at line 3845 of file Ndirect.c.

static unsigned char bits_to_byte ( char  bt0,
char  bt1,
char  bt2,
char  bt3,
char  bt4,
char  bt5,
char  bt6,
char  bt7 
) [static]

Definition at line 328 of file Ndirect.c.

static unsigned char buf_fill ( int  fd,
int  conn_type 
) [static]

Definition at line 393 of file Ndirect.c.

static long combine_bumper_vector ( unsigned char  b1,
unsigned char  b2,
unsigned char  b3 
) [static]

Definition at line 318 of file Ndirect.c.

static int Comm_Robot ( int  fd,
unsigned char  command[BUFSIZE] 
) [static]

Definition at line 1157 of file Ndirect.c.

int conf_cp ( int  mode)

Definition at line 2276 of file Ndirect.c.

int conf_ir ( int  history,
int  order[16] 
)

Definition at line 2218 of file Ndirect.c.

int conf_ls ( unsigned int  mode,
unsigned int  threshold,
unsigned int  width,
unsigned int  num_data,
unsigned int  processing 
)

Definition at line 2323 of file Ndirect.c.

int conf_ser ( unsigned char  port,
unsigned short  baud 
)

Definition at line 2371 of file Ndirect.c.

int conf_sg ( unsigned int  threshold,
unsigned int  min_points,
unsigned int  gap 
)

Definition at line 2519 of file Ndirect.c.

int conf_sn ( int  rate,
int  order[16] 
)

Definition at line 2252 of file Ndirect.c.

int conf_tm ( unsigned char  timeout)

Definition at line 2361 of file Ndirect.c.

int connect_robot ( long  robot_id,
  ... 
)

Definition at line 1595 of file Ndirect.c.

static void convert_laser ( int *  laser) [static]

Definition at line 554 of file Ndirect.c.

static char* convertAddr ( char *  name,
char *  addr 
) [static]

Definition at line 1465 of file Ndirect.c.

int create_robot ( long  robot_id)

Definition at line 1458 of file Ndirect.c.

int ct ( void  )

Definition at line 2045 of file Ndirect.c.

int da ( int  th,
int  tu 
)

Definition at line 2563 of file Ndirect.c.

int delete_Obs ( long  obs[2 *MAX_VERTICES+1])

Definition at line 2674 of file Ndirect.c.

int delete_obstacle ( long  obs[2 *MAX_VERTICES+1])

Definition at line 2665 of file Ndirect.c.

int disconnect_robot ( long  robot_id)

Definition at line 1852 of file Ndirect.c.

int dp ( int  x,
int  y 
)

Definition at line 2178 of file Ndirect.c.

int draw_arc ( long  x_0,
long  y_0,
long  w,
long  h,
int  th1,
int  th2,
int  mode 
)

Definition at line 2892 of file Ndirect.c.

int draw_line ( long  x_1,
long  y_1,
long  x_2,
long  y_2,
int  mode 
)

Definition at line 2865 of file Ndirect.c.

int draw_robot ( long  x,
long  y,
int  th,
int  tu,
int  mode 
)

Definition at line 2842 of file Ndirect.c.

signed short extract2byteint ( unsigned char *  buffer,
unsigned short *  index 
)

Definition at line 3348 of file Ndirect.c.

unsigned short extract2byteuint ( unsigned char *  buffer,
unsigned short *  index 
)

Definition at line 3427 of file Ndirect.c.

signed long extract4byteint ( unsigned char *  buffer,
unsigned short *  index 
)

Definition at line 3375 of file Ndirect.c.

unsigned long extract4byteuint ( unsigned char *  buffer,
unsigned short *  index 
)

Definition at line 3449 of file Ndirect.c.

int extract_receive_buffer_header ( unsigned short *  length,
unsigned char *  serial_number,
unsigned char *  packet_type,
unsigned char *  buffer 
)

Definition at line 3079 of file Ndirect.c.

signed char extractchar ( unsigned char *  buffer,
unsigned short *  index 
)

Definition at line 3324 of file Ndirect.c.

double extractdouble ( unsigned char *  buffer,
unsigned short *  index 
)

Definition at line 3474 of file Ndirect.c.

unsigned char extractuchar ( unsigned char *  buffer,
unsigned short *  index 
)

Definition at line 3406 of file Ndirect.c.

int get_bp ( void  )

Definition at line 2496 of file Ndirect.c.

int get_cp ( void  )

Definition at line 2461 of file Ndirect.c.

int get_ir ( void  )

Definition at line 2394 of file Ndirect.c.

int get_laser ( int  laser[2 *NUM_LASER+1])

Definition at line 3520 of file Ndirect.c.

int get_ls ( void  )

Definition at line 2479 of file Ndirect.c.

int get_mask ( int  mask[NUM_MASK])

Definition at line 3529 of file Ndirect.c.

int get_ra ( void  )

Definition at line 2448 of file Ndirect.c.

int get_rc ( void  )

Definition at line 2424 of file Ndirect.c.

int get_robot_conf ( long *  conf)

Definition at line 3038 of file Ndirect.c.

int get_rpx ( long *  robot_pos)

Definition at line 2615 of file Ndirect.c.

int get_rv ( void  )

Definition at line 2436 of file Ndirect.c.

int get_sg ( void  )

Definition at line 2542 of file Ndirect.c.

int get_sn ( void  )

Definition at line 2412 of file Ndirect.c.

int get_state ( long  state[NUM_STATE])

Definition at line 3511 of file Ndirect.c.

static unsigned char GETC ( int  fd,
int  conn_type 
) [static]

Definition at line 438 of file Ndirect.c.

int gs ( void  )

Definition at line 2102 of file Ndirect.c.

static int high_half ( unsigned char  num) [static]

Definition at line 248 of file Ndirect.c.

void init_mask ( void  )

Definition at line 2725 of file Ndirect.c.

int init_receive_buffer ( unsigned short *  index)

Definition at line 3059 of file Ndirect.c.

int init_send_buffer ( unsigned short *  index)

Definition at line 3101 of file Ndirect.c.

int init_sensors ( void  )

Definition at line 2738 of file Ndirect.c.

static int low_half ( unsigned char  num) [static]

Definition at line 243 of file Ndirect.c.

int lp ( void  )

Definition at line 2124 of file Ndirect.c.

int motion_check ( long  type,
double  a1,
double  a2,
double  a3,
double  a4,
double  a5,
double  a6,
double  a7,
double  collide[3] 
)

Definition at line 3013 of file Ndirect.c.

int move_Obs ( long  obs[2 *MAX_VERTICES+1],
long  dx,
long  dy 
)

Definition at line 2703 of file Ndirect.c.

int move_obstacle ( long  obs[2 *MAX_VERTICES+1],
long  dx,
long  dy 
)

Definition at line 2692 of file Ndirect.c.

int mv ( int  t_mode,
int  t_mv,
int  s_mode,
int  s_mv,
int  r_mode,
int  r_mv 
)

Definition at line 2001 of file Ndirect.c.

int new_world ( void  )

Definition at line 2711 of file Ndirect.c.

int open_serial ( char *  port,
unsigned short  baud 
)

Definition at line 1478 of file Ndirect.c.

int pa ( int  t_pa,
int  s_pa,
int  r_pa 
)
int place_robot ( int  x,
int  y,
int  th,
int  tu 
)

Definition at line 2759 of file Ndirect.c.

int posBumperGet ( PosData posData)

Definition at line 3728 of file Ndirect.c.

int posCompassGet ( PosData posData)

Definition at line 3766 of file Ndirect.c.

int posDataCheck ( void  )

Definition at line 3619 of file Ndirect.c.

int posDataRequest ( int  posRequest)

Definition at line 3592 of file Ndirect.c.

int posInfraredGet ( PosData posData,
int  infraredNumber 
)

Definition at line 3661 of file Ndirect.c.

int posInfraredRingGet ( PosData  posData[INFRAREDS])

Definition at line 3639 of file Ndirect.c.

int posLaserGet ( PosData posData)

Definition at line 3747 of file Ndirect.c.

static long posLongExtract ( unsigned char *  inbuf) [static]

Definition at line 1334 of file Ndirect.c.

static int posPackageProcess ( unsigned char *  inbuf,
PosData posData 
) [static]

Definition at line 1374 of file Ndirect.c.

int posSonarGet ( PosData posData,
int  sonarNumber 
)

Definition at line 3704 of file Ndirect.c.

int posSonarRingGet ( PosData  posData[SONARS])

Definition at line 3684 of file Ndirect.c.

int posTimeGet ( void  )

Definition at line 3786 of file Ndirect.c.

static unsigned long posUnsignedLongExtract ( unsigned char *  inbuf) [static]

Definition at line 1357 of file Ndirect.c.

int pr ( int  t_pr,
int  s_pr,
int  r_pr 
)

Definition at line 1908 of file Ndirect.c.

int predict_sensors ( int  x,
int  y,
int  th,
int  tu,
long *  state,
int *  laser 
)

Definition at line 2972 of file Ndirect.c.

static void Process_Acceleration_Pkg ( unsigned char  inbuf[BUFSIZE]) [static]

Definition at line 912 of file Ndirect.c.

static void Process_Bumper_Pkg ( unsigned char  inbuf[BUFSIZE]) [static]

Definition at line 956 of file Ndirect.c.

static void Process_Compass_Conf_Pkg ( unsigned char  inbuf[BUFSIZE]) [static]

Definition at line 943 of file Ndirect.c.

static void Process_Compass_Pkg ( unsigned char  inbuf[BUFSIZE]) [static]

Definition at line 919 of file Ndirect.c.

static void Process_Configuration_Pkg ( unsigned char  inbuf[BUFSIZE]) [static]

Definition at line 876 of file Ndirect.c.

static void Process_Infrared_Pkg ( unsigned char  inbuf[BUFSIZE]) [static]

Definition at line 801 of file Ndirect.c.

static void Process_Laser_Line_Pkg ( unsigned char  inbuf[BUFSIZE]) [static]

Definition at line 1030 of file Ndirect.c.

static void Process_Laser_Point_Pkg ( unsigned char  inbuf[BUFSIZE]) [static]

Definition at line 988 of file Ndirect.c.

static int Process_Robot_Resp ( unsigned char  inbuf[BUFSIZE]) [static]

Definition at line 1086 of file Ndirect.c.

static void Process_Sonar_Pkg ( unsigned char  inbuf[BUFSIZE]) [static]

Definition at line 846 of file Ndirect.c.

static void Process_Special_Pkg ( unsigned char  inbuf[BUFSIZE]) [static]

Definition at line 1064 of file Ndirect.c.

static void Process_State_Pkg ( unsigned char  inbuf[BUFSIZE]) [static]

Definition at line 583 of file Ndirect.c.

static void Process_Velocity_Pkg ( unsigned char  inbuf[BUFSIZE]) [static]

Definition at line 896 of file Ndirect.c.

static void ProjectPhy ( double  xi1,
double  yi1,
double *  x,
double *  y 
) [static]

Definition at line 538 of file Ndirect.c.

int quit_server ( void  )

Definition at line 2931 of file Ndirect.c.

static int Read_Pkg ( int  fd,
int  conn_type,
unsigned char *  inbuf 
) [static]

Definition at line 449 of file Ndirect.c.

int real_robot ( void  )

Definition at line 2942 of file Ndirect.c.

static int serial_ready ( int  fd,
int  wait 
) [static]

Definition at line 338 of file Ndirect.c.

int server_is_running ( void  )

Definition at line 2919 of file Ndirect.c.

int set_mask ( int  mask[NUM_MASK])

Definition at line 3538 of file Ndirect.c.

int set_serv_tcp_port ( int  port)

Definition at line 3554 of file Ndirect.c.

int set_server_machine_name ( char *  sname)

Definition at line 3547 of file Ndirect.c.

static void signed_int_to_two_bytes ( int  n,
unsigned char *  byte_ptr 
) [static]

Definition at line 280 of file Ndirect.c.

int simulated_robot ( void  )

Definition at line 2953 of file Ndirect.c.

int sp ( int  t_sp,
int  s_sp,
int  r_sp 
)

Definition at line 1885 of file Ndirect.c.

int special_request ( unsigned char *  user_send_buffer,
unsigned char *  user_receive_buffer 
)

Definition at line 2780 of file Ndirect.c.

int st ( void  )

Definition at line 2113 of file Ndirect.c.

int stuff2byteint ( signed short  data,
unsigned char *  buffer,
unsigned short *  index 
)

Definition at line 3165 of file Ndirect.c.

int stuff2byteuint ( unsigned short  data,
unsigned char *  buffer,
unsigned short *  index 
)

Definition at line 3241 of file Ndirect.c.

int stuff4byteint ( signed long  data,
unsigned char *  buffer,
unsigned short *  index 
)

Definition at line 3192 of file Ndirect.c.

int stuff4byteuint ( unsigned long  data,
unsigned char *  buffer,
unsigned short *  index 
)

Definition at line 3262 of file Ndirect.c.

void stuff_length_type ( int  length,
int  ptype,
unsigned char *  byte_ptr 
)

Definition at line 1259 of file Ndirect.c.

int stuff_send_buffer_header ( unsigned short  index,
unsigned char  serial_number,
unsigned char  packet_type,
unsigned char *  buffer 
)

Definition at line 3123 of file Ndirect.c.

void stuff_three_signed_int ( int  length,
int  ptype,
int  num1,
int  num2,
int  num3,
unsigned char *  byte_ptr 
)

Definition at line 1307 of file Ndirect.c.

void stuff_three_unsigned_int ( int  length,
int  ptype,
int  num1,
int  num2,
int  num3,
unsigned char *  byte_ptr 
)

Definition at line 1288 of file Ndirect.c.

void stuff_two_signed_int ( int  length,
int  ptype,
int  num1,
int  num2,
unsigned char *  byte_ptr 
)

Definition at line 1271 of file Ndirect.c.

int stuffchar ( signed char  data,
unsigned char *  buffer,
unsigned short *  index 
)

Definition at line 3142 of file Ndirect.c.

int stuffdouble ( double  data,
unsigned char *  buffer,
unsigned short *  index 
)

Definition at line 3287 of file Ndirect.c.

int stuffuchar ( unsigned char  data,
unsigned char *  buffer,
unsigned short *  index 
)

Definition at line 3222 of file Ndirect.c.

static int timePackageProcess ( unsigned char *  inbuf,
unsigned long *  timeS 
) [static]

Definition at line 1406 of file Ndirect.c.

int tk ( char *  talk_string)

Definition at line 2139 of file Ndirect.c.

static int two_bytes_to_signed_int ( unsigned char  low_byte,
unsigned char  high_byte 
) [static]

Definition at line 297 of file Ndirect.c.

static unsigned int two_bytes_to_unsigned_int ( unsigned char  low_byte,
unsigned char  high_byte 
) [static]

Definition at line 309 of file Ndirect.c.

static void unsigned_int_to_two_bytes ( int  n,
unsigned char *  byte_ptr 
) [static]

Definition at line 290 of file Ndirect.c.

int vm ( int  t_v,
int  s_v,
int  r_v 
)

Definition at line 1954 of file Ndirect.c.

static float voltConvert ( unsigned char  reading,
float  range 
) [static]

Definition at line 3831 of file Ndirect.c.

float voltCpuGet ( void  )

Definition at line 3801 of file Ndirect.c.

float voltMotorGet ( void  )

Definition at line 3816 of file Ndirect.c.

static int voltPackageProcess ( unsigned char *  inbuf,
unsigned char *  voltCPU,
unsigned char *  voltMotor 
) [static]

Definition at line 1425 of file Ndirect.c.

static int Write_Pkg ( int  fd,
unsigned char *  outbuf 
) [static]

Definition at line 358 of file Ndirect.c.

int ws ( unsigned char  t_ws,
unsigned char  s_ws,
unsigned char  r_ws,
unsigned char  timeout 
)

Definition at line 2584 of file Ndirect.c.

int zr ( void  )

Definition at line 2191 of file Ndirect.c.


Variable Documentation

unsigned char buf[BUFSIZE] [static]

Definition at line 194 of file Ndirect.c.

unsigned char * bufe [static]

Definition at line 195 of file Ndirect.c.

unsigned char* bufp [static]

Definition at line 195 of file Ndirect.c.

Definition at line 174 of file Ndirect.c.

int connect_type = 1

Definition at line 171 of file Ndirect.c.

char cvsid_host_client_Ndirect_c[] = "$Header: /home/cvs/host/client/direct.c,v 1.4 1999/11/12 07:28:19 jake Exp $"

Definition at line 11 of file Ndirect.c.

Definition at line 176 of file Ndirect.c.

int DEFAULT_SERIAL_BAUD = 38400

Definition at line 175 of file Ndirect.c.

char* device

Definition at line 173 of file Ndirect.c.

int errorp = 0 [static]

Definition at line 196 of file Ndirect.c.

int Fd = -1 [static]

Definition at line 193 of file Ndirect.c.

char Host_name[255] = ""

Definition at line 185 of file Ndirect.c.

int Laser[2 *NUM_LASER+1]

Definition at line 166 of file Ndirect.c.

double LASER_CALIBRATION[8]
Initial value:
 { -0.003470,  0.000008, 0.011963,  0.001830,
                                  27.5535913, 0.000428, 0.031102, -0.444624 }

Definition at line 177 of file Ndirect.c.

int laser_mode = 51 [static]

Definition at line 214 of file Ndirect.c.

double LASER_OFFSET[2] = { 0, 0 }

Definition at line 179 of file Ndirect.c.

int model

Definition at line 172 of file Ndirect.c.

Definition at line 206 of file Ndirect.c.

unsigned long posDataTime [static]

Definition at line 207 of file Ndirect.c.

int Robot_id = -1 [static]

Definition at line 199 of file Ndirect.c.

int SERV_TCP_PORT = -1

Definition at line 184 of file Ndirect.c.

char SERVER_MACHINE_NAME[80] = ""

Definition at line 183 of file Ndirect.c.

Definition at line 165 of file Ndirect.c.

unsigned short special_answer_size [static]

Definition at line 203 of file Ndirect.c.

unsigned char* special_buffer [static]

Definition at line 202 of file Ndirect.c.

Definition at line 164 of file Ndirect.c.

int usedSmask[NUM_MASK] [static]

Definition at line 198 of file Ndirect.c.

unsigned char voltageCPU [static]

Definition at line 210 of file Ndirect.c.

unsigned char voltageMotor [static]

Definition at line 211 of file Ndirect.c.

int wait_time [static]

Definition at line 197 of file Ndirect.c.



scout_ndirect
Author(s): Gonçalo Cabrita and Pedro Sousa
autogenerated on Mon Jan 6 2014 11:25:23