#include <FakeObjectRecognizer.h>
Public Member Functions | |
FakeObjectRecognizer () | |
virtual | ~FakeObjectRecognizer () |
Private Types | |
typedef object_msgs::ObjectInfo | ObjectInfoMsg |
typedef object_msgs::Object | ObjectMsg |
Private Member Functions | |
void | publishRecognitionEvent (const ros::TimerEvent &e) |
bool | queryObjectInfo (const std::string &name, object_msgs::Object &object, bool include_geometry, bool printErrors) |
bool | recognizeObject (gazebo_test_tools::RecognizeGazeboObject::Request &req, gazebo_test_tools::RecognizeGazeboObject::Response &res) |
bool | waitForQueryObjectInfo (const std::string &name, object_msgs::Object &object, bool include_geometry, float timeout, float checkStep, bool printErrors) |
Private Attributes | |
std::set< std::string > | addedObjects |
boost::mutex | addedObjectsMtx |
ros::NodeHandle | node |
ros::ServiceClient | object_info_client |
ros::Publisher | object_pub |
std::string | OBJECTS_TOPIC |
float | PUBLISH_RECOGNISED_OBJECT_RATE |
ros::Timer | publishTimer |
ros::ServiceServer | recognize_object_srv |
ros::ServiceClient | register_object_tf_client |
std::string | SERVICE_RECOGNISE_OBJECT_TOPIC |
std::string | SERVICE_REGISTER_OBJECT_TF_TOPIC |
std::string | SERVICE_REQUEST_OBJECT_TOPIC |
Provides a service which publishes a object_msgs/Object, after the a service request of type *gazebo_test_tools/RecognizeGazeboObject* is received.
Note that the class gazebo_state_plugins/GazeboObjectInfo also offers the functionality to continusously publish object_msgs/Object.msg, but it does so for *all* existing objects (except the ones excluded at start-up). With the FakeObjectRecognizer, it is possible to switch on/off the publishing of object_msgs/Object information for specific objects only at various times. Because of this, when you use FakeObjectRecogniser, you will need to make sure that gazebo_state_plugins/GazeboObjectInfo is run with this parameter set to false:
``gazebo_state_plugins/publish_world_objects: false``
This is because in this case, you want the FakeObjectRecognizer to be the one to publish the information instead of GazeboObjectInfo.
Definition at line 41 of file FakeObjectRecognizer.h.
typedef object_msgs::ObjectInfo gazebo_test_tools::FakeObjectRecognizer::ObjectInfoMsg [private] |
Definition at line 45 of file FakeObjectRecognizer.h.
typedef object_msgs::Object gazebo_test_tools::FakeObjectRecognizer::ObjectMsg [private] |
Definition at line 44 of file FakeObjectRecognizer.h.
Definition at line 15 of file FakeObjectRecognizer.cpp.
FakeObjectRecognizer::~FakeObjectRecognizer | ( | ) | [virtual] |
Definition at line 43 of file FakeObjectRecognizer.cpp.
void FakeObjectRecognizer::publishRecognitionEvent | ( | const ros::TimerEvent & | e | ) | [private] |
Definition at line 46 of file FakeObjectRecognizer.cpp.
bool FakeObjectRecognizer::queryObjectInfo | ( | const std::string & | name, |
object_msgs::Object & | object, | ||
bool | include_geometry, | ||
bool | printErrors | ||
) | [private] |
Uses the object information service to request object information
Definition at line 137 of file FakeObjectRecognizer.cpp.
bool FakeObjectRecognizer::recognizeObject | ( | gazebo_test_tools::RecognizeGazeboObject::Request & | req, |
gazebo_test_tools::RecognizeGazeboObject::Response & | res | ||
) | [private] |
Definition at line 66 of file FakeObjectRecognizer.cpp.
bool FakeObjectRecognizer::waitForQueryObjectInfo | ( | const std::string & | name, |
object_msgs::Object & | object, | ||
bool | include_geometry, | ||
float | timeout, | ||
float | checkStep, | ||
bool | printErrors | ||
) | [private] |
Like queryObjectInfo but waits a maximum of timeout and re-requests the information every checkStep seconds.
Definition at line 122 of file FakeObjectRecognizer.cpp.
std::set<std::string> gazebo_test_tools::FakeObjectRecognizer::addedObjects [private] |
Definition at line 98 of file FakeObjectRecognizer.h.
boost::mutex gazebo_test_tools::FakeObjectRecognizer::addedObjectsMtx [private] |
Definition at line 101 of file FakeObjectRecognizer.h.
Definition at line 105 of file FakeObjectRecognizer.h.
Definition at line 92 of file FakeObjectRecognizer.h.
Definition at line 91 of file FakeObjectRecognizer.h.
std::string gazebo_test_tools::FakeObjectRecognizer::OBJECTS_TOPIC [private] |
Definition at line 71 of file FakeObjectRecognizer.h.
Definition at line 89 of file FakeObjectRecognizer.h.
Definition at line 103 of file FakeObjectRecognizer.h.
Definition at line 95 of file FakeObjectRecognizer.h.
Definition at line 93 of file FakeObjectRecognizer.h.
std::string gazebo_test_tools::FakeObjectRecognizer::SERVICE_RECOGNISE_OBJECT_TOPIC [private] |
Definition at line 79 of file FakeObjectRecognizer.h.
std::string gazebo_test_tools::FakeObjectRecognizer::SERVICE_REGISTER_OBJECT_TF_TOPIC [private] |
Definition at line 85 of file FakeObjectRecognizer.h.
std::string gazebo_test_tools::FakeObjectRecognizer::SERVICE_REQUEST_OBJECT_TOPIC [private] |
Definition at line 75 of file FakeObjectRecognizer.h.