Performs grasp trials. More...
#include "run_trials.hh"Functions | |
| int | main (int _argc, char **_argv) |
| const std::string | getUsage (const char *argv_0) |
| Obtains usage string. More... | |
| void | parseArgs (int argc, char **argv, Config &config) |
| Parses command-line arguments. More... | |
| void | setupCommunications (gazebo::transport::NodePtr &node, std::map< std::string, gazebo::transport::PublisherPtr > &pubs, std::map< std::string, gazebo::transport::SubscriberPtr > &subs) |
| Sets up gazebo communication pubs/subs. More... | |
| void | obtainTargets (std::vector< std::string > &targets, const std::string &file_name) |
| TODO. More... | |
| bool | importGrasps (const std::string &grasp_cfg_dir, const std::string &robot, const std::string &object_name, std::vector< Grasp > &grasps) |
| Obtain list of grasps in yml files. More... | |
| void | exportGraspMetrics (const std::string &trials_out_dir, const std::string &robot, const std::string &object_name, const std::vector< Grasp > &grasps) |
| Export set of metrics to file. More... | |
| void | checkHandCollisions (gazebo::transport::PublisherPtr pub, const std::string &hand, std::vector< std::string > &targets) |
| Requests collisions in the world. More... | |
| void | getTargetPose (gazebo::transport::PublisherPtr pub, bool rest) |
| void | resetTarget (gazebo::transport::PublisherPtr pub) |
| Resets target object to rest pose. More... | |
| void | tryGrasp (Grasp &grasp, Interface &interface, std::map< std::string, gazebo::transport::PublisherPtr > &pubs, const std::string &target) |
| Attempts to grasp object. More... | |
| void | waitForTrigger (int timeout) |
| Waits for condition variable. More... | |
| void | onHandResponse (HandMsgPtr &_msg) |
| TODO. More... | |
| void | onTargetResponse (TargetResponsePtr &_msg) |
| Callback for Target plugin response. More... | |
| void | onContactResponse (ContactResponsePtr &_msg) |
| TODO. More... | |
| void | waitMs (int delay) |
| TODO. More... | |
Variables | |
| std::condition_variable | g_timeout_var |
| std::mutex | g_timeout_mutex |
| Mutex for condition variables. More... | |
| ignition::math::Pose3d | g_safe_pose {0,0,0.9,0,0,0} |
| Global hand resting pose. More... | |
| ignition::math::Pose3d | g_obj_pose {0.5,0.5,0.1,0,0,0} |
| Global object pose. More... | |
| ignition::math::Pose3d | g_rest_pose {0,0,0,0,0,0} |
| Global object resting pose. More... | |
| bool | g_success {false} |
| Global trial outcome. More... | |
Performs grasp trials.
TODO
| void checkHandCollisions | ( | gazebo::transport::PublisherPtr | pub, |
| const std::string & | hand, | ||
| std::vector< std::string > & | targets | ||
| ) |
Requests collisions in the world.
| pub | Publisher to contact topic |
| target | The target object name |
| hand | The hand model name |
| void exportGraspMetrics | ( | const std::string & | trials_out_dir, |
| const std::string & | robot, | ||
| const std::string & | object_name, | ||
| const std::vector< Grasp > & | grasps | ||
| ) |
| void getTargetPose | ( | gazebo::transport::PublisherPtr | pub, |
| bool | rest | ||
| ) |
| const std::string getUsage | ( | const char * | argv_0 | ) |
Obtains usage string.
Returns usage string.
| argv_0 | Name of the executable |
| bool importGrasps | ( | const std::string & | grasp_cfg_dir, |
| const std::string & | robot, | ||
| const std::string & | object_name, | ||
| std::vector< Grasp > & | grasps | ||
| ) |
| int main | ( | int | _argc, |
| char ** | _argv | ||
| ) |
| void obtainTargets | ( | std::vector< std::string > & | targets, |
| const std::string & | file_name | ||
| ) |
TODO.
Obtain list of models' names in dataset yml.
| void onContactResponse | ( | ContactResponsePtr & | _msg | ) |
TODO.
| void onHandResponse | ( | HandMsgPtr & | _msg | ) |
TODO.
| void onTargetResponse | ( | TargetResponsePtr & | _msg | ) |
Callback for Target plugin response.
TODO.
| void parseArgs | ( | int | argc, |
| char ** | argv, | ||
| Config & | config | ||
| ) |
Parses command-line arguments.
| argc | Argument count |
| argv | Arguments |
| config | Configuration YAML node |
| void resetTarget | ( | gazebo::transport::PublisherPtr | pub | ) |
Resets target object to rest pose.
| pub | Publisher to target's topic |
| void setupCommunications | ( | gazebo::transport::NodePtr & | node, |
| std::map< std::string, gazebo::transport::PublisherPtr > & | pubs, | ||
| std::map< std::string, gazebo::transport::SubscriberPtr > & | subs | ||
| ) |
Sets up gazebo communication pubs/subs.
| node | Gazebo communication node pointer |
| pubs | Resulting map of publishers |
| subs | Resulting map of subscribers |
| void tryGrasp | ( | Grasp & | grasp, |
| Interface & | interface, | ||
| std::map< std::string, gazebo::transport::PublisherPtr > & | pubs, | ||
| const std::string & | model_name | ||
| ) |
Attempts to grasp object.
| grasp | The grasp configuration |
| pubs | Map of publishers |
| model_name | Target object model name |
| void waitForTrigger | ( | int | timeout = -1 | ) |
Waits for condition variable.
| timeout | Timeout value in milliseconds |
|
inline |
TODO.
Waits for delay milliseconds.
| ignition::math::Pose3d g_obj_pose {0.5,0.5,0.1,0,0,0} |
Global object pose.
| ignition::math::Pose3d g_rest_pose {0,0,0,0,0,0} |
Global object resting pose.
| ignition::math::Pose3d g_safe_pose {0,0,0.9,0,0,0} |
Global hand resting pose.
| bool g_success {false} |
Global trial outcome.
| std::mutex g_timeout_mutex |
Mutex for condition variables.
| std::condition_variable g_timeout_var |