gen_rest_poses.cc File Reference

Obtain object rest poses. More...

#include "gen_rest_poses.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, std::string &obj_cfg_dir, std::string &out_rest_dir)
 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...
 
void getTargetRestPose (gazebo::transport::PublisherPtr pub)
 Requests target object rest pose. More...
 
bool waitingTrigger (std::mutex &mutex, bool &trigger)
 Returns whether to keep waiting for trigger. More...
 
void onTargetResponse (TargetResponsePtr &_msg)
 Callback for Target plugin response. More...
 
void waitMs (int delay)
 TODO. More...
 

Variables

bool g_resting {false}
 Global object resting flag. More...
 
std::mutex g_resting_mutex
 Mutex for global object resting flag. More...
 
const ignition::math::Pose3d INIT_POSE {0,0,0.1,0,0,0}
 Global initial object pose. More...
 
ignition::math::Pose3d g_rest_pose {0,0,0,0,0,0}
 Global object resting pose. More...
 

Detailed Description

Obtain object rest poses.

Drop each object in dataset from given pose and record rest pose

Author
João Borrego : jsbruglie

Function Documentation

void getTargetRestPose ( gazebo::transport::PublisherPtr  pub)

Requests target object rest pose.

Parameters
pubPublisher to target's topic
const std::string getUsage ( const char *  argv_0)

Obtains usage string.

Returns usage string.

Parameters
argv_0Name of the executable
Returns
String with command-line usage
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 onTargetResponse ( TargetResponsePtr _msg)

Callback for Target plugin response.

TODO.

void parseArgs ( int  argc,
char **  argv,
std::string &  obj_cfg_dir,
std::string &  out_rest_dir 
)

Parses command-line arguments.

Parameters
argcArgument count
argvArguments
obj_cfg_dirPath to object dataset yaml
out_rest_dirDirectory for output rest poses
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.

Parameters
nodeGazebo communication node pointer
pubsResulting map of publishers
subsResulting map of subscribers
bool waitingTrigger ( std::mutex &  mutex,
bool &  trigger 
)

Returns whether to keep waiting for trigger.

Parameters
mutexMutex that protects trigger variable
triggerTrigger boolean variable
Returns
True as long as trigger is false, false otherwise
void waitMs ( int  delay)
inline

TODO.

Waits for delay milliseconds.

Variable Documentation

ignition::math::Pose3d g_rest_pose {0,0,0,0,0,0}

Global object resting pose.

bool g_resting {false}

Global object resting flag.

std::mutex g_resting_mutex

Mutex for global object resting flag.

const ignition::math::Pose3d INIT_POSE {0,0,0.1,0,0,0}

Global initial object pose.