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. |
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.
fawkes::tf::TransformListener::TransformListener | ( | BlackBoard * | bb | ) |
Constructor.
bb | blackboard to listen to |
Definition at line 80 of file transform_listener.cpp.
References fawkes::BlackBoard::open_multiple_for_reading(), fawkes::BlackBoardInterfaceListener::bbil_add_data_interface(), fawkes::BlackBoard::register_listener(), fawkes::BlackBoardInterfaceObserver::bbio_add_observed_create(), fawkes::BlackBoard::register_observer(), and fawkes::tf::Transformer::set_enabled().
fawkes::tf::TransformListener::~TransformListener | ( | ) | [virtual] |
Destructor.
Definition at line 103 of file transform_listener.cpp.
References fawkes::BlackBoard::unregister_listener(), fawkes::BlackBoard::unregister_observer(), and fawkes::BlackBoard::close().
void fawkes::tf::TransformListener::bb_interface_created | ( | const char * | type, |
const char * | id | ||
) | throw () [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.
void fawkes::tf::TransformListener::bb_interface_data_changed | ( | Interface * | interface | ) | throw () [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::Interface::read(), fawkes::TransformInterface::translation(), fawkes::TransformInterface::rotation(), fawkes::Interface::timestamp(), fawkes::TransformInterface::frame(), and fawkes::TransformInterface::child_frame().
void fawkes::tf::TransformListener::bb_interface_reader_removed | ( | Interface * | interface, |
unsigned int | instance_serial | ||
) | throw () [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.
void fawkes::tf::TransformListener::bb_interface_writer_removed | ( | Interface * | interface, |
unsigned int | instance_serial | ||
) | throw () [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.