A grasp database entity. More...
#include <Grasp.h>
Public Member Functions | |
uint32_t | getAttempts () const |
Attempts value accessor. | |
const std::string & | getEefFrameID () const |
End effector frame ID value accessor. | |
uint32_t | getGraspModelID () const |
Grasp model ID value accessor. | |
const Pose & | getGraspPose () const |
Grasp pose value accessor (immutable). | |
Pose & | getGraspPose () |
Grasp pose value accessor. | |
uint32_t | getSuccesses () const |
Successes value accessor. | |
double | getSuccessRate () const |
Get the success rate. | |
Grasp (const uint32_t id=Entity::UNSET_ID, const uint32_t grasp_model_id=Entity::UNSET_ID, const Pose &grasp_pose=Pose(), const std::string &eef_frame_id="", const uint32_t successes=0, const uint32_t attempts=0, const time_t created=Entity::UNSET_TIME) | |
Create a new Grasp. | |
Grasp (const Pose &grasp_pose, const uint32_t grasp_model_id, const std::string &eef_frame_id, const uint32_t successes, const uint32_t attempts) | |
Create a new Grasp. | |
Grasp (const rail_pick_and_place_msgs::GraspWithSuccessRate &g, const uint32_t grasp_model_id) | |
Create a new Grasp. | |
void | setAttempts (const uint32_t attempts) |
Attempts value mutator. | |
void | setEefFrameID (const std::string &eef_frame_id) |
End effector frame ID value mutator. | |
void | setGraspModelID (const uint32_t grasp_model_id) |
Grasp model ID value mutator. | |
void | setGraspPose (const Pose &grasp_pose) |
Grasp pose value mutator. | |
void | setSuccesses (const uint32_t successes) |
Successes value mutator. | |
rail_pick_and_place_msgs::GraspWithSuccessRate | toROSGraspWithSuccessRateMessage () const |
Private Attributes | |
uint32_t | attempts_ |
std::string | eef_frame_id_ |
uint32_t | grasp_model_id_ |
Pose | grasp_pose_ |
uint32_t | successes_ |
A grasp database entity.
A grasp contains information about a single grasp in the grasp database. This contains information about the grasp pose, end effector frame identifier, number of recorded successful grasps, number of recorded attempted grasps, and associated model ID. A valid database entity has an ID and created timestamp. This class is useful for internal data management within the graspdb library. Convenience functions are added for use with ROS messages.
rail::pick_and_place::graspdb::Grasp::Grasp | ( | const uint32_t | id = Entity::UNSET_ID , |
const uint32_t | grasp_model_id = Entity::UNSET_ID , |
||
const Pose & | grasp_pose = Pose() , |
||
const std::string & | eef_frame_id = "" , |
||
const uint32_t | successes = 0 , |
||
const uint32_t | attempts = 0 , |
||
const time_t | created = Entity::UNSET_TIME |
||
) |
Create a new Grasp.
Creates a new Grasp with the given values. This constructor assumes a valid ID and timestamp are known.
id | The unique ID of the database entry (defaults to 0). |
grasp_model_id | The ID of the associated grasp model entry (defaults to 0). |
grasp_pose | The pose of the grasp (defaults to an empty Pose). |
eef_frame_id | The frame identifier for the end effector (defaults to the empty string). |
successes | The number of recorded successful grasps (defaults to 0). |
attempts | The number of recorded attempted grasps (defaults to 0). |
created | The created timestamp (defaults to 0). |
rail::pick_and_place::graspdb::Grasp::Grasp | ( | const Pose & | grasp_pose, |
const uint32_t | grasp_model_id, | ||
const std::string & | eef_frame_id, | ||
const uint32_t | successes, | ||
const uint32_t | attempts | ||
) |
Create a new Grasp.
Creates a new Grasp with the given values. This constructor assumes no valid ID and timestamp are known (e.g., for use when inserting into the database).
grasp_pose | The pose of the grasp. |
grasp_model_id | The valid ID of the associated grasp model entry. |
successes | The number of recorded successful grasps. |
attempts | The number of recorded attempted grasps. |
eef_frame_id | The frame identifier for the end effector used (defaults to the empty string). |
Grasp::Grasp | ( | const rail_pick_and_place_msgs::GraspWithSuccessRate & | g, |
const uint32_t | grasp_model_id | ||
) |
uint32_t Grasp::getAttempts | ( | ) | const |
const string & Grasp::getEefFrameID | ( | ) | const |
uint32_t Grasp::getGraspModelID | ( | ) | const |
const Pose & Grasp::getGraspPose | ( | ) | const |
Pose & Grasp::getGraspPose | ( | ) |
uint32_t Grasp::getSuccesses | ( | ) | const |
double Grasp::getSuccessRate | ( | ) | const |
void Grasp::setAttempts | ( | const uint32_t | attempts | ) |
void Grasp::setEefFrameID | ( | const std::string & | eef_frame_id | ) |
void Grasp::setGraspModelID | ( | const uint32_t | grasp_model_id | ) |
void Grasp::setGraspPose | ( | const Pose & | grasp_pose | ) |
void Grasp::setSuccesses | ( | const uint32_t | successes | ) |
rail_pick_and_place_msgs::GraspWithSuccessRate Grasp::toROSGraspWithSuccessRateMessage | ( | ) | const |
uint32_t rail::pick_and_place::graspdb::Grasp::attempts_ [private] |
std::string rail::pick_and_place::graspdb::Grasp::eef_frame_id_ [private] |
uint32_t rail::pick_and_place::graspdb::Grasp::grasp_model_id_ [private] |
uint32_t rail::pick_and_place::graspdb::Grasp::successes_ [private] |