⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 nclient.h

📁 卡耐基.梅隆大学的机器人仿真软件(Redhat linux 9下安装)
💻 H
📖 第 1 页 / 共 5 页
字号:
 /********************************************************* * * This source code is part of the Carnegie Mellon Robot * Navigation Toolkit (CARMEN) * * CARMEN Copyright (c) 2002 Michael Montemerlo, Nicholas * Roy, Sebastian Thrun, Dirk Haehnel, Cyrill Stachniss, * and Jared Glover * * CARMEN is free software; you can redistribute it and/or  * modify it under the terms of the GNU General Public  * License as published by the Free Software Foundation;  * either version 2 of the License, or (at your option) * any later version. * * CARMEN is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied  * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE.  See the GNU General Public License for more  * details. * * You should have received a copy of the GNU General  * Public License along with CARMEN; if not, write to the * Free Software Foundation, Inc., 59 Temple Place,  * Suite 330, Boston, MA  02111-1307 USA * ********************************************************//* * Nclient.h * * Interface file for direct connections to the robot or for * connections to Nserver. *  * Copyright 1991-1998, Nomadic Technologies, Inc. * *//* $Header: /cvsroot/carmen/carmen/src/base/scoutlib/Nclient.h,v 1.2 2006/04/06 00:30:08 stachnis Exp $ */#ifndef _HOST_CLIENT_NCLIENT_H_#define _HOST_CLIENT_NCLIENT_H_#ifdef __cplusplusextern "C" {#endif/* constants */#ifndef FALSE#define FALSE			0#endif#ifndef TRUE#define TRUE			1#endif#ifndef NULL#define NULL                    0#endif#define MAX_VERTICES     10#define NUM_STATE        45#define NUM_MASK         44 #define NUM_LASER        482 #define BUFSIZE          4096#define MAX_USER_BUF     0xFFFF/* Robot models. */#define MODEL_N200   0#define MODEL_N150   1#define MODEL_SCOUT  2#define MODEL_SCOUT2 2/* the number of sonars and infrareds */#define SONARS           16#define INFRAREDS        16/* * The following defines allow you to access the State vector in a  * more readable way. */#define STATE_SIM_SPEED            0#define STATE_IR_0                 1#define STATE_IR_1                 2#define STATE_IR_2                 3#define STATE_IR_3                 4#define STATE_IR_4                 5#define STATE_IR_5                 6#define STATE_IR_6                 7#define STATE_IR_7                 8#define STATE_IR_8                 9#define STATE_IR_9                 10#define STATE_IR_10                11#define STATE_IR_11                12#define STATE_IR_12                13#define STATE_IR_13                14#define STATE_IR_14                15#define STATE_IR_15                16#define STATE_SONAR_0              17#define STATE_SONAR_1              18#define STATE_SONAR_2              19#define STATE_SONAR_3              20#define STATE_SONAR_4              21#define STATE_SONAR_5              22#define STATE_SONAR_6              23#define STATE_SONAR_7              24#define STATE_SONAR_8              25#define STATE_SONAR_9              26#define STATE_SONAR_10             27#define STATE_SONAR_11             28#define STATE_SONAR_12             29#define STATE_SONAR_13             30#define STATE_SONAR_14             31#define STATE_SONAR_15             32 #define STATE_BUMPER               33#define STATE_CONF_X               34#define STATE_CONF_Y               35#define STATE_CONF_STEER           36#define STATE_CONF_TURRET          37#define STATE_VEL_TRANS            38#define STATE_VEL_STEER            39#define STATE_VEL_TURRET           40#define STATE_MOTOR_STATUS         41#define STATE_LASER                42#define STATE_COMPASS              43#define STATE_ERROR                44/* * The following defines allow you to access the Smask vector in a  * more readable way. */#define SMASK_POS_DATA             0#define SMASK_IR_1                 1#define SMASK_IR_2                 2#define SMASK_IR_3                 3#define SMASK_IR_4                 4#define SMASK_IR_5                 5#define SMASK_IR_6                 6#define SMASK_IR_7                 7#define SMASK_IR_8                 8#define SMASK_IR_9                 9#define SMASK_IR_10                10#define SMASK_IR_11                11#define SMASK_IR_12                12#define SMASK_IR_13                13#define SMASK_IR_14                14#define SMASK_IR_15                15#define SMASK_IR_16                16#define SMASK_SONAR_1              17#define SMASK_SONAR_2              18#define SMASK_SONAR_3              19#define SMASK_SONAR_4              20#define SMASK_SONAR_5              21#define SMASK_SONAR_6              22#define SMASK_SONAR_7              23#define SMASK_SONAR_8              24#define SMASK_SONAR_9              25#define SMASK_SONAR_10             26#define SMASK_SONAR_11             27#define SMASK_SONAR_12             28#define SMASK_SONAR_13             29#define SMASK_SONAR_14             30#define SMASK_SONAR_15             31#define SMASK_SONAR_16             32 #define SMASK_BUMPER               33#define SMASK_CONF_X               34#define SMASK_CONF_Y               35#define SMASK_CONF_STEER           36#define SMASK_CONF_TURRET          37#define SMASK_VEL_TRANS            38#define SMASK_VEL_STEER            39#define SMASK_VEL_TURRET           40#define SMASK_RESERVED             41#define SMASK_LASER                42#define SMASK_COMPASS              43/* * These defines are used for specifying the control modes in the * robot motion command 'mv'. If MV_IGNORE is specified for an axis * the current motion command for it will remain active. Specifying * MV_VM or MV_PR will select velocity and position control as in  * the vm and pr robot motion commands  */#define MV_IGNORE 0#define MV_VM     1 /* velocity mode */#define MV_PR     2 /* position relative mode */#define MV_LP     3 /* limp mode */#define MV_AC     4 /* set acceleration for vm, pr, pa modes*/#define MV_SP     5 /* set velocity for pr, pa modes */#define MV_PA     6 /* position absolute mode */#define MV_TQ     7 /* torque mode */#define MV_MT     8 /* set maximum torque for vm, pr, pa, tq modes *//* * zeroing modes for arm */#define ZR_CHECK         1#define ZR_ORIENT        2#define ZR_NO_N_GRIPPER  4/*  * user packet constants for arm  */#define ARM_ZR 40#define ARM_WS 41#define ARM_MV 42/* * For requesting the PosData the following defines should be used. * Each sensor has a bit, if it is set the pos-data is attached * when the sensory data is returned. */#define POS_NONE          ( 0 << 0 )#define POS_INFRARED      ( 1 << 0 )#define POS_SONAR         ( 1 << 1 )#define POS_BUMPER        ( 1 << 2 )#define POS_LASER         ( 1 << 3 )#define POS_COMPASS       ( 1 << 4 )/*  * these macros enable the user to determine if the pos-attachment * is requested for a specific sensor. 1 is returned if the  * attachment is requested, 0 otherwise *  * Note that the function posDataCheck() is called (see below) */#define POS_INFRARED_P  ( ( (posDataCheck()) & POS_INFRARED ) ? 1 : 0 )#define POS_SONAR_P     ( ( (posDataCheck()) & POS_SONAR    ) ? 1 : 0 )#define POS_BUMPER_P    ( ( (posDataCheck()) & POS_BUMPER   ) ? 1 : 0 )#define POS_LASER_P     ( ( (posDataCheck()) & POS_LASER    ) ? 1 : 0 )#define POS_COMPASS_P   ( ( (posDataCheck()) & POS_COMPASS  ) ? 1 : 0 )/* * The user will be able to call a function that fills out a  * list of position data for a specific sensor reading.  * To access the sensors in that structure the following defines  * should be used. They should also be used if data for a single * infrared sensor / sonar is requested. */#define POS_IR_1             0#define POS_IR_2             1#define POS_IR_3             2#define POS_IR_4             3#define POS_IR_5             4#define POS_IR_6             5#define POS_IR_7             6 #define POS_IR_8             7#define POS_IR_9             8#define POS_IR_10            9#define POS_IR_11           10#define POS_IR_12           11#define POS_IR_13           12#define POS_IR_14           13#define POS_IR_15           14#define POS_IR_16           15#define POS_SONAR_1          0#define POS_SONAR_2          1#define POS_SONAR_3          2#define POS_SONAR_4          3#define POS_SONAR_5          4#define POS_SONAR_6          5 #define POS_SONAR_7          6  #define POS_SONAR_8          7#define POS_SONAR_9          8#define POS_SONAR_10         9#define POS_SONAR_11        10#define POS_SONAR_12        11#define POS_SONAR_13        12#define POS_SONAR_14        13#define POS_SONAR_15        14#define POS_SONAR_16        15/* Define the length of the user buffer (Maximal short). * Due to Protocol bytes, the effective length is 65526  */#define USER_BUFFER_LENGTH	0xFFFF/******************** *                  * * Type definitions * *                  * ********************//* * The following type definitions are used for the PosData. * PosData is an information packet that is attached to  * each sensor reading, if requested. Note that the use of  * PosData could cause compatibility problems when different * releases of the software are used on the robot and on the * server side.  * * The information packet can be used to determine how up-to-date * a sensory reading is. It contains the configuration of the robot. * This is the most updated configuration at the time of the sensor * reading. However, it is possible that the sensory reading * was taken after the integration of the coniguration. * To determine the interval that has passed two timestamps are in- * cluded in this information package: a timestamp for the computation * of the configuration and another timestamp for the actual capturing * of the senor reading. * * The timestamps are in milliseconds of the internal clock of the  * board that handles the sensors (Intellisys 100 sensor-board). *//* * TimeData contains the current time of the Intellisys 100  * in milliseconds */typedef unsigned long TimeData;/* * ConfigData is where the i486 writes the current configuration * of the robot, so that the Intellisys 100 can attach current * integration values to the sensor readings. * It is also used inside of the Pos data. */typedef struct _ConfigData{    /* the configuration of the robot */    long          configX;    long          configY;    long          configSteer;    long          configTurret;    /* the velocities of the robot*/    long          velTrans;    long          velSteer;    long          velTurret;    /* time of integration in milliseconds (Intellisys 100 time) */    TimeData      timeStamp;} ConfigData;/*  * PosData contains information that is attached to a sensor * reading in order to determine how recent it is. */

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -