|
Fawkes API
Fawkes Development Version
|
Receive transforms and answer queries. More...
#include <>>

Public Member Functions | |
| TransformListener (BlackBoard *bb) | |
| Constructor. | |
| virtual | ~TransformListener () |
| Destructor. | |
| std::string | resolve (const std::string &frame_name) |
| Resolve transform name. | |
| virtual void | bb_interface_created (const char *type, const char *id) throw () |
| BlackBoard interface created notification. | |
| virtual void | bb_interface_data_changed (Interface *interface) throw () |
| BlackBoard data changed notification. | |
| virtual void | bb_interface_writer_removed (Interface *interface, unsigned int instance_serial) throw () |
| A writing instance has been closed for a watched interface. | |
| virtual void | bb_interface_reader_removed (Interface *interface, unsigned int instance_serial) throw () |
| A reading instance has been closed for a watched interface. | |
Public Member Functions inherited from fawkes::tf::Transformer | |
| Transformer (float cache_time_sec=10.0) | |
| Constructor. | |
| virtual | ~Transformer (void) |
| Destructor. | |
| void | clear () |
| Clear cached transforms. | |
| bool | set_transform (const StampedTransform &transform, const std::string &authority="default_authority") |
| Set a transform. | |
| bool | frame_exists (const std::string &frame_id_str) const |
| Check if frame exists. | |
| void | lookup_transform (const std::string &target_frame, const std::string &source_frame, const fawkes::Time &time, StampedTransform &transform) const |
| Lookup transform. | |
| void | lookup_transform (const std::string &target_frame, const std::string &source_frame, StampedTransform &transform) const |
| Lookup transform at latest common time. | |
| void | lookup_transform (const std::string &target_frame, const fawkes::Time &target_time, const std::string &source_frame, const fawkes::Time &source_time, const std::string &fixed_frame, StampedTransform &transform) const |
| Lookup transform assuming a fixed frame. | |
| bool | can_transform (const std::string &target_frame, const std::string &source_frame, const fawkes::Time &time) const |
| Test if a transform is possible. | |
| bool | can_transform (const std::string &target_frame, const fawkes::Time &target_time, const std::string &source_frame, const fawkes::Time &source_time, const std::string &fixed_frame) const |
| Test if a transform is possible. | |
| const TimeCache * | get_frame_cache (const std::string &frame_id) const |
| An accessor to get access to the frame cache. | |
| void | set_enabled (bool enabled) |
| Set transformer enabled or disabled. | |
| bool | is_enabled () const |
| Check if transformer is enabled. | |
| int | get_latest_common_time (const std::string &source_frame, const std::string &target_frame, fawkes::Time &time, std::string *error_string=0) const |
| Get latest common time of two frames. | |
| void | transform_quaternion (const std::string &target_frame, const Stamped< Quaternion > &stamped_in, Stamped< Quaternion > &stamped_out) const |
| Transform a stamped Quaternion into the target frame. | |
| void | transform_vector (const std::string &target_frame, const Stamped< Vector3 > &stamped_in, Stamped< Vector3 > &stamped_out) const |
| Transform a stamped vector into the target frame. | |
| void | transform_point (const std::string &target_frame, const Stamped< Point > &stamped_in, Stamped< Point > &stamped_out) const |
| Transform a stamped point into the target frame. | |
| void | transform_pose (const std::string &target_frame, const Stamped< Pose > &stamped_in, Stamped< Pose > &stamped_out) const |
| Transform a stamped pose into the target frame. | |
| void | transform_quaternion (const std::string &target_frame, const fawkes::Time &target_time, const Stamped< Quaternion > &stamped_in, const std::string &fixed_frame, Stamped< Quaternion > &stamped_out) const |
| Transform a stamped Quaternion into the target frame assuming a fixed frame. | |
| void | transform_vector (const std::string &target_frame, const fawkes::Time &target_time, const Stamped< Vector3 > &stamped_in, const std::string &fixed_frame, Stamped< Vector3 > &stamped_out) const |
| Transform a stamped vector into the target frame assuming a fixed frame. | |
| void | transform_point (const std::string &target_frame, const fawkes::Time &target_time, const Stamped< Point > &stamped_in, const std::string &fixed_frame, Stamped< Point > &stamped_out) const |
| Transform a stamped point into the target frame assuming a fixed frame. | |
| void | transform_pose (const std::string &target_frame, const fawkes::Time &target_time, const Stamped< Pose > &stamped_in, const std::string &fixed_frame, Stamped< Pose > &stamped_out) const |
| Transform a stamped pose into the target frame assuming a fixed frame. | |
Public Member Functions inherited from fawkes::BlackBoardInterfaceObserver | |
| BlackBoardInterfaceObserver () | |
| Empty constructor. | |
| virtual | ~BlackBoardInterfaceObserver () |
| Destructor. | |
| virtual void | bb_interface_destroyed (const char *type, const char *id) throw () |
| BlackBoard interface destroyed notification. | |
Public Member Functions inherited from fawkes::BlackBoardInterfaceListener | |
| BlackBoardInterfaceListener (const char *name_format,...) | |
| Constructor. | |
| virtual | ~BlackBoardInterfaceListener () |
| Destructor. | |
| const char * | bbil_name () const |
| Get BBIL name. | |
| virtual bool | bb_interface_message_received (Interface *interface, Message *message) throw () |
| BlackBoard message received notification. | |
| virtual void | bb_interface_writer_added (Interface *interface, unsigned int instance_serial) throw () |
| A writing instance has been opened for a watched interface. | |
| virtual void | bb_interface_reader_added (Interface *interface, unsigned int instance_serial) throw () |
| A reading instance has been opened for a watched interface. | |
Additional Inherited Members | |
Public Types inherited from fawkes::BlackBoardInterfaceListener | |
| enum | QueueEntryType { DATA = 0, MESSAGES = 1, READER = 2, WRITER = 3 } |
| Queue entry type. More... | |
| typedef std::list< QueueEntry > | InterfaceQueue |
| Queue of additions/removal of interfaces. | |
| typedef std::map< std::string, Interface * > | InterfaceMap |
| Map of currently active event subscriptions. | |
Static Public Attributes inherited from fawkes::tf::Transformer | |
| static const unsigned int | MAX_GRAPH_DEPTH = 100UL |
| Maximum number of times to recurse before assuming the tree has a loop. | |
| static const float | DEFAULT_MAX_EXTRAPOLATION_DISTANCE = 0.f |
| The default amount of time to extrapolate. | |
Protected Types inherited from fawkes::tf::Transformer | |
| typedef std::unordered_map < std::string, CompactFrameID > | M_StringToCompactFrameID |
| Map from string frame ids to CompactFrameID. | |
Protected Types inherited from fawkes::BlackBoardInterfaceObserver | |
| typedef LockMap< std::string, std::list< std::string > > | ObservedInterfaceLockMap |
| Type for lockable interface type hash sets. | |
| typedef ObservedInterfaceLockMap::iterator | ObservedInterfaceLockMapIterator |
| Type for iterator of lockable interface type hash sets. | |
Protected Member Functions inherited from fawkes::tf::Transformer | |
| TimeCache * | get_frame (unsigned int frame_number) const |
| An accessor to get a frame. | |
| CompactFrameID | lookup_frame_number (const std::string &frameid_str) const |
| String to number for frame lookup. | |
| CompactFrameID | lookup_or_insert_frame_number (const std::string &frameid_str) |
| String to number for frame lookup with dynamic allocation of new frames. | |
| std::string | lookup_frame_string (unsigned int frame_id_num) const |
| Get frame ID given its number. | |
Protected Member Functions inherited from fawkes::BlackBoardInterfaceObserver | |
| void | bbio_add_observed_create (const char *type_pattern, const char *id_pattern="*") throw () |
| Add interface creation type to watch list. | |
| void | bbio_add_observed_destroy (const char *type_pattern, const char *id_pattern="*") throw () |
| Add interface destruction type to watch list. | |
| ObservedInterfaceLockMap * | bbio_get_observed_create () throw () |
| Get interface creation type watch list. | |
| ObservedInterfaceLockMap * | bbio_get_observed_destroy () throw () |
| Get interface destriction type watch list. | |
Protected Member Functions inherited from fawkes::BlackBoardInterfaceListener | |
| void | bbil_add_data_interface (Interface *interface) |
| Add an interface to the data modification watch list. | |
| void | bbil_add_message_interface (Interface *interface) |
| Add an interface to the message received watch list. | |
| void | bbil_add_reader_interface (Interface *interface) |
| Add an interface to the reader addition/removal watch list. | |
| void | bbil_add_writer_interface (Interface *interface) |
| Add an interface to the writer addition/removal watch list. | |
| void | bbil_remove_data_interface (Interface *interface) |
| Remove an interface to the data modification watch list. | |
| void | bbil_remove_message_interface (Interface *interface) |
| Remove an interface to the message received watch list. | |
| void | bbil_remove_reader_interface (Interface *interface) |
| Remove an interface to the reader addition/removal watch list. | |
| void | bbil_remove_writer_interface (Interface *interface) |
| Remove an interface to the writer addition/removal watch list. | |
| Interface * | bbil_data_interface (const char *iuid) throw () |
| Get interface instance for given UID. | |
| Interface * | bbil_message_interface (const char *iuid) throw () |
| Get interface instance for given UID. | |
| Interface * | bbil_reader_interface (const char *iuid) throw () |
| Get interface instance for given UID. | |
| Interface * | bbil_writer_interface (const char *iuid) throw () |
| Get interface instance for given UID. | |
Protected Attributes inherited from fawkes::tf::Transformer | |
| bool | enabled_ |
| Flag to mark the transformer as disabled. | |
| M_StringToCompactFrameID | frameIDs_ |
| Map from frame IDs to frame numbers. | |
| std::vector< std::string > | frameIDs_reverse |
| Map from CompactFrameID frame_id_numbers to string for debugging and output. | |
| std::map< CompactFrameID, std::string > | frame_authority_ |
| Map to lookup the most recent authority for a given frame. | |
| std::vector< TimeCache * > | frames_ |
| The pointers to potential frames that the tree can be made of. | |
| Mutex * | frame_mutex_ |
| A mutex to protect testing and allocating new frames on the above vector. | |
| float | cache_time_ |
| How long to cache transform history. | |
| float | max_extrapolation_distance_ |
| whether or not to allow extrapolation | |
| std::string | tf_prefix_ |
| transform prefix to apply as necessary | |
| bool | fall_back_to_wall_time_ |
| Set to true to allow falling back to wall time. | |
Receive transforms and answer queries.
This class connects to the blackboard and listens to all interfaces publishing transforms. It opens all interfaces of type TransformInterface with a TF prefix. The data is internally cached. Queries are then resolved based on the received information.
Definition at line 74 of file transform_listener.h.
| fawkes::tf::TransformListener::TransformListener | ( | BlackBoard * | bb | ) |
Constructor.
| bb | blackboard to listen to |
Definition at line 80 of file transform_listener.cpp.
References fawkes::BlackBoardInterfaceListener::bbil_add_data_interface(), fawkes::BlackBoardInterfaceObserver::bbio_add_observed_create(), fawkes::BlackBoard::open_multiple_for_reading(), fawkes::BlackBoard::register_listener(), fawkes::BlackBoard::register_observer(), and fawkes::tf::Transformer::set_enabled().
|
virtual |
Destructor.
Definition at line 103 of file transform_listener.cpp.
References fawkes::BlackBoard::close(), fawkes::BlackBoard::unregister_listener(), and fawkes::BlackBoard::unregister_observer().
|
virtual |
BlackBoard interface created notification.
This is called whenever an interface is created for a type that you registered for.
| type | type of the interface. If you want to store this make a copy as it is not guaranteed that the supplied string exists for longer than the duration of the method call |
| id | ID of the newly created interface. If you want to store this make a copy as it is not guaranteed that the supplied string exists for longer than the duration of the method call |
Reimplemented from fawkes::BlackBoardInterfaceObserver.
Definition at line 129 of file transform_listener.cpp.
|
virtual |
BlackBoard data changed notification.
This is called whenever the data in an interface that you registered for is modified. This happens if a writer calls the Interface::write() method.
| interface | interface instance that you supplied to bbil_add_data_interface() |
Reimplemented from fawkes::BlackBoardInterfaceListener.
Definition at line 193 of file transform_listener.cpp.
References fawkes::TransformInterface::child_frame(), fawkes::TransformInterface::frame(), fawkes::Interface::read(), fawkes::TransformInterface::rotation(), fawkes::Interface::timestamp(), and fawkes::TransformInterface::translation().
|
virtual |
A reading instance has been closed for a watched interface.
This is called whenever a reading instance of an interface you are watching is closed.
| interface | interface instance that you supplied to bbil_add_reader_interface() |
| instance_serial | the instance serial of the reading instance that has just been removed. |
Reimplemented from fawkes::BlackBoardInterfaceListener.
Definition at line 161 of file transform_listener.cpp.
|
virtual |
A writing instance has been closed for a watched interface.
This is called whenever a writing instance of an interface you are watching is closed.
| interface | interface instance that you supplied to bbil_add_writer_interface() |
| instance_serial | the instance serial of the writing instance that has just been removed. |
Reimplemented from fawkes::BlackBoardInterfaceListener.
Definition at line 152 of file transform_listener.cpp.
| std::string fawkes::tf::TransformListener::resolve | ( | const std::string & | frame_name | ) |
Resolve transform name.
| frame_name | frame name |
Definition at line 123 of file transform_listener.cpp.