00001 #ifndef __LIBSARATHI__
00002 #define __LIBSARATHI__
00003
00014 #include "../gsoap/soapsarathiProxy.h"
00015
00016 #include <stdexcept>
00017
00018 #define SOME_ERROR_OCCURRED -1
00019 #define ALL_OK 1
00020
00021 namespace libsarathi {
00022
00029 class sException: public virtual std::runtime_error {
00030 public:
00037 sException() throw();
00045 sException(std::string faultstr, std::string detailstr) throw();
00056 sException(std::string faultstr, std::string detailstr, int errcode) throw();
00057 ~sException() throw();
00058
00065 virtual const char *detail() const throw();
00072 virtual const char *hint() const throw();
00079 virtual void get_exceptiondata(hyperpoint &point) const throw();
00086 virtual void get_exceptiondata(hyperarray &array) const throw();
00095 virtual int errorcode() const throw();
00096
00097 private:
00098 int errcode;
00099 std::string detailstring;
00100 std::string hintstring;
00101
00102 hyperpoint exceptiondata_point;
00103 hyperarray exceptiondata_array;
00104
00105 };
00106
00114 class serverProxy {
00115 private:
00116 sarathiProxy *sarathiServer;
00117 void handle_error();
00118 public:
00119
00120 serverProxy();
00121 ~serverProxy();
00131 int initialize (const std::string url, int port);
00140 int stop (bool terminate_on_error);
00150 int set_planner_file(std::string filename);
00159 int plan_to(std::string spacetype, hyperpoint *from, hyperpoint *to);
00171 int plan_along(std::string spacetype, hyperarray *keypoints);
00182 int get_path (std::string spacetype, hyperarray* path);
00189 int clear_path(void);
00198 int get_position (std::string spacetype, hyperpoint *curr_pos);
00208 int set_position (std::string spacetype, hyperpoint *des_pos);
00215 int move(void);
00222 int move_to (std::string spacetype, hyperpoint *point);
00229 int move_along (std::string spacetype, hyperarray *pointlist);
00240 int get_planning_status (std::string &status, bool &done, bool &result);
00252 int get_motion_status (std::string &status, bool &done, bool &result);
00253
00254 };
00255
00256 }
00257
00258 #endif // __LIBSARATHI__