MIRA
|
Inherit from this class if you want to implement a simple 2D visualization. More...
#include <visualization/Visualization2DBasic.h>
Public Types | |
enum | Flags { NORMAL = 0x0000, ANONYMOUS = 0x0001, HIDDEN = 0x0002, INVISIBLE_PUBLISHER_SUBSCRIBER = 0x0004, INTERNAL = 0x000A, INDEPENDENT_SUBSCRIBER_THREAD = 0x0010, INDEPENDENT_RPC_THREAD = 0x0020, NO_MAIN_THREAD = 0x0040 } |
Flags for creating an authority. More... | |
typedef std::multimap< std::string, std::string > | ChannelNameMapping |
typedef std::map< std::string, Status > | ChannelStatusMap |
typedef std::map< std::string, Status > | StatusMap |
Public Member Functions | |
Visualization2DBasic (const std::string channelDisplayName="Channel") | |
Constructor taking a name of the visualized channel. More... | |
virtual | ~Visualization2DBasic () |
template<typename Reflector > | |
void | reflect (Reflector &r) |
virtual void | setupScene (IVisualization2DSite *site) |
Must be implemented in derived classes. More... | |
virtual QGraphicsItem * | setupScene (QGraphicsScene *mgr)=0 |
Implement this method to setup the scene. More... | |
virtual QGraphicsItem * | getItem () |
Must be implemented in derived classes to return a pointer to the QGraphicsItem used for drawing. More... | |
void | setEnabled (bool enabled) |
Changes the enabled-state and therefore the visibility of this visualization. More... | |
virtual DataConnection | getDataConnection () |
Returns information about the direct data connection for this visualization. More... | |
virtual void | init (IVisualizationSite *site) |
Is called by the visualization view when the visualization is attached. More... | |
virtual IVisualization2DSite * | getSite () |
Returns a pointer to the IVisualization2DSite interface that was set in the init() method. More... | |
virtual void | processUpdate (Duration dt) |
Is called regularly by the VisualizationView to update the visualization. More... | |
bool | isEnabled () const |
Returns true, if this visualization is enabled and visible. More... | |
const std::string & | getName () const |
Returns the associated name of this visualization. More... | |
void | setName (const std::string &name) |
Sets the name of this visualization. More... | |
void | setupDataConnectionChannel (const std::string &channelID) |
Sets up the data connection channel property (if any) with the specified channel id. More... | |
virtual Authority & | getAuthority () |
Return the authority as reference. More... | |
Class const & | getClass () const |
call the virtual internalGetClass(). More... | |
void | enableSubscriberCallbacks (bool enable) |
Enables/disables subscriptions. More... | |
StatusManager & | getStatusManager () |
StatusMap | getStatusMap () const |
Gets the current status map containing all errors, warnings and bootup messages. More... | |
void | setHeartbeatInterval (const Duration &interval) |
Set the watchdog interval. More... | |
Duration | getHeartbeatInterval () const |
Return the watchdog interval. More... | |
void | heartbeat () |
When called for the first time heartbeat usage will be enabled. More... | |
bool | hasHeartbeatTimeout () const |
Returns true if heartbeat usage is enabled (by first call to heartbeat()) and last heartbeat was more than heartbeat interval time ago. More... | |
void | bootup (const std::string &message, const std::string &trText="") |
Signal that the module is booting up. More... | |
void | bootupFinished () |
Signal that the module has finished booting up (There can still be errors but booting up is finished) More... | |
void | recoverFinished () |
Signal that the module has finished recovering (There can still be errors but recovering is finished) More... | |
void | recover (const std::string &message, const std::string &trText="") |
Signal that the module is recovering. More... | |
void | ok (const std::string &category="") |
Signal that a category contains no more errors. More... | |
bool | warning (const std::string &category, const std::string &message, const std::string &trText="") |
Signal a warning in a category. More... | |
bool | error (const std::string &category, const std::string &message, const std::string &trText="") |
Signal an error in a category. More... | |
bool | setStatus (Status::StatusMode mode, const std::string &category, const std::string &message, const std::string &trText="") |
Set the status of a given category. More... | |
Status::StatusMode | getStatus () const |
Get the status mode defined by the status of the watchdog (if used) and the bootup, error and warning methods. More... | |
Session Management and Runtime Control. | |
void | checkin (const ResourceName &fullname, AuthorityRuntimePtr runtime=AuthorityRuntimePtr()) |
Checks in and therefore makes the authority valid by providing a namespace and a name that are given as fully qualified resource name. More... | |
void | checkin (const ResourceName &ns, const std::string &name, AuthorityRuntimePtr runtime=AuthorityRuntimePtr()) |
Checks in and therefore makes the authority valid by providing a namespace and a name. More... | |
void | checkin (Authority &iParent, const ResourceName &ns, const std::string &name) |
Checks in the authority as sub-authority of parent. More... | |
void | checkin (Authority &iParent, const std::string &name) |
Checks in the authority as sub-authority of parent. More... | |
void | checkout () |
Checks out and therefore invalidates the authority. More... | |
bool | isValid () const |
Returns true, if this Authority was initialized and is checked in, otherwise false. More... | |
void | validate () const |
Check if authority is checked in and therefore valid. More... | |
void | startWithParent (bool start) |
Select whether the authority should be started when its parent authority starts (only meaningful if it has a parent). More... | |
AuthorityRuntimePtr | getRuntime () |
Returns a shared_ptr to the runtime that this authority uses. More... | |
std::set< Authority * > | getChildren () |
Returns a set with all children / sub-authorities. More... | |
void | addImmediateHandler (DiagnosticRunnablePtr runnable) |
Adds a runnable that is invoked immediately. More... | |
template<typename F > | |
void | addImmediateHandlerFunction (F &&fn) |
Adds a handler function that is invoked immediately. More... | |
void | addFinalizeHandler (DiagnosticRunnablePtr runnable) |
Adds a runnable that is executed ONCE just before the thread terminates. More... | |
template<typename F > | |
void | addFinalizeHandlerFunction (F &&fn) |
Adds a function that is executed ONCE just before the thread terminates. More... | |
TimerPtr | createTimer (Duration period, TimerCallback callback, bool oneshot=false) |
Creates and adds a timer that gets called cyclic in a given period (if oneshot is false) and calls the given callback on every invocation. More... | |
TimerPtr | createTimer (Duration period, Duration tolerance, TimerCallback callback, bool oneshot=false) |
Creates and adds a timer that gets called cyclic in a given period (if oneshot is false) and calls the given callback on every invocation. More... | |
template<typename Class > | |
TimerPtr | createTimer (Duration period, void(Class::*f)(const Timer &), Class *obj, bool oneshot=false) |
Provided for convenience. See above createTimer method for more details. More... | |
template<typename Class > | |
TimerPtr | createTimer (Duration period, void(Class::*f)(const Timer &), bool oneshot=false) |
Provided for convenience. See above createTimer method for more details. More... | |
template<typename Class > | |
TimerPtr | createTimer (Duration period, Duration tolerance, void(Class::*f)(const Timer &), Class *obj, bool oneshot=false) |
Provided for convenience. See above createTimer method for more details. More... | |
template<typename Class > | |
TimerPtr | createTimer (Duration period, Duration tolerance, void(Class::*f)(const Timer &), bool oneshot=false) |
Provided for convenience. See above createTimer method for more details. More... | |
TimerPtr | createTimer (Time time, TimerCallback callback) |
Creates a timer that calls callback exactly once at the given time. More... | |
template<typename Class > | |
TimerPtr | createTimer (Time time, void(Class::*f)(const Timer &), Class *obj) |
Provided for convenience. See above createTimer method for more details. More... | |
template<typename Class > | |
TimerPtr | createTimer (Time time, void(Class::*f)(const Timer &)) |
Provided for convenience. See above createTimer method for more details. More... | |
void | removeTimer (TimerPtr timer) |
Removes the given timer (timer callback will not be called again and timer will not be rescheduled). More... | |
void | start () override |
Starts/Resumes the main dispatcher thread, e.g. More... | |
void | stop () override |
Stops/Pauses the main dispatcher thread as well as channel subscriber and RPC threads, if exist, and disables channel callbacks subscribed by this authority. More... | |
bool | spin (const Duration &maxWait=Duration::infinity()) |
Executes a single step of the main dispatcher of this authority. More... | |
bool | hasWork (Time horizon=Time::now()) const |
Checks if the main dispatcher thread of this authority has work that must be executed till horizon. More... | |
bool | hasUnrecoverableFailure () const override |
Returns true, if there was a failure while processing the immediate handlers. More... | |
bool | isStarted () const override |
Returns true, if the authority was started (by calling start()). More... | |
bool | isRunning () const override |
Return if the authority's main dispatcher is running. More... | |
Channel Communication Access. | |
The following methods gain access to the channels for communication and allow to control the subscriptions of the Authority | |
std::string | resolveName (const std::string &name) const |
Resolve a given name by taking the namespace of the authority into account. More... | |
std::string | resolveServiceName (const std::string &name) const |
Resolves the given name of the service by taking the namespace of the authority into account. More... | |
template<typename T > | |
Channel< T > | publish (const std::string &channelID) |
Publishes a channel with the given id and marks the authority as a publisher of this channel. More... | |
template<typename T > | |
Channel< T > | publish (const std::string &channelID, const Typename &type) |
Same as publish(channelID). More... | |
void | unpublish (const std::string &channelID) |
Unpublish a channel with the given channel id. More... | |
template<typename T > | |
Channel< T > | subscribe (const std::string &channelID, const Duration &storageDuration=Duration::seconds(0)) |
Subscribes authority to a given channel. More... | |
template<typename T > | |
Channel< T > | subscribe (const std::string &channelID, boost::function< void(ChannelRead< T >)> fn, const Duration &storageDuration=Duration::seconds(0), bool independentThread=false) |
Subscribes authority to a given channel and adds callback function fn. More... | |
template<typename T > | |
Channel< T > | subscribe (const std::string &channelID, boost::function< void(ChannelRead< T >)> fn, bool independentThread) |
Provided for convenience. See above subscribe method for more details. More... | |
template<typename T , typename Class > | |
Channel< T > | subscribe (const std::string &channelID, void(Class::*f)(ChannelRead< T >), Class *obj, const Duration &storageDuration=Duration::seconds(0), bool independentThread=false) |
Provided for simplified registration of a member function as callback function. More... | |
template<typename T , typename Class > | |
Channel< T > | subscribe (const std::string &channelID, void(Class::*f)(ChannelRead< T >), Class *obj, bool independentThread) |
Provided for simplified registration of a member function as callback function. More... | |
template<typename T , typename Class > | |
Channel< T > | subscribe (const std::string &channelID, void(Class::*f)(ChannelRead< T >), const Duration &storageDuration=Duration::seconds(0), bool independentThread=false) |
Provided for simplified registration of a member function of a class as callback. More... | |
template<typename T , typename Class > | |
Channel< T > | subscribe (const std::string &channelID, void(Class::*f)(ChannelRead< T >), bool independentThread) |
Provided for simplified registration of a member function as callback. More... | |
template<typename T > | |
Channel< T > | publishAndSubscribe (const std::string &channelID, const Duration &storageDuration=Duration::seconds(0)) |
Publishes a channel with the given id and marks the authority as a publisher of this channel. More... | |
template<typename T > | |
Channel< T > | publishAndSubscribe (const std::string &channelID, boost::function< void(ChannelRead< T >)> fn, const Duration &storageDuration=Duration::seconds(0), bool independentThread=false) |
Publishes a channel with the given id and marks the authority as a publisher of this channel. More... | |
template<typename T > | |
Channel< T > | publishAndSubscribe (const std::string &channelID, boost::function< void(ChannelRead< T >)> fn, bool independentThread) |
Provided for convenience. See above publishAndSubscribe method for more details. More... | |
template<typename T , typename Class > | |
Channel< T > | publishAndSubscribe (const std::string &channelID, void(Class::*f)(ChannelRead< T >), Class *obj, const Duration &storageDuration=Duration::seconds(0), bool independentThread=false) |
Provided for simplified registration of a member function as callback function. More... | |
template<typename T , typename Class > | |
Channel< T > | publishAndSubscribe (const std::string &channelID, void(Class::*f)(ChannelRead< T >), Class *obj, bool independentThread) |
Provided for simplified registration of a member function as callback function. More... | |
template<typename T , typename Class > | |
Channel< T > | publishAndSubscribe (const std::string &channelID, void(Class::*f)(ChannelRead< T >), const Duration &storageDuration=Duration::seconds(0), bool independentThread=false) |
Provided for simplified registration of a member function of a class as callback. More... | |
template<typename T , typename Class > | |
Channel< T > | publishAndSubscribe (const std::string &channelID, void(Class::*f)(ChannelRead< T >), bool independentThread) |
Provided for simplified registration of a member function as callback. More... | |
template<typename T > | |
Channel< T > | subscribeInterval (const std::string &channelID, boost::function< void(ChannelReadInterval< T >)> fn, const Duration &storageDuration, bool independentThread=false, const Time &startAfter=Time::unixEpoch()) |
Subscribes authority to a given channel. More... | |
template<typename T , typename Class > | |
Channel< T > | subscribeInterval (const std::string &channelID, void(Class::*f)(ChannelReadInterval< T >), Class *obj, const Duration &storageDuration, bool independentThread=false, const Time &startAfter=Time::unixEpoch()) |
template<typename T , typename Class > | |
Channel< T > | subscribeInterval (const std::string &channelID, void(Class::*f)(ChannelReadInterval< T >), const Duration &storageDuration, bool independentThread=false, const Time &startAfter=Time::unixEpoch()) |
Provided for simplified registration of a member function as callback function. More... | |
template<typename T , typename Class > | |
Channel< T > | subscribeIntervalByElements (const std::string &channelID, void(Class::*f)(ChannelRead< T >), Class *obj, const Duration &storageDuration=Duration::seconds(0), bool independentThread=false, const Time &startAfter=Time::unixEpoch()) |
Provided for simplified registration of a member function taking a simple ChannelRead as parameter. More... | |
template<typename T > | |
Channel< T > | subscribeIntervalByElements (const std::string &channelID, boost::function< void(ChannelRead< T >)>, const Duration &storageDuration=Duration::seconds(0), bool independentThread=false, const Time &startAfter=Time::unixEpoch()) |
General case accepting boost function instead of member function for subscribing to an interval with only a ChannelRead function given. More... | |
template<typename T , typename Class > | |
Channel< T > | subscribeIntervalByElements (const std::string &channelID, void(Class::*f)(ChannelRead< T >), const Duration &storageDuration=Duration::seconds(0), bool independentThread=false, const Time &startAfter=Time::unixEpoch()) |
Simplified notation automatically taking authority object as this argument. More... | |
template<typename T > | |
ChannelRead< T > | waitForData (Channel< T > channel, Duration timeout=Duration::infinity()) const |
Waits until data in the specified channel becomes available. More... | |
void | unsubscribe (const std::string &channelID) |
Unsubscribe from a given channel. More... | |
template<typename T > | |
void | unsubscribe (const std::string &channelID) |
Templated method, kept only for backward compatibility - the type is not actually required anymore for unsubscribing. More... | |
template<typename T > | |
Channel< T > | getChannel (const std::string &channelID) |
Returns channel object that can be used to obtain read and write access on the channel. More... | |
bool | isSubscribedOn (const std::string &channelID) const |
Returns if this authority is subscribed to a channel with the given channel id. More... | |
MIRA_DEPRECATED ("Please use isSubscribedOn() instead", bool hasSubscribedOn(const std::string &channelID) const) | |
bool | hasPublished (const std::string &channelID) const |
Returns if this authority has published a channel with the given channel id. More... | |
bool | doesChannelExist (const std::string &channelID) const |
Returns if a channel with the given channel id exists. More... | |
bool | waitForChannel (const std::string &channelID, const Duration &timeout=Duration::infinity()) const |
Waits until a channel with the given channel id becomes available. More... | |
Access to Transform Framework. | |
The following methods allow to use the transformation framework. | |
bool | isTransformAvailable (const std::string &targetID, const std::string &sourceID) const |
Checks if a transform from source frame to target frame is available. More... | |
bool | isTransformAvailable (const std::string &targetID, const std::string &sourceID, const std::string &fixedID) const |
Checks if a transform from source frame to target frame via fixed frame is available. More... | |
bool | waitForTransform (const std::string &targetID, const std::string &sourceID, Duration timeout=Duration::invalid()) const |
Waits until a transform from source frame to target frame is available. More... | |
bool | waitForTransform (const std::string &targetID, const std::string &sourceID, const std::string &fixedID, Duration timeout=Duration::invalid()) const |
Waits until a transform from source frame to target frame via fixed frame is available. More... | |
template<typename Transform , typename Filter > | |
void | subscribeTransform (const std::string &targetID, const std::string &sourceID, boost::function< void(Transform, Time)> fn, Filter &&filter) |
Subscribes to a transformation between the given target and source frame. More... | |
template<typename Transform , typename Filter , typename Class > | |
void | subscribeTransform (const std::string &targetID, const std::string &sourceID, void(Class::*f)(Transform, Time), Class *obj, Filter &&filter) |
Provided for simplified registration of a member function as callback function. More... | |
template<typename Transform , typename Filter , typename Class > | |
void | subscribeTransform (const std::string &targetID, const std::string &sourceID, void(Class::*f)(Transform, Time), Filter &&filter) |
Provided for simplified registration of a member function as callback function. More... | |
template<typename Transform > | |
void | subscribeTransform (const std::string &targetID, const std::string &sourceID, boost::function< void(Transform, Time)> fn) |
Subscribes to a transformation between the given target and source frame. More... | |
template<typename Transform , typename Class > | |
void | subscribeTransform (const std::string &targetID, const std::string &sourceID, void(Class::*f)(Transform, Time), Class *obj) |
Provided for simplified registration of a member function as callback function. More... | |
template<typename Transform , typename Class > | |
void | subscribeTransform (const std::string &targetID, const std::string &sourceID, void(Class::*f)(Transform, Time)) |
Provided for simplified registration of a member function as callback function. More... | |
template<typename Transform , typename Filter > | |
Transform | getTransform (const std::string &targetID, const std::string &sourceID, const Time &time, Filter &&filter) const |
Get a transformation from source to target frame at a given time stamp. More... | |
template<typename Transform > | |
Transform | getTransform (const std::string &targetID, const std::string &sourceID, const Time &time=Time()) const |
template<typename Transform , typename Filter > | |
Transform | getTransform (const std::string &targetID, const Time &targetTime, const std::string &sourceID, const Time &sourceTime, const std::string &fixedID, Filter &&filter) const |
Get a transformation from source to target via fixed frame at the given time stamps. More... | |
template<typename Transform > | |
Transform | getTransform (const std::string &targetID, const Time &targetTime, const std::string &sourceID, const Time &sourceTime, const std::string &fixedID) const |
template<typename Transform , typename Filter > | |
Transform | getTransform (const TransformDesc &desc, const Time &time, Filter &&filter) const |
Get a transformation at a given time using the prepared transform chain and a given filter. More... | |
template<typename Transform > | |
Transform | getTransform (const TransformDesc &desc, const Time &time=Time()) const |
template<typename Transform , typename Filter > | |
Transform | getTransform (const TransformDesc &desc, const Time &targetTime, const Time &sourceTime, Filter &&filter) const |
Get a transformation at the given times using the prepared transform chain and a given filter. More... | |
template<typename Transform > | |
Transform | getTransform (const TransformDesc &desc, const Time &targetTime, const Time &sourceTime) const |
FrameworkTransformerNode * | getTransformNode (const std::string &frameID) const |
Get a transformation node for the given frame. More... | |
TransformDesc | prepareTransform (const std::string &targetID, const std::string &sourceID) const |
Prepares a transformation chain from a source node to a target node. More... | |
TransformDesc | prepareTransform (const std::string &targetID, const std::string &sourceID, const std::string &fixedID) const |
Prepares a transformation chain from a source node to a target node via fixed node. More... | |
template<typename Transform > | |
void | publishTransform (const std::string &frameID, const Transform &transform, const Time &time) const |
Publish a transformation for a given frame. More... | |
template<typename Transform , typename Filter = NearestNeighborInterpolator> | |
void | publishTransformIndirect (const std::string &frameID, const std::string &targetID, const std::string &sourceID, const Transform &transform, const Time &time, Filter &&filter=NearestNeighborInterpolator()) const |
Publish a transformation (frameID) indirect by specifying a direct transform between two nodes (sourceID and targetID). More... | |
void | addTransformLink (const std::string &childID, const std::string &parentID) const |
Add a transformation link between the given child and parent. More... | |
void | addTransformLink (const std::string &childID, const std::string &parentID, FrameworkTransformerNode::Type type) const |
Add a transformation link between the given child and parent, specifying the type of the transformation. More... | |
Remote Procedure Calls. | |
The following methods allow to register and use remote procedure calls. | |
template<typename Service > | |
void | publishService (const std::string &name, Service &iService, RPCHandlerPtr handler=RPCHandlerPtr()) |
Publish a service to register RPC functions at the RPC manager. More... | |
template<typename Service > | |
void | publishService (Service &iService, RPCHandlerPtr handler=RPCHandlerPtr()) |
Publish a service to register RPC functions at the RPC manager. More... | |
void | unpublishService () |
Unpublish this service by unregistering the service with the id of the authority from the RPC manager. More... | |
void | unpublishService (const std::string &name) |
Unpublish a service with a given name by unregistering the service with the name from the RPC manager. More... | |
template<typename R , typename... ARGS> | |
RPCFuture< R > | callService (const std::string &iService, const std::string &method, ARGS &&... args) const |
Performs an RPC call. More... | |
RPCFuture< JSONRPCResponse > | callServiceJSON (const json::Value &jsonRequest) const |
Invokes a JSON RPC call. More... | |
RPCFuture< JSONRPCResponse > | callServiceJSON (const std::string &jsonString) const |
Provided for convenience. More... | |
RPCFuture< JSONRPCResponse > | callServiceJSON (const std::string &service, const std::string &method, const json::Value ¶ms=json::Value()) const |
Invokes a JSON RPC call, on the specified service and method with the given params by generating a JSON RPC 2.0 conform json request. More... | |
RPCFuture< JSONRPCResponse > | callServiceJSON (const std::string &service, const std::string &method, const std::string ¶ms) const |
Provided for convenience. More... | |
RPCFuture< JSONRPCResponse > | callServiceJSON (const RPCCallDefinition &rpc) const |
Provided for convenience. More... | |
template<class F > | |
ServiceCall< F > | createServiceCall (const std::string &service, std::string method, bool waitTillExists=true, bool showBootupMsg=true) |
Create a ServiceCall object. More... | |
bool | existsService (const std::string &name) const |
Returns true, if a service with the given name exists, otherwise false. More... | |
bool | implementsInterface (const std::string &name, const std::string &interface) const |
Returns true, if a service with the given name implements the given interface, otherwise false. More... | |
bool | waitForService (const std::string &name, Duration timeout=Duration::invalid()) const |
Waits until a service with the specified name becomes available. More... | |
std::string | waitForServiceInterface (const std::string &interface, Duration timeout=Duration::invalid()) const |
Waits until a service with the specified interface becomes available. More... | |
std::list< std::string > | queryServicesForInterface (const std::string &interface) const |
Returns a string list with the names of all registered services, that implement the specified interface. More... | |
void | registerCallbackForInterface (const std::string &interface, ServiceInterfaceHandler::Callback cb) |
Registers a callback that is called whenever a service registers the given interface, which is specified as first parameter. More... | |
template<typename Class > | |
void | registerCallbackForInterface (const std::string &interface, void(Class::*f)(const std::string &, const std::string &), Class *obj) |
Same as above but providing a function and class pointer instead of a boost function. More... | |
Implementation of AbstractAuthority | |
StatusManager::StatusMap | getStatusMap () override |
Return a status map that contains the status of the authority as well as all registered submodules. More... | |
boost::shared_ptr< PropertyNode > | getProperties () override |
Returns the main property node of this Authority. More... | |
std::set< std::string > | getPublishedChannels () override |
Returns all published channels by this authority (and its sub-authorities) More... | |
std::set< std::string > | getSubscribedChannels () override |
Returns all subscribed channels by this authority (and its sub-authorities) More... | |
std::set< std::string > | getServiceInterfaces () override |
Returns all service interfaces provided by this authority. More... | |
ChannelNameMapping | getPublishedChannelNames () override |
Returns all published channels (pair of global and local names) by this authority (and its sub-authorities) More... | |
ChannelNameMapping | getSubscribedChannelNames () override |
Returns all subscribed channels (pair of global and local names) by this authority (and its sub-authorities) More... | |
ChannelStatusMap | getSubscribedChannelStatus () override |
Returns status for all subscribed channels (ok, no publisher, no data, ...) by this authority (and its sub-authorities) More... | |
Detailed Information Retrieval | |
These methods allow to obtain detailed information on the Authority. | |
std::string | getNamespace () const |
Return the resolved namespace of the authority. More... | |
std::string | getGlobalName () const |
Return the fully qualified global name (includes namespace) This method returns the name without the trailing UUID added if the authority is anonymous. More... | |
std::string | getGlobalID () const |
Return the fully qualified global id (includes namespace) More... | |
std::string | getID () const |
Return the id of the authority. More... | |
const AuthorityDescription & | getDescription () const |
Return the description of this authority. More... | |
Static Public Member Functions | |
static PseudoClass const & | CLASS () |
Protected Types | |
enum | OptionalMode { NOT_REQUIRED, REQUIRED } |
typedef std::map< std::string, RWAccessFlags > | RWAccessMap |
typedef std::list< AbstractChannelSubscriberPtr > | SubscribePtrList |
Protected Member Functions | |
virtual void | update (Duration dt) |
This method can be implemented in the derived Visualization classes. More... | |
void | dataChangedCallback (ChannelRead< T > data) |
void | channelChangedCallback () |
virtual void | channelChanged () |
Overwrite this method to get notified when the connected channel changes. More... | |
virtual void | dataChanged (ChannelRead< T > data) |
Overwrite this method to listen on channel callbacks. More... | |
virtual void | onDataChanged (ChannelRead< T > data) |
virtual void | onUpdate (Duration dt) |
Provided for backward compatibility. More... | |
template<typename T , typename Reflector > | |
void | channelProperty (Reflector &r, const std::string &name, ChannelProperty< T > &channel, const std::string &comment, OptionalMode optional=REQUIRED) |
Special property-method that should be called within the reflect method to specify a ChannelProperty. More... | |
virtual Class const & | internalGetClass () const =0 |
template<typename T > | |
Channel< T > | toProxy (ConcreteChannel< T > *channel) |
void | setChannelReadAccess (const std::string &channelID) |
void | setChannelWriteAccess (const std::string &channelID) |
void | removeChannelReadAccess (const std::string &channelID) |
void | removeChannelWriteAccess (const std::string &channelID) |
void | insertChannelNameMapping (AbstractAuthority::ChannelNameMapping &map, const std::string &local, const std::string &global) |
void | eraseChannelNameMapping (AbstractAuthority::ChannelNameMapping &map, const std::string &local, const std::string &global) |
void | remotePublishService (const std::string &service) const |
PropertyTree | getPropertiesRPC () |
void | setProperty (const std::string &property, const std::string &value) |
std::string | getProperty (const std::string &property) const |
void | setPropertyJSON (const std::string &property, const json::Value &value) |
json::Value | getPropertyJSON (const std::string &property) const |
Protected Attributes | |
ChannelProperty< T > | mDataChannel |
std::string | mChannelDisplayName |
std::string | mDataFrameID |
Time | mDataTimestamp |
QGraphicsItem * | mItem |
AuthorityDescription | mDescription |
boost::optional< Status > | mBootUpStatus |
boost::optional< Status > | mRecoverStatus |
Duration | mHeartbeatInterval |
boost::optional< Time > | mLastHeartbeat |
StatusMap | mStatusMap |
std::string | mName |
Inherit from this class if you want to implement a simple 2D visualization.
The template parameter specifies what type of data your class visualizes. The class already creates a scene node for you and updates the transformation of the node according to the frame id of the data. All you need to implement is the setupScene method. For more complex visualizations please use the Visualization2D directly.
|
protectedinherited |
|
protectedinherited |
|
inherited |
|
inherited |
|
protectedinherited |
|
inherited |
Flags for creating an authority.
Enumerator | |
---|---|
NORMAL | Normally authorities must have a unique name. |
ANONYMOUS | However sometimes more than one instance is created of an authority where the name does not matter and could be generated automatically. This flag provides automatically id generation based on uuids. |
HIDDEN | For Authorities that are not shown by default to the user. Will get the MIRA_HIDDEN_AUTHORITY_PREFIX as name prefix. |
INVISIBLE_PUBLISHER_SUBSCRIBER | Authorities with this flag set are invisible subscribers and publishers for channels e.g. they will not count as official publishers for channels which is used for remote framework connections. When a remote framework connects it will receive a list of all local published channels excluding the ones from invisible publishers. |
INTERNAL | Authorities with this flag set are automatically HIDDEN and are invisible to remote frameworks (internal to the local framework). |
INDEPENDENT_SUBSCRIBER_THREAD | Instructs the authority to use a separate and independent thread for handling subscriber callbacks. By default the authority uses the same thread for handling
|
INDEPENDENT_RPC_THREAD | Instructs the authority to use a separate and independent thread for handling RPC requests. By default the authority uses the same thread for handling
|
NO_MAIN_THREAD | Does not start a thread for processing the main dispatcher, instead the user needs to call the spin() method periodically. |
|
inline |
Constructor taking a name of the visualized channel.
|
inlinevirtual |
|
inline |
|
inlinevirtual |
Must be implemented in derived classes.
Is called within the visualization's init() method. You can use this method to create your scene and scene objects. The passed IVisualization2DSite interface is the same that is returned by getSite().
Implements Visualization2D.
|
pure virtual |
Implement this method to setup the scene.
The graphics item you create must be returned.
|
inlinevirtual |
Must be implemented in derived classes to return a pointer to the QGraphicsItem used for drawing.
Implements Visualization2D.
|
inlinevirtual |
Changes the enabled-state and therefore the visibility of this visualization.
Derived classes should overwrite this method to hide and show the visualization as desired. When overwriting this method you should always call the method of the base class.
Reimplemented from Visualization.
|
inlinevirtual |
Returns information about the direct data connection for this visualization.
This information is used to support drag'n drop of channels into a visualization window to find the correct visualization for that data. Moreover, it is used in the tape player preview, etc. If your visualization should support these features you must implement this method by returning a valid DataConnection structure. By default an empty DataConnection structure is returned.
Reimplemented from Visualization.
|
inlineprotectedvirtual |
This method can be implemented in the derived Visualization classes.
See processUpdate()
Reimplemented from Visualization.
|
inlineprotected |
|
inlineprotected |
|
inlineprotectedvirtual |
Overwrite this method to get notified when the connected channel changes.
|
inlineprotectedvirtual |
Overwrite this method to listen on channel callbacks.
|
inlineprotectedvirtual |
Only for backward compatibility
|
virtualinherited |
Is called by the visualization view when the visualization is attached.
The default implementation stores the pointer to the IVisualization2DSite interface that can be retrieved using the getSite() method for later use. Moreover, it calls the setupScene() method. You should never need to overwrite this method in derived classes. Use the setupScene() method instead. However, if you overwrite this method you SHOULD call this default implementation.
The passed interface must be of the type IVisualization2DSite.
Implements Visualization.
|
virtualinherited |
Returns a pointer to the IVisualization2DSite interface that was set in the init() method.
Or returns NULL, if init() was not yet called.
Implements Visualization.
|
virtualinherited |
Is called regularly by the VisualizationView to update the visualization.
The time span since the last call of update is passed as parameter. It calls update() that can be overwritten in derived classes
|
inlineinherited |
Returns true, if this visualization is enabled and visible.
|
inlineinherited |
Returns the associated name of this visualization.
|
inlineinherited |
Sets the name of this visualization.
|
inlineprotectedvirtualinherited |
Provided for backward compatibility.
|
inlineinherited |
Sets up the data connection channel property (if any) with the specified channel id.
The property is added automatically to the channel property update set. Which is used for regular update of the properties. This method is for internal use, and called by VisualizationView upon a drag'n'drop action.
|
inlineprotectedinherited |
Special property-method that should be called within the reflect method to specify a ChannelProperty.
E.g.:
|
virtualinherited |
Return the authority as reference.
Implements IAuthorityProvider.
|
inlineinherited |
call the virtual internalGetClass().
|
inlinestaticinherited |
|
protectedpure virtualinherited |
|
inherited |
Checks in and therefore makes the authority valid by providing a namespace and a name that are given as fully qualified resource name.
[in] | fullname | The fully qualified name of the authority, including the namespace. |
[in] | runtime | The runtime the authority should use. If not specified the authority will create its own runtime. |
XInvalidParameter | If another authority with the same name exists or if the specified namespace/name is invalid. |
|
inherited |
Checks in and therefore makes the authority valid by providing a namespace and a name.
This is essentially the same as the above method, but allows to specify namespace and name separately.
[in] | ns | The namespace the authority will reside in |
[in] | name | The name of the authority |
[in] | runtime | The runtime the authority should use. If not specified the authority will create its own runtime. |
XInvalidParameter | If another authority with the same name exists or if the specified namespace/name is invalid. |
|
inherited |
Checks in the authority as sub-authority of parent.
Hence, this authority will share some of the parents settings and runtime threads (see startWithParent()).
[in] | iParent | The parent authority |
[in] | ns | The namespace the authority will reside in |
[in] | name | The name of the authority |
XInvalidParameter | If another authority with the same name exists or if the specified namespace/name is invalid. |
|
inherited |
Checks in the authority as sub-authority of parent.
Hence, this authority will share some of the parents settings (namespace, etc) and runtime threads (see startWithParent()).
[in] | iParent | The parent authority |
[in] | name | The name of the authority |
XInvalidParameter | If another authority with the same name exists or if the specified namespace/name is invalid. |
|
inherited |
Checks out and therefore invalidates the authority.
|
inlineinherited |
Returns true, if this Authority was initialized and is checked in, otherwise false.
|
inlineinherited |
Check if authority is checked in and therefore valid.
XInvalidConfig | if not checked in |
|
inlineinherited |
Select whether the authority should be started when its parent authority starts (only meaningful if it has a parent).
By default, the parent authority's start() will call start() on all its child authorities. This flag enables to selectively and dynamically enable/disable child authorities, even while the parent authority is stopped and restarted.
Note that Authority::stop() will always stop all its child authorities.
|
inlineinherited |
Returns a shared_ptr to the runtime that this authority uses.
The returned pointer never is nullptr if this Authority was checked in successfully. The returned runtime may be shared between different Authorities.
|
inlineinherited |
Returns a set with all children / sub-authorities.
|
inherited |
Adds a runnable that is invoked immediately.
After the handler is processed it will be removed from the list of registered handlers.
|
inherited |
Adds a handler function that is invoked immediately.
After the handler is processed it will be removed from the list of registered handlers. Creates a Runnable internally.
|
inherited |
Adds a runnable that is executed ONCE just before the thread terminates.
After the handler is processed it will be removed from the list of registered handlers.
|
inherited |
Adds a function that is executed ONCE just before the thread terminates.
Creates a Runnable internally. After the handler is processed it will be removed from the list of registered handlers.
|
inherited |
Creates and adds a timer that gets called cyclic in a given period (if oneshot is false) and calls the given callback on every invocation.
[in] | period | Period the timer is called in |
[in] | callback | Function that gets called every time the timer fires. |
[in] | oneshot | If true callback is only called once. |
|
inherited |
Creates and adds a timer that gets called cyclic in a given period (if oneshot is false) and calls the given callback on every invocation.
Additionally a warning is given when the call to the timer exceeds the scheduled invocation time about the specified tolerance.
[in] | period | Period the timer is called in |
[in] | tolerance | The tolerance for exceeding the period. |
[in] | callback | Function that gets called every time the timer fires. |
[in] | oneshot | If true callback is only called once. |
|
inherited |
Provided for convenience. See above createTimer method for more details.
|
inherited |
Provided for convenience. See above createTimer method for more details.
|
inherited |
Provided for convenience. See above createTimer method for more details.
|
inherited |
Provided for convenience. See above createTimer method for more details.
|
inherited |
Creates a timer that calls callback exactly once at the given time.
[in] | time | Time when the callback should be called. |
[in] | callback | Function that gets called at the given time. |
Provided for convenience. See above createTimer method for more details.
Provided for convenience. See above createTimer method for more details.
|
inherited |
Removes the given timer (timer callback will not be called again and timer will not be rescheduled).
Calling start on a removed timer will not start it again.
|
overridevirtualinherited |
Starts/Resumes the main dispatcher thread, e.g.
if it is not yet started since the authority was created and checked in manually. Starts also existing dispatcher threads for channel subscribers and rpc service calls, and enables subscribed callbacks.
Recursively calls start() on all child authorities unless they have been individually disabled using startWithParent().
Implements AbstractAuthority.
|
overridevirtualinherited |
Stops/Pauses the main dispatcher thread as well as channel subscriber and RPC threads, if exist, and disables channel callbacks subscribed by this authority.
Recursively calls stop() on all child authorities. To make the authority continue processing, call start().
Implements AbstractAuthority.
|
inherited |
Executes a single step of the main dispatcher of this authority.
If this authority does not own the AuthorityRuntime with the main dispatcher, this method does nothing. The method returns true, if the caller should continue to call spin() periodically. If false is returned, spin() should not be called any longer.
Usually the spin() method waits for events and signals of the dispatcher, you can specify the max. time that is spent in the call using the maxWait parameter. If this parameter is set to 0, spin() will not block at all. If it is set to Duration::infinity (the default), it will wait until the next signal or event or stop request.
Checks if the main dispatcher thread of this authority has work that must be executed till horizon.
If this authority does not own the AuthorityRuntime this method returns false.
|
overridevirtualinherited |
Returns true, if there was a failure while processing the immediate handlers.
This is an unrecoverable failure that will disallow the further execution of the authority.
Implements AbstractAuthority.
|
overridevirtualinherited |
Returns true, if the authority was started (by calling start()).
It will return false, if the authority was not yet started or is stopped.
Implements AbstractAuthority.
|
overridevirtualinherited |
Return if the authority's main dispatcher is running.
Implements AbstractAuthority.
|
inherited |
Enables/disables subscriptions.
If enabled, subscribed callbacks will be called upon changes in the channels. If false, callbacks will not be called.
|
inherited |
Resolve a given name by taking the namespace of the authority into account.
[in] | name | to be resolved |
|
inherited |
Resolves the given name of the service by taking the namespace of the authority into account.
This method does essentially the same as resolveName() but takes a possible "#buildin" suffix into account.
[in] | name | to be resolved |
|
inlineinherited |
Publishes a channel with the given id and marks the authority as a publisher of this channel.
If the channel does not exist it will be created.
XInvalidConfig | if authority is not valid |
XBadCast | if the channel exists but the types do not match. |
[in] | channelID | The channel id |
Same as publish(channelID).
Use this for untyped channels Channel<void> to specify a typename.
|
inherited |
Unpublish a channel with the given channel id.
XInvalidConfig | if authority is not valid |
[in] | channelID | The channel id |
|
inherited |
Subscribes authority to a given channel.
It returns a channel object that the caller can store to poll/read data from the channel. The channel is created if it does not exists.
XInvalidConfig | if authority is not valid |
XBadCast | if the channel exists but the types do not match. |
[in] | channelID | The id of the data channel to subscribe to |
[in] | storageDuration | The requested duration of how long data is stored in the channel (history). Note that the real history length may differ from this request because the number of slots in the channel is limited by its maximum length. Assuming we have only one writer to the channel that updates the channel each T milliseconds the real storage duration D can be computed by D = (maxSlots-1) * T. |
|
inherited |
Subscribes authority to a given channel and adds callback function fn.
At least one thread is created per authority for the callbacks. If independentThread is false the main thread for this authority is used for the channel callback. If independentThread is true an independent thread for this channel is created for the authority.
XInvalidConfig | if authority is not valid |
XBadCast | if the channel exists but the types do not match. |
[in] | channelID | The id of the data channel to subscribe to |
[in] | fn | The callback function that is called whenever the data on the channel changes. |
[in] | storageDuration | The requested duration of how long data is stored in the channel (history). Note that the real history length may differ from this request because the number of slots in the channel is limited by its maximum length. Assuming we have only one writer to the channel that updates the channel each T milliseconds the maximum storage duration maxD can be computed by maxD = (maxSlots-1) * T. |
[in] | independentThread | If true, an independent thread is created for this channel callback |
|
inherited |
Provided for convenience. See above subscribe method for more details.
|
inherited |
Provided for simplified registration of a member function as callback function.
See the above subscribe methods for more details.
|
inherited |
Provided for simplified registration of a member function as callback function.
See the above subscribe methods for more details.
|
inlineinherited |
Provided for simplified registration of a member function of a class as callback.
Example:
|
inlineinherited |
Provided for simplified registration of a member function as callback.
|
inherited |
Publishes a channel with the given id and marks the authority as a publisher of this channel.
Also subscribes authority to the channel. It returns a channel object that the caller can store to poll/read and write data from/to the channel. The channel is created if it does not exists.
XInvalidConfig | if authority is not valid |
XBadCast | if the channel exists but the types do not match. |
[in] | channelID | The id of the data channel to subscribe to |
[in] | storageDuration | The requested duration of how long data is stored in the channel (history). Note that the real history length may differ from this request because the number of slots in the channel is limited by its maximum length. Assuming we have only one writer to the channel that updates the channel each T milliseconds the real storage duration D can be computed by D = (maxSlots-1) * T. |
|
inherited |
Publishes a channel with the given id and marks the authority as a publisher of this channel.
Also subscribes authority to the channel and adds callback function fn. At least one thread is created per authority for the callbacks. If independentThread is false the main thread for this authority is used for the channel callback. If independentThread is true an independent thread for this channel is created for the authority.
XInvalidConfig | if authority is not valid |
XBadCast | if the channel exists but the types do not match. |
[in] | channelID | The id of the data channel to subscribe to |
[in] | fn | The callback function that is called whenever the data on the channel changes. |
[in] | storageDuration | The requested duration of how long data is stored in the channel (history). Note that the real history length may differ from this request because the number of slots in the channel is limited by its maximum length. Assuming we have only one writer to the channel that updates the channel each T milliseconds the maximum storage duration maxD can be computed by maxD = (maxSlots-1) * T. |
[in] | independentThread | If true, an independent thread is created for this channel callback |
|
inherited |
Provided for convenience. See above publishAndSubscribe method for more details.
|
inherited |
Provided for simplified registration of a member function as callback function.
See the above publishAndSubscribe methods for more details.
|
inherited |
Provided for simplified registration of a member function as callback function.
See the above publishAndSubscribe methods for more details.
|
inlineinherited |
Provided for simplified registration of a member function of a class as callback.
Example:
|
inlineinherited |
Provided for simplified registration of a member function as callback.
|
inherited |
Subscribes authority to a given channel.
In contrast to the above subscribe methods this method subscribes a callback that takes a ChannelReadInterval as parameter. Instead of a single value, a whole interval of data is passed. The interval contains all values that were stored within the channel since the last callback. Hence, by using this subscribe mechanism you can make sure, that no data is missed.
XInvalidConfig | if authority is not valid |
XBadCast | if the channel exists but the types do not match. |
[in] | channelID | The id of the data channel to subscribe to |
[in] | fn | The callback function that is called whenever the data in the interval on the channel changes. |
[in] | storageDuration | The requested duration of how long data is stored in the channel (history). This parameter is especially important for subscribing to intervals, as it must be larger than the delay that may occur within the callback to make sure that no data is lost. Note that the real history length may differ from this request because the number of slots in the channel is limited by its maximum length. Assuming we have only one writer to the channel that updates the channel each T milliseconds the real storage duration D can be computed by D = (maxSlots-1) * T. |
[in] | independentThread | If true, an independent thread is created for this channel callback |
[in] | startAfter | Ignore any channel slots at or before this timestamp. If this is before the subscription time, the first callback (triggered by the first subsequent channel update) will collect all past channel slots back to this timestamp. |
|
inherited |
|
inherited |
Provided for simplified registration of a member function as callback function.
See the above subscribe methods for more details.
|
inherited |
Provided for simplified registration of a member function taking a simple ChannelRead as parameter.
This is useful especially when trying to get every single value (e.g. message passing), even if processing of a single value takes some longer.
|
inherited |
General case accepting boost function instead of member function for subscribing to an interval with only a ChannelRead function given.
|
inherited |
Simplified notation automatically taking authority object as this argument.
Same as respective subscribeInterval function taking ChannelReadInterval as parameter.
|
inherited |
Waits until data in the specified channel becomes available.
If a timeout it specified, the method times out if no data becomes available after the given time.
[in] | channel | The channel we are waiting for |
[in] | timeout | Wait for this duration or forever if Duration::infinity() (default) |
|
inherited |
Unsubscribe from a given channel.
If subscribed with a callback function this function is no longer called. If independentThread was true when subscribing the independent thread for this channel is stopped.
XInvalidConfig | if authority is not valid |
[in] | channelID | The id of the data channel to subscribe to |
|
inherited |
Templated method, kept only for backward compatibility - the type is not actually required anymore for unsubscribing.
See unsubscribe.
|
inherited |
Returns channel object that can be used to obtain read and write access on the channel.
XInvalidConfig | if authority is not valid |
XBadCast | if the channel types do not match. |
XAccessViolation | if the channel does not exist |
|
inherited |
Returns if this authority is subscribed to a channel with the given channel id.
|
inlineinherited |
const |
|
inherited |
Returns if this authority has published a channel with the given channel id.
|
inherited |
Returns if a channel with the given channel id exists.
|
inherited |
Waits until a channel with the given channel id becomes available.
|
inherited |
Checks if a transform from source frame to target frame is available.
This means a path in the transform tree exists from source to target and all nodes on that path contain data.
XInvalidRead | if either the target or source node does not exist |
targetID | The frame id of the target node |
sourceID | The frame id of the source node |
|
inherited |
Checks if a transform from source frame to target frame via fixed frame is available.
This means a path in the transform tree exists from source to target via fixed and all nodes on that path contain data.
XInvalidRead | if either the target, source or fixed node does not exist |
targetID | The frame id of the target node |
sourceID | The frame id of the source node |
fixedID | The frame id of the fixed node |
|
inherited |
Waits until a transform from source frame to target frame is available.
This means a path in the transform tree exists from source to target and all nodes on that path contain data.
XInvalidRead | if either the target or source node does not exist |
targetID | The frame id of the target node |
sourceID | The frame id of the source node |
timeout | Wait for this duration or forever if Duration::infinity() (default) |
|
inherited |
Waits until a transform from source frame to target frame via fixed frame is available.
This means a path in the transform tree exists from source to target via fixed and all nodes on that path contain data.
XInvalidRead | if either the target, source or fixed node does not exist |
targetID | The frame id of the target node |
sourceID | The frame id of the source node |
fixedID | The frame id of the fixed node |
timeout | Wait for this duration or forever if Duration::infinity() (default) |
|
inherited |
Subscribes to a transformation between the given target and source frame.
Usually, the computation of the transformation between the target and source frame depends on multiple frames along the path between the 'target' and 'source' within the transformation tree. The installed callback function will be called whenever one of these frames and hence the transformation between the target and source frame changes. The latest transformation and the corresponding timestamp will be passed as parameter to the callback function. The transformation between target and source frame must exist, otherwise an XTransform exception is thrown. You can use waitForTransform to ensure that the transformation exists.
TransformerBase::XTransform | If the transformation between source and target does not exist. |
targetID | The frame id of the target node |
sourceID | The frame id of the source node |
fn | The callback that is called when the transformation changes, the new transformation and the corresponding timestamp are passed as parameter. |
filter | The filter used to interpolate between the transformations. |
|
inherited |
Provided for simplified registration of a member function as callback function.
See the above subscribe methods for more details.
|
inherited |
Provided for simplified registration of a member function as callback function.
See the above subscribe methods for more details.
|
inherited |
Subscribes to a transformation between the given target and source frame.
Usually, the computation of the transformation between the target and source frame depends on multiple frames along the path between the 'target' and 'source' within the transformation tree. The installed callback function will be called whenever one of these frames and hence the transformation between the target and source frame changes. The latest transformation and the corresponding timestamp will be passed as parameter to the callback function. The transformation between target and source frame must exist, otherwise an XTransform exception is thrown. You can use waitForTransform to ensure that the transformation exists.
TransformerBase::XTransform | If the transformation between source and target does not exist. |
targetID | The frame id of the target node |
sourceID | The frame id of the source node |
fn | The callback that is called when the transformation changes, the new transformation and the corresponding timestamp are passed as parameter. |
|
inherited |
Provided for simplified registration of a member function as callback function.
See the above subscribe methods for more details.
|
inherited |
Provided for simplified registration of a member function as callback function.
See the above subscribe methods for more details.
|
inherited |
Get a transformation from source to target frame at a given time stamp.
The specified filter is used. If time is "not_a_date_time" e.g. a default constructed Time(), the latest available transform is returned.
XInvalidRead | if either the target or source node does not exist |
targetID | The frame id of the target node |
sourceID | The frame id of the source node |
time | The time of the requested transform |
filter | The filter used to interpolate between the transforms |
|
inlineinherited |
|
inherited |
Get a transformation from source to target via fixed frame at the given time stamps.
The specified filter is used. This method can be used to do time traveling. For example if one wants to know what was the position of the right arm two seconds ago relative to the position the left arm has now:
The "RobotFrame" is chosen as "fixed frame" since it is fixed over time relative to the arm positions and hence can be used as reference frame.
One can read the parameters of this function like: Give the transform from frame targetID at targetTime to frame sourceID at time sourceTime specifying the frame fixedID that does not change over time
XInvalidRead | if either the target, source or fixed node does not exist |
targetID | The frame id of the target node |
targetTime | The time of the target transform |
sourceID | The frame id of the source node |
sourceTime | The time of the source transform |
fixedID | The frame id of the fixed node |
filter | The filter used to interpolate between the transforms |
|
inlineinherited |
|
inherited |
Get a transformation at a given time using the prepared transform chain and a given filter.
If time is "not_a_date_time" e.g. a default constructed Time(), the latest available transform is returned.
desc | The prepared transform chain |
time | The time of the requested transform |
filter | The filter used to interpolate between the transforms |
|
inlineinherited |
|
inherited |
Get a transformation at the given times using the prepared transform chain and a given filter.
This method can be used to do time traveling. Together with prepareTransform(const std::string&, const std::string&, const std::string&) the same functionality can be achieved as by calling getTransform(const std::string&, const Time&, const std::string&, const Time&, const std::string&, Filter&&)
desc | The prepared transform chain |
targetTime | The time of requested target transform |
sourceTime | The time of requested source transform |
filter | The filter used to interpolate between the transforms |
|
inlineinherited |
|
inherited |
Get a transformation node for the given frame.
XInvalidRead | if node does not exist |
frameID | The frame id of the requested node. |
|
inherited |
Prepares a transformation chain from a source node to a target node.
The chain can later be used to obtain a transform using getTransform(const TransformDesc&, const Time& time, Filter&&); Preparing the transform chain only once can save performance when calculating the transform very often.
XInvalidRead | if either the target or source node does not exist |
targetID | The frame id of the target node |
sourceID | The frame id of the source node |
|
inherited |
Prepares a transformation chain from a source node to a target node via fixed node.
The chain can later be used to obtain a transform using getTransform(const TransformDesc&, const Time&, const Time&, Filter&&); Together with the above mentioned method the same functionality as calling getTransform(const std::string&, const Time&, const std::string&, const Time&, const std::string&, Filter&&) can be achieved, but preparing the transform chain only once can save performance when calculating the transform very often.
XInvalidRead | if either the target or source node does not exist |
targetID | The frame id of the target node |
sourceID | The frame id of the source node |
fixedID | The frame id of the fixed node |
|
inherited |
Publish a transformation for a given frame.
[in] | frameID | The id of the frame |
[in] | transform | Either a 2d or 3d transformation |
[in] | time | The time of the transformation |
|
inherited |
Publish a transformation (frameID) indirect by specifying a direct transform between two nodes (sourceID and targetID).
These two nodes are connected indirectly over the transformation (frameID) This is, the transformation (frameID) is inferred. In the case you know the direct 'transform' between 'targetID' and 'sourceID' you can use this method to publish the desired transform on the link 'frameID' at the specified 'time' and using the specified 'filter' for interpolation. In the following example there is a indirect link from sourceID to targetID via n1, n2, frameID and n3. The transform between source and target is known. The transform in frameID is inferred and published by calling this method.
XRuntime | if either the frame, target or source frames does not exist |
[in] | frameID | The id of the frame to publish indirectly |
[in] | targetID | The frame id of the target node |
[in] | sourceID | The frame id of the source node |
[in] | transform | Either a 2d or 3d transformation |
[in] | time | The time of the transformation |
[in] | filter | The filter used to interpolate between the transforms |
|
inherited |
Add a transformation link between the given child and parent.
Creates child and/or parent if not existing.
[in] | childID | The frame id of the child |
[in] | parentID | The frame id of the parent |
|
inherited |
Add a transformation link between the given child and parent, specifying the type of the transformation.
Creates child and/or parent if not existing.
[in] | childID | The frame id of the child |
[in] | parentID | The frame id of the parent |
[in] | type | Link type fixed/moving |
|
inherited |
Publish a service to register RPC functions at the RPC manager.
You can publish more than one service object with the same service name
[in] | name | The name under which the service is registered. Please note that the name is resolved depending on the namespace the authority is located in. |
[in] | iService | The service object to register. |
[in] | handler | The handler that is used for processing the RPC calls if null internal handler is used (default) |
|
inherited |
Publish a service to register RPC functions at the RPC manager.
As name of the service the id of the authority is used.
[in] | iService | The service object to register. |
[in] | handler | The handler that is used for processing the RPC calls if null internal handler is used (default) |
|
inherited |
Unpublish this service by unregistering the service with the id of the authority from the RPC manager.
|
inherited |
Unpublish a service with a given name by unregistering the service with the name from the RPC manager.
|
inlineinherited |
Performs an RPC call.
This method calls the specified RPC method of the specified service. Depending on the called method the parameters of the RPC call need to be specified as additional parameters. The result of the RPC call can be obtained via the RPCFuture that is returned by this method. The RPCFuture acts as a proxy for the result of the asynchronous RPC call. It can be used to block until the RPC call has finished and the result is available.
service | The name of the service |
method | The method name of the requested call |
p1 | First optional parameter see pn |
pn | Variable number of optional parameters. The number and type depends on the requested RPC method. Both will be checked by the receiver of the RPC call. If the parameter types do not match to the called RPC method, the server will return an error. |
When calling this method the return type of the RPC method needs to be specified as template parameter.
Example:
|
inherited |
Invokes a JSON RPC call.
jsonCall must follow the JSON RPC 2.0 protocol. It must contain:
|
inherited |
Provided for convenience.
See callServiceJSON above. Calls RPCManager::callJSON(const std::string& jsonCall) internally.
|
inherited |
Invokes a JSON RPC call, on the specified service and method with the given params by generating a JSON RPC 2.0 conform json request.
Call id will be automatically generated. Calls RPCManager::callJSON(const std::string& service, const std::string& method, const json::Value& params) internally (after resolving the service).
[in] | service | The service to call |
[in] | method | The method on the service to call |
[in] | params | The parameters for the method to call (must be a json::Array or json null value (default)) |
|
inherited |
Provided for convenience.
See callServiceJSON above. Calls RPCManager::callJSON(const std::string& service, const std::string& method, const std::string& params) internally (after resolving the service).
[in] | service | The service to call |
[in] | method | The method on the service to call |
[in] | params | The parameters of the method as comma separated strings (JSON, no enclosing [], empty string if no parameters) |
|
inherited |
Provided for convenience.
See callServiceJSON above. Will extract parameters to call callServiceJSON(const std::string& service, const std::string& method, const std::string& params) internally (after resolving the service).
|
inherited |
Create a ServiceCall object.
This object acts as a proxy for an rpc service method.
F | The function signature of the wrapped service method. E.g. void(int). |
[in] | service | The service to call |
[in] | method | The service method to call |
[in] | waitTillExists | If true this function blocks till a service with a matching signature appears |
[in] | showBootupMsg | If true this function sets a bootup message that it is waiting for the method to be wrapped by the ServiceCall proxy. |
|
inherited |
Returns true, if a service with the given name exists, otherwise false.
|
inherited |
Returns true, if a service with the given name implements the given interface, otherwise false.
|
inherited |
Waits until a service with the specified name becomes available.
If a timeout is specified, the method times out if no such service becomes available after the given time. Returns true, if the desired services became available, or false, if the method timed out or the thread was interrupted.
|
inherited |
Waits until a service with the specified interface becomes available.
If a timeout is specified, the method times out if no such service becomes available after the given time. Returns the name of the service, if the desired services became available, or an empty string, if the method timed out or the thread was interrupted.
|
inherited |
Returns a string list with the names of all registered services, that implement the specified interface.
|
inherited |
Registers a callback that is called whenever a service registers the given interface, which is specified as first parameter.
The callback method must take two parameters of the type std::string: method(const std::string& interface, const std::string& service); When the method is called, the name of the interface and the name of the service that is registering is passed. The callback is processed within the main dispatcher thread of the authority.
|
inherited |
Same as above but providing a function and class pointer instead of a boost function.
Provided for convenience.
|
inherited |
|
overridevirtualinherited |
Return a status map that contains the status of the authority as well as all registered submodules.
Implements AbstractAuthority.
|
inherited |
Gets the current status map containing all errors, warnings and bootup messages.
|
overridevirtualinherited |
Returns the main property node of this Authority.
Implements AbstractAuthority.
Reimplemented in MicroUnit.
|
overridevirtualinherited |
Returns all published channels by this authority (and its sub-authorities)
Implements AbstractAuthority.
|
overridevirtualinherited |
Returns all subscribed channels by this authority (and its sub-authorities)
Implements AbstractAuthority.
|
overridevirtualinherited |
Returns all service interfaces provided by this authority.
Implements AbstractAuthority.
|
overridevirtualinherited |
Returns all published channels (pair of global and local names) by this authority (and its sub-authorities)
Implements AbstractAuthority.
|
overridevirtualinherited |
Returns all subscribed channels (pair of global and local names) by this authority (and its sub-authorities)
Implements AbstractAuthority.
|
overridevirtualinherited |
Returns status for all subscribed channels (ok, no publisher, no data, ...) by this authority (and its sub-authorities)
Implements AbstractAuthority.
|
protectedinherited |
|
protectedinherited |
|
protectedinherited |
|
protectedinherited |
|
protectedinherited |
|
protectedinherited |
|
protectedinherited |
|
protectedinherited |
|
protectedinherited |
|
protectedinherited |
|
protectedinherited |
|
protectedinherited |
|
protectedinherited |
|
inlineinherited |
Return the resolved namespace of the authority.
|
inlineinherited |
Return the fully qualified global name (includes namespace) This method returns the name without the trailing UUID added if the authority is anonymous.
Use getGlobalID() to obtain the unique id of the authority.
|
inlineinherited |
Return the fully qualified global id (includes namespace)
|
inlineinherited |
Return the id of the authority.
|
inlineinherited |
Return the description of this authority.
|
inlineinherited |
Set the watchdog interval.
|
inlineinherited |
Return the watchdog interval.
|
inlineinherited |
When called for the first time heartbeat usage will be enabled.
This resets the watchdog and signal that everything is working. If you call heartbeat in an interval < watchdog interval the status will be OK (if no other error is set) If a module blocks or fails and does not call heartbeat again until the watchdog interval passed the status will be ERROR
|
inlineinherited |
Returns true if heartbeat usage is enabled (by first call to heartbeat()) and last heartbeat was more than heartbeat interval time ago.
|
inherited |
Signal that the module is booting up.
Optional a message text and a text used for translation can be specified
|
inherited |
Signal that the module has finished booting up (There can still be errors but booting up is finished)
|
inherited |
Signal that the module has finished recovering (There can still be errors but recovering is finished)
|
inherited |
Signal that the module is recovering.
Optional a message text and a text used for translation can be specified
|
inherited |
Signal that a category contains no more errors.
If no category is set all categories are cleared (except boot up).
|
inherited |
Signal a warning in a category.
A message and an optional text for translation can be given. Additionally, the message is written to the error log.
|
inherited |
Signal an error in a category.
A message and an optional text for translation can be given. Additionally, the error message is written to the error log.
|
inherited |
Set the status of a given category.
This method can be used to set the warning or error status of the specified category. a message and an optional text for translation can be given. This method essentially does the same as the above warning() and error() methods. In contrast to those two methods, this method does NOT write the error message to the error/warning log. Hence, it can be used to set the error and warning status silently. In all other cases the warning() and error() methods should be used, which are more convenient.
|
inherited |
Get the status mode defined by the status of the watchdog (if used) and the bootup, error and warning methods.
If the watchdog is used (watchdog is enabled when calling heartbeat() for the first time) this method tests if the latest reset of the watchdog was inside the specified watchdog interval. If not it will return ERROR.
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protectedinherited |
|
protectedinherited |
|
protectedinherited |
|
protectedinherited |
|
protectedinherited |
|
protectedinherited |
|
protectedinherited |