libsarathi server proxy class More...
#include <libsarathi.hpp>
Public Member Functions | |
int | initialize (const std::string url, int port) |
Initialize the server proxy object with a hostname/ip-address and port number. | |
int | stop (bool terminate_on_error) |
Send a stop command to the robot. | |
int | set_planner_file (std::string filename) |
Set the scene file for the planner. | |
int | plan_to (std::string spacetype, hyperpoint *from, hyperpoint *to) |
Plan a path between two hyperpoints. | |
int | plan_along (std::string spacetype, hyperarray *keypoints) |
Plan a path along two or more hyperpoints. | |
int | get_path (std::string spacetype, hyperarray *path) |
Get the path planned by the path planner. | |
int | clear_path (void) |
clears any path currently stored within the Sarathi server | |
int | get_position (std::string spacetype, hyperpoint *curr_pos) |
Get current position of the robot and gripper. | |
int | set_position (std::string spacetype, hyperpoint *des_pos) |
Set current position of the robot. | |
int | move (void) |
Move the robot along pre-planned path. | |
int | move_to (std::string spacetype, hyperpoint *point) |
Move the robot from one point to another. | |
int | move_along (std::string spacetype, hyperarray *pointlist) |
Move the robot along a specific set of points. | |
int | get_planning_status (std::string &status, bool &done, bool &result) |
Get the status of the planner. | |
int | get_motion_status (std::string &status, bool &done, bool &result) |
Get the status of the robot motion controller. |
libsarathi server proxy class
An object of this class should be created and then its methods called to perform various actions on the Sarathi server
Definition at line 114 of file libsarathi.hpp.
int libsarathi::serverProxy::clear_path | ( | void | ) |
clears any path currently stored within the Sarathi server
Definition at line 159 of file libsarathi.cpp.
int libsarathi::serverProxy::get_motion_status | ( | std::string & | status, | |
bool & | done, | |||
bool & | result | |||
) |
Get the status of the robot motion controller.
The function returns a string describing whether the robot motion (typically after a move() command) is completed or not. The string also mentions whether the robot actually reached the desired endpoint, or if the motion sequence was aborted before the desired endpoint was reached.
[out] | status | A string describing the motion status |
[out] | done | Value indicating whether the motion is complete |
[out] | result | Value indicating whether the desired endpoint was reached |
Definition at line 241 of file libsarathi.cpp.
int libsarathi::serverProxy::get_path | ( | std::string | spacetype, | |
hyperarray * | path | |||
) |
Get the path planned by the path planner.
The path can be requested either in configuration space or cartesian space. NOTE: In configuration space, the joint values are normalized to [0,1]
[in] | spacetype | The spacetype in which the path must be returned |
[out] | path | A hyperarray containing the planned path |
Definition at line 150 of file libsarathi.cpp.
int libsarathi::serverProxy::get_planning_status | ( | std::string & | status, | |
bool & | done, | |||
bool & | result | |||
) |
Get the status of the planner.
The function returns a string describing whether the planning process is completed and whether the planning was successful or not.
[out] | status | A string describing the planning status |
[out] | done | Value indicating whether the planning process is complete |
[out] | result | Value indicating whether the planning process resulted in a successful plan |
Definition at line 218 of file libsarathi.cpp.
int libsarathi::serverProxy::get_position | ( | std::string | spacetype, | |
hyperpoint * | curr_pos | |||
) |
Get current position of the robot and gripper.
NOTE: In configuration space, the joint values are normalized to [0,1]
[in] | spacetype | The spacetype in which the position must be returned |
[out] | curr_pos | A hyperpoint containing the current position |
Definition at line 169 of file libsarathi.cpp.
int libsarathi::serverProxy::initialize | ( | const std::string | url, | |
int | port | |||
) |
Initialize the server proxy object with a hostname/ip-address and port number.
This will be the address and portnumber which the Sarathi server is running on.
[in] | url | The URL or ip address of the server. e.g: "127.0.0.1" |
[in] | port | The port number the server is listning on |
Definition at line 95 of file libsarathi.cpp.
int libsarathi::serverProxy::move | ( | void | ) |
Move the robot along pre-planned path.
Before using this function, the plan_along function must have successfully planned a path.
Definition at line 188 of file libsarathi.cpp.
int libsarathi::serverProxy::move_along | ( | std::string | spacetype, | |
hyperarray * | pointlist | |||
) |
Move the robot along a specific set of points.
Definition at line 208 of file libsarathi.cpp.
int libsarathi::serverProxy::move_to | ( | std::string | spacetype, | |
hyperpoint * | point | |||
) |
Move the robot from one point to another.
Definition at line 198 of file libsarathi.cpp.
int libsarathi::serverProxy::plan_along | ( | std::string | spacetype, | |
hyperarray * | keypoints | |||
) |
Plan a path along two or more hyperpoints.
Every hyperpoint in the hyperarray argument will be a point in the path. NOTE: If the spacetype is "configuration", the hyperpoints MUST be normalized i.e. be in [0,1] where 0 represents the minimum possible joint angle and 1 represents the maximum.
[in] | spacetype | The spacetype in which the points of the hyperarray are defined. One of 'cartesian' or 'configuration' |
[in] | keypoints | A hyperarray containing the hyperpoints which must be included in the path |
Definition at line 140 of file libsarathi.cpp.
int libsarathi::serverProxy::plan_to | ( | std::string | spacetype, | |
hyperpoint * | from, | |||
hyperpoint * | to | |||
) |
Plan a path between two hyperpoints.
Definition at line 130 of file libsarathi.cpp.
int libsarathi::serverProxy::set_planner_file | ( | std::string | filename | ) |
Set the scene file for the planner.
The file can have either an absolute or a relative path. If a relative path is provided, the server will look for the file in the scenes_directory set for the planner plugin.
[in] | filename | the name of the planner scene file |
Definition at line 120 of file libsarathi.cpp.
int libsarathi::serverProxy::set_position | ( | std::string | spacetype, | |
hyperpoint * | des_pos | |||
) |
Set current position of the robot.
This command totally ignores the path planner/motion controller and directly calls motion function in the robot API NOTE: In configuration space, the joint values specified must be normalized to [0,1]
[in] | spacetype | The spacetype in which the position is specified |
[in] | des_pos | A hyperpoint specifying the position to move to. |
Definition at line 178 of file libsarathi.cpp.
int libsarathi::serverProxy::stop | ( | bool | terminate_on_error | ) |
Send a stop command to the robot.
If terminate_on_error is set to true, the server execution will be terminated, if an error occurs while stopping the robot
[in] | terminate_on_error | set to true if server should be terminated if an error occurs while stopping the robot |
Definition at line 110 of file libsarathi.cpp.