Content-type: text/html Manpage of libRD11

libRD11

Section: CIM Mobile Robotics Lab (3)
Updated: May 1998
Index Return to Main Contents
 

NAME

libRD11 - C Routines for using RD11 via sockets.  

SYNOPSIS

#include <RD11.h>


typedef struct {
  float X;
  float Y;
  float Theta;
} RD_Pose, * RD_Pose_Ptr;

typedef enum {RD_NO_ERR, RD_BAD_ARGS, RD_NO_CONNECTION, RD_SYS_ERR, 
              RD_MEM_ERR, RD_SOCK_ERR, RD_COMMAND_ERR} RD_Err_Type;

typedef enum {RD_NOMAD_SIMULATOR=0, RD_RWI_SIMULATOR=1,
              RD_SCOUT_SIMULATOR=2, RD_NOMAD=3, RD_RWI=4, RD_SCOUT=5,
              RD_CYBER=6, RD_CYBER_SIMULATOR=7, RD_POINT_SIMULATOR=8} 
             RD_Robot_Type; 

RD_Err_Type RD_Err_No;

int RD_Connect(char *Host_Name, char *Socket_Number);
int RD_Disconnect(void);
int RD_Set_Verbosity(int Verbosity);
int RD_Create(RD_Robot_Type Robot, char *Name, char *Args);
int RD_Create_No_Zero (RD_Robot_Type Robot, char *Name, 

char *Args, float x, float y,
float th, float turret); int RD_Destroy(char *Name); int RD_Send_Command(char *Command, char *Result); int RD_Abs_Rotate(char *Name, float Theta, float *Delta); int RD_Rel_Rotate(char *Name, float Theta, float *Delta); int RD_Abs_Move(char *Name, float *X, float *Y, char *Mode,
float *Delta); int RD_Rel_Move(char *Name, float *X, float *Y, char *Mode,
float *Delta); int RD_Translate(char *Name, float Distance, char *Mode,
float *Delta); int RD_Sonar(char *Name, char *Mode, float *Data_Array); int RD_Infra_Red(char *Name, char *Mode, float *Data_Array); int RD_Bumper(char *Name, char *Arg, float *Theta); int RD_Get_Variable(char *Variable, char *Value); int RD_Set_Variable(char *Variable, char *Value); int RD_Get_Pose(char *Name, RD_Pose_Ptr Pose); int RD_Set_Pose(char *Name, RD_Pose_Ptr Pose); int RD_Estop (char *Name);

 

DESCRIPTION

WARNING!! The functions described in this document are sorely undocumented. If you use them and figure out how they work- please add some verbosity to this doc.

Connecting To Daemon

Before any of these functions can be used, RD11 must be running.

The first function call must be RD_Connect, which establishes the socket connection to RD11. The parameters are two strings containing the machine name running RD11, and the socket number at which it expects connection requests. If either of these two strings is NULL, a default is supplied. The default machine name is the host machine running libRD11, and the default socket number is 5090.

When you're done with the robot, be nice to RD11 and call RD_Disconnect

Creating and Destroying Robots

RD_Create creates a robot of the type indicated by the value of Robot; see the enumeration definition above for allowable values of RD_Robot_Type. Name is the unique identifier string that you choose for your robot. If it is not unique, RD11 reserves the right to change it- causing confusion for you, no doubt. As of the writing of this man page, the value of Args is ignored.

RD_Create_No_Zero gives you some control over the initial pose of the robot, and prevents RD11 from zero-ing the turret.

RD_Destroy destroys the robot specified by Name.

Moving and Rotating Robots

The behaviour of RD_[Abs|Rel]_[Rotate|Move] and RD_Translate is self-evident to the author. Figure it out. The Delta argument appears to be ignored, and the Mode argument, if non-null, presumably sets the path planning mode- but you never know.

Acquiring Data

RD_[Get|Set]_Pose perform the obvious functions.

RD_Sonar requests a sonar scan from the robot. Every five values in the return array corresponds to a single ping from a single transducer- the first three referring to the robot's pose, and the last two to the ping (relative to the robot, by default. Trial and error is the best way to figure out what coordinate system these values are in (sorry). Keep in mind that it's the user's job to make sure that the float* points to sufficient memory for the operation.

RD_Infra_Red has the same behaviour as RD_Sonar except that it uses the infra-red sensors. DUH!

RD_Bumper has never been used by the author.

Miscellany

RD_SendCommand is your ticket to RD11 freedom. Use this to send any command you'd like to RD11. Treat this command as if you were typing commands at the prompt. It's your job to parse the result.

RD_[Get|Set]_Variable does just what the name implies.

RD_Estop is a software emergency stop, and probably not to be trusted.

Diagnostics

RD_Set_Verbosity changes the verbosity of libRD11. Currently that only affects diagnostic messages at the socket level- which may include feedback on what's being read/written. Try it for yourself.

 

RETURN VALUES

All functions with return 0 on success, and -1 on an error.

 

FILES

/local/mrl/include/RD11.h
header file
/local/mrl/lib/libRD11.a
library object code

 

SEE ALSO

RD11 (1)       for RD11 manual

 

AUTHOR


This page was authored by
Robert Sim (simra@cim.mcgill.ca)
Centre for Intelligent Machines
McGill University, Montreal, Quebec, Canada.

libRD11 was authored by somebody else who should lay claim to this
space.


 

Index

NAME
SYNOPSIS
DESCRIPTION
RETURN VALUES
FILES
SEE ALSO
AUTHOR

This document was created by man2html, using the manual pages.
Time: 19:58:57 GMT, January 29, 2002