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

📄 nclient.h

📁 卡耐基.梅隆大学的机器人仿真软件(Redhat linux 9下安装)
💻 H
📖 第 1 页 / 共 5 页
字号:
 * st - stops the robot (the robot holds its current position) */int st(void);/* * lp - set motor limp (the robot may not hold its position). */int lp(void);/* * tk - sends the character stream, talk_string, to the voice synthesizer *      to make the robot talk. * * parameters: *    char *talk_string -- the string to be sent to the synthesizer. */int tk(char *talk_string);/* * dp - define the current position of the robot as (x,y) *  * parameters: *    int x, y -- the position to set the robot to. */int dp(int x, int y);/* * zr - zeroing the robot, align steering and turret with bumper zero. *      The position, steering and turret angles are all set to zero. *      This function returns when the zeroing process has completed. */int zr(void);/* * conf_ir - configure infrared sensor system. * * parameters:  *    int history -- specifies the percentage dependency of the current  *                   returned reading on the previous returned reading. *                   It should be set between 0 and 10: 0 = no dependency  *                   10 = full dependency, i.e. the reading will not change *    int order[16] --  specifies the firing sequence of the infrared  *                      (#0 .. #15). You can terminate the order list by a  *                      "255". For example, if you want to use only the  *                      front three infrared sensors then set order[0]=0, *                      order[1]=1, order[2]=15, order[3]=255 (terminator). */int conf_ir(int history, int order[16]);/* * conf_sn - configure sonar sensor system. * * parameters: *    int rate -- specifies the firing rate of the sonar in 4 milli-seconds  *                interval;  *    int order[16] -- specifies the firing sequence of the sonar (#0 .. #15). *                     You can terminate the order list by a "255". For  *                     example, if you want to use only the front three  *                     sensors, then set order[0]=0, order[1]=1, order[2]=15,  *                     order[3]=255 (terminator). */int conf_sn(int rate, int order[16]);/* * conf_cp - configure compass system. *  * parameters: *    int mode -- specifies compass on/off: 0 = off ; 1 = on; 2 = calibrate. *                When you call conf_cp (2), the robot will rotate slowly 360 *                degrees. You must wait till the robot stops rotating before *                issuing another command to the robot (takes ~3 minutes). */int conf_cp(int mode);/* * conf_ls - configure laser sensor system: * * parameters: *    unsigned int mode -- specifies the on-board processing mode of the laser  *                         sensor data which determines the mode of the data  *                         coming back:  *                           the first bit specifies the on/off; *                           the second bit specifies point/line mode; *                           the third to fifth bits specify the  *                           returned data types:  *                             000 = peak pixel,  *                             001 = rise pixel,  *                             010 = fall pixel,  *                             011 = magnitude, *                             100 = distance; *                           the sixth bit specifies data integrity checking. * *   unsigned int threshold -- specifies the inverted acceptable brightness *                             of the laser line.  * *   unsigned int width -- specifies the acceptable width in terms *                         of number of pixels that are brighter than the  *                         set threshold. *   *   unsigned int num_data -- specifies the number of sampling points.  *   unsigned int processing --  specifies the number of neighboring  *                               pixels for averaging * * If you don't understand the above, try this one: *   conf_ls(51, 20, 20, 20, 4) */int conf_ls(unsigned int mode,	    unsigned int threshold,	    unsigned int width,	    unsigned int num_data,	    unsigned int processing);/* * conf_tm - sets the timeout period of the robot in seconds. If the *           robot has not received a command from the host computer *           for more than the timeout period, it will abort its  *           current motion *  * parameters: *    unsigned int timeout -- timeout period in seconds. If it is 0, there *                            will be no timeout on the robot. */int conf_tm(unsigned char timeout);/* * get_ir - get infrared data, independent of mask. However, only  *          the active infrared sensor readings are valid. It updates *          the State vector. */int get_ir(void);/* * get_sn - get sonar data, independent of mask. However, only  *          the active sonar sensor readings are valid. It updates *          the State vector. */int get_sn(void);/* * get_rc - get robot configuration data (x, y, th, tu), independent of  *          mask. It updates the State vector. */int get_rc(void);/* * get_rv - get robot velocities (translation, steering, and turret) data, *          independent of mask. It updates the State vector. */int get_rv(void);/* * get_ra - get robot acceleration (translation, steering, and turret) data, *          independent of mask. It updates the State vector. */int get_ra(void);/* * get_cp - get compass data, independent of mask. However, the *          data is valid only if the compass is on. It updates the *          State vector. */int get_cp(void);/* * get_ls - get laser data point mode, independent of mask. However the *          data is valid only of the laser is on. It updates the Laser  *          vector. */int get_ls(void);/* * get_bp - get bumper data, independent of mask. It updates the State *          vector. */int get_bp(void);/* * conf_sg - configure laser sensor system line segment processing mode: * * parameters: *    unsigned int threshold -- specifies the threshold value for least-square *                             fitting. When the error term grows above the  *                             threshold, the line segment will be broken *    unsigned int min_points -- specifies the acceptable number of points *                              to form a line segment. *    unsigned int gap -- specifies the acceptable "gap" between two segments *                        while they can still be treated as one (in 1/10 inch) * * If you don't understand the above, try this one: *    conf_sg(50, 4, 30) */int conf_sg(unsigned int threshold, 	    unsigned int min_points, 	    unsigned int gap);/* * get_sg - get laser data line mode, independent of mask. It updates *          the laser vector. */int get_sg(void);/* * da - define the current steering angle of the robot to be th *      and the current turret angle of the robot to be tu. *  * parameters: *    int th, tu -- the steering and turret orientations to set the *                  robot to. */int da(int th, int tu);/* * ws - waits for stop of motors of the robot. This function is intended   *      to be used in conjunction with pr() and pa() to detect the desired *      motion has finished * * parameters: *    unsigned char t_ws, s_ws, r_ws -- These three parameters specify  *                                      which axis or combination of axis  *                                      (translation, steering, and turret)  *                                      to wait.  *    unsigned char timeout -- specifies how long to wait before timing out  *                             (return without stopping the robot). */int ws(unsigned char t_ws, unsigned char s_ws,       unsigned char r_ws, unsigned char timeout);/* * get_rpx - get the position of all nearby robots */int get_rpx(long *robot_pos);/***************************** *                           * * World Interface Functions * *                           * *****************************//* * add_obstacle - creates an obstacle and adds it to the obstacle list *                of the robot environment.  *  * No effect in direct mode. *  * parameters: *    long obs[2*MAX_VERTICES+1] --  *                The first element of obs specifies the number of  *                vertices of the polygonal obstacle (must be no greater  *                than MAX_VERTICES). The subsequent elements of obs  *                specifies the x and y coordinates of the vertices,  *                in counter-clockwise direction. */int add_obstacle(long obs[2*MAX_VERTICES+1]);/* * add_Obs - is the same as add_obstacle, for backward compatibility */int add_Obs(long obs[2*MAX_VERTICES+1]);/* * delete_obstacle - deletes an obstacle specified by obs from the robot  *                   environment  * parameters: *    long obs[2*MAX_VERTICES+1] --  *                The first element of obs specifies the number of  *                vertices of the polygonal obstacle (must be no greater  *                than MAX_VERTICES). The subsequent elements of obs  *                specifies the x and y coordinates of the vertices,  *                in counter-clockwise direction. */int delete_obstacle(long obs[2*MAX_VERTICES+1]);/* * delete_Obs - is the same as delete_obstacle, for backward compatibility */int delete_Obs(long obs[2*MAX_VERTICES+1]);/* * move_obstacle - moves the obstacle obs by dx along x direction and  *                 dy along y direction. obs is modified. * * No effect in direct mode. *  * parameters: *    long obs[2*MAX_VERTICES+1] --  *                The first element of obs specifies the number of  *                vertices of the polygonal obstacle (must be no greater  *                than MAX_VERTICES). The subsequent elements of obs  *                specifies the x and y coordinates of the vertices,  *                in counter-clockwise direction. *    long dx, dy -- the x and y distances to translate the obstacle */int move_obstacle(long obs[2*MAX_VERTICES+1], long dx, long dy);/* * move_Obs - is the same as move_obstacle, for backward compatibility * * No effect in direct mode. *  */int move_Obs(long obs[2*MAX_VERTICES+1], long dx, long dy);/* * new_world - deletes all obstacles in the current robot world * * No effect in direct mode. *  */int new_world(void);/**************************** *                          * * Graphics refresh control * *                          * ****************************//* * refresh_all - causes all temporary drawing in graphics window, including *               traces, sensors, and client graphics to be erased */int refresh_all(void);/* * refresh_all_traces - causes all robot traces in graphics to be erased */int refresh_all_traces(void);/* * refresh_actual_trace - causes actual robot trace in graphics to be erased */int refresh_actual_trace(void);/* * refresh_encoder_trace - causes encoder robot trace in graphics to be erased */int refresh_encoder_trace(void);/* * refresh_all_sensors - causes all sensor drawings in graphics to be erased */int refresh_all_sensors(void);/* * refresh_bumper_sensor - causes bumper drawings in graphics to be erased */int refresh_bumper_sensor(void);/* * refresh_infrared_sensor - causes infrared drawings in graphics to be erased */int refresh_infrared_sensor(void);/* * refresh_sonar_sensor - causes sonar drawings in graphics to be erased */int refresh_sonar_sensor(void);

⌨️ 快捷键说明

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