AWViz-ROS
Loading...
Searching...
No Matches
awviz_common::TfTree Class Reference

#include <tf_tree.hpp>

Public Member Functions

 TfTree ()
 Construct a object setting TF_ROOT as root.
 
void emplace (const TfFrame &frame)
 Add a new tf frame to the tree.
 
const std::unordered_map< std::string, TfFrame > & get_frames () const
 Return map of all frames.
 
std::optional< TfFrameget_frame (const std::string &id) const
 Get the TfFrame object.
 
std::optional< TfFrameget_parent (const std::string &id) const
 Get the parent TfFrame object.
 
bool contains (const std::string &id) const
 Whether to the specified frame ID is contained as a node of tree.
 
bool contains (const TfFrame &frame) const
 Whether to the specified frame is contained in the tree checking both key and value.
 
std::string entity_path (const TfFrame &frame) const
 Return entity path of the specified frame. The entity path will be in the format "/<Parent0>/<Parent1>/.../<FrameID>", where "<Parent0>" represents the deepest parent frame.
 
bool can_link_to (const TfFrame &frame, const std::string &id) const
 Check whether the input frame is linked to the input id.
 

Constructor & Destructor Documentation

◆ TfTree()

awviz_common::TfTree::TfTree ( )
inline

Construct a object setting TF_ROOT as root.

Member Function Documentation

◆ can_link_to()

bool awviz_common::TfTree::can_link_to ( const TfFrame frame,
const std::string &  id 
) const
inline

Check whether the input frame is linked to the input id.

Parameters
frameTfFrame object.
idFrame ID.
Returns
Return true if the input frame can link to id.

◆ contains() [1/2]

bool awviz_common::TfTree::contains ( const std::string &  id) const
inline

Whether to the specified frame ID is contained as a node of tree.

Parameters
idFrame ID.
Returns
Returns true, if the frame is contained.

◆ contains() [2/2]

bool awviz_common::TfTree::contains ( const TfFrame frame) const
inline

Whether to the specified frame is contained in the tree checking both key and value.

Parameters
frameTfFrame object.
Returns
true Return true if the tree contains the ID of frame as a key, and then if its value is equivalent to frame.

◆ emplace()

void awviz_common::TfTree::emplace ( const TfFrame frame)
inline

Add a new tf frame to the tree.

Parameters
frameA new tf frame. If it has been already registered, skip adding.

◆ entity_path()

std::string awviz_common::TfTree::entity_path ( const TfFrame frame) const
inline

Return entity path of the specified frame. The entity path will be in the format "/<Parent0>/<Parent1>/.../<FrameID>", where "<Parent0>" represents the deepest parent frame.

Parameters
frameTfFrame Object.
Returns
Entity path of the frame.

◆ get_frame()

std::optional< TfFrame > awviz_common::TfTree::get_frame ( const std::string &  id) const
inline

Get the TfFrame object.

Parameters
idFrame ID.
Returns
Corresponding TfFrame object. If there is no target TfFrame, returns nullptr.

◆ get_frames()

const std::unordered_map< std::string, TfFrame > & awviz_common::TfTree::get_frames ( ) const
inline

Return map of all frames.

Returns
Shared pointer of all frames.

◆ get_parent()

std::optional< TfFrame > awviz_common::TfTree::get_parent ( const std::string &  id) const
inline

Get the parent TfFrame object.

Parameters
idFrame ID.
Returns
Parent TfFrame object. If there is no parent, returns nullptr.

The documentation for this class was generated from the following file: