Class Diagrams
The following class diagram of the soar_ros::Service class (inheritance diagram) provides a basic overview of the library architecture.
All ROS wrapper classes adjusted for usage with Soar are based on the input or output base classes as well as the shared interface.
-
template<typename T, typename pRequestType = typename T::Request::SharedPtr, typename pResponseType = typename T::Response::SharedPtr>
class Service : public virtual soar_ros::Input<typename T::Request::SharedPtr>, public virtual soar_ros::Output<typename T::Response::SharedPtr>, public soar_ros::Interface Inheritance diagram for soar_ros::Service:
![digraph {
graph [bgcolor="#00000000"]
node [shape=rectangle style=filled fillcolor="#FFFFFF" font=Helvetica padding=2]
edge [color="#1414CE"]
"3" [label="soar_ros::InputBase" tooltip="soar_ros::InputBase"]
"5" [label="soar_ros::OutputBase" tooltip="soar_ros::OutputBase"]
"1" [label="soar_ros::Service< T, pRequestType, pResponseType >" tooltip="soar_ros::Service< T, pRequestType, pResponseType >" fillcolor="#BFBFBF"]
"6" [label="soar_ros::Interface" tooltip="soar_ros::Interface"]
"4" [label="soar_ros::Output< typename T::Response::SharedPtr >" tooltip="soar_ros::Output< typename T::Response::SharedPtr >"]
"2" [label="soar_ros::Input< typename T::Request::SharedPtr >" tooltip="soar_ros::Input< typename T::Request::SharedPtr >"]
"1" -> "2" [dir=forward tooltip="public-inheritance"]
"1" -> "4" [dir=forward tooltip="public-inheritance"]
"1" -> "6" [dir=forward tooltip="public-inheritance"]
"4" -> "5" [dir=forward tooltip="public-inheritance"]
"2" -> "3" [dir=forward tooltip="public-inheritance"]
}](../_images/graphviz-4d102d78a2aa9c0fdb912e03f8f741170fc95d69.png)
Collaboration diagram for soar_ros::Service:
![digraph {
graph [bgcolor="#00000000"]
node [shape=rectangle style=filled fillcolor="#FFFFFF" font=Helvetica padding=2]
edge [color="#1414CE"]
"3" [label="soar_ros::InputBase" tooltip="soar_ros::InputBase"]
"5" [label="soar_ros::OutputBase" tooltip="soar_ros::OutputBase"]
"9" [label="rclcpp::Logger" tooltip="rclcpp::Logger"]
"1" [label="soar_ros::Service< T, pRequestType, pResponseType >" tooltip="soar_ros::Service< T, pRequestType, pResponseType >" fillcolor="#BFBFBF"]
"7" [label="rclcpp::Service< T >" tooltip="rclcpp::Service< T >"]
"6" [label="soar_ros::Interface" tooltip="soar_ros::Interface"]
"8" [label="rclcpp::ServiceBase" tooltip="rclcpp::ServiceBase"]
"4" [label="soar_ros::Output< typename T::Response::SharedPtr >" tooltip="soar_ros::Output< typename T::Response::SharedPtr >"]
"2" [label="soar_ros::Input< typename T::Request::SharedPtr >" tooltip="soar_ros::Input< typename T::Request::SharedPtr >"]
"1" -> "2" [dir=forward tooltip="public-inheritance"]
"1" -> "4" [dir=forward tooltip="public-inheritance"]
"1" -> "6" [dir=forward tooltip="public-inheritance"]
"1" -> "7" [dir=forward tooltip="usage"]
"7" -> "8" [dir=forward tooltip="public-inheritance"]
"8" -> "9" [dir=forward tooltip="usage"]
"4" -> "5" [dir=forward tooltip="public-inheritance"]
"2" -> "3" [dir=forward tooltip="public-inheritance"]
}](../_images/graphviz-0ce2b7298634e6d8e98b6c355c703054fb300ac9.png)
The difference between service and client from the libraries perspective is only the reversal of output and input calls.
-
template<typename T, typename pRequestType = typename T::Request::SharedPtr, typename pResponseType = typename T::Response::SharedPtr>
class Client : public virtual soar_ros::Output<typename T::Request::SharedPtr>, public virtual soar_ros::Input<typename T::Response::SharedPtr>, public soar_ros::Interface Inheritance diagram for soar_ros::Client:
![digraph {
graph [bgcolor="#00000000"]
node [shape=rectangle style=filled fillcolor="#FFFFFF" font=Helvetica padding=2]
edge [color="#1414CE"]
"5" [label="soar_ros::InputBase" tooltip="soar_ros::InputBase"]
"4" [label="soar_ros::Input< typename T::Response::SharedPtr >" tooltip="soar_ros::Input< typename T::Response::SharedPtr >"]
"3" [label="soar_ros::OutputBase" tooltip="soar_ros::OutputBase"]
"2" [label="soar_ros::Output< typename T::Request::SharedPtr >" tooltip="soar_ros::Output< typename T::Request::SharedPtr >"]
"6" [label="soar_ros::Interface" tooltip="soar_ros::Interface"]
"1" [label="soar_ros::Client< T, pRequestType, pResponseType >" tooltip="soar_ros::Client< T, pRequestType, pResponseType >" fillcolor="#BFBFBF"]
"4" -> "5" [dir=forward tooltip="public-inheritance"]
"2" -> "3" [dir=forward tooltip="public-inheritance"]
"1" -> "2" [dir=forward tooltip="public-inheritance"]
"1" -> "4" [dir=forward tooltip="public-inheritance"]
"1" -> "6" [dir=forward tooltip="public-inheritance"]
}](../_images/graphviz-a258076500e4a2699ec59364eb2a2a7e34944b9b.png)
Collaboration diagram for soar_ros::Client:
![digraph {
graph [bgcolor="#00000000"]
node [shape=rectangle style=filled fillcolor="#FFFFFF" font=Helvetica padding=2]
edge [color="#1414CE"]
"7" [label="rclcpp::Client< T >" tooltip="rclcpp::Client< T >"]
"5" [label="soar_ros::InputBase" tooltip="soar_ros::InputBase"]
"4" [label="soar_ros::Input< typename T::Response::SharedPtr >" tooltip="soar_ros::Input< typename T::Response::SharedPtr >"]
"3" [label="soar_ros::OutputBase" tooltip="soar_ros::OutputBase"]
"9" [label="rclcpp::Logger" tooltip="rclcpp::Logger"]
"2" [label="soar_ros::Output< typename T::Request::SharedPtr >" tooltip="soar_ros::Output< typename T::Request::SharedPtr >"]
"6" [label="soar_ros::Interface" tooltip="soar_ros::Interface"]
"8" [label="rclcpp::ClientBase" tooltip="rclcpp::ClientBase"]
"1" [label="soar_ros::Client< T, pRequestType, pResponseType >" tooltip="soar_ros::Client< T, pRequestType, pResponseType >" fillcolor="#BFBFBF"]
"7" -> "8" [dir=forward tooltip="public-inheritance"]
"4" -> "5" [dir=forward tooltip="public-inheritance"]
"2" -> "3" [dir=forward tooltip="public-inheritance"]
"8" -> "9" [dir=forward tooltip="usage"]
"1" -> "2" [dir=forward tooltip="public-inheritance"]
"1" -> "4" [dir=forward tooltip="public-inheritance"]
"1" -> "6" [dir=forward tooltip="public-inheritance"]
"1" -> "7" [dir=forward tooltip="usage"]
}](../_images/graphviz-a19cf8986ba712e7b582689de5ae93a08345e1f3.png)
Publisher and subscriber only have either the input or the output functionality:
![digraph {
graph [bgcolor="#00000000"]
node [shape=rectangle style=filled fillcolor="#FFFFFF" font=Helvetica padding=2]
edge [color="#1414CE"]
"2" [label="soar_ros::Output< T >" tooltip="soar_ros::Output< T >"]
"3" [label="soar_ros::OutputBase" tooltip="soar_ros::OutputBase"]
"4" [label="soar_ros::Interface" tooltip="soar_ros::Interface"]
"1" [label="soar_ros::Publisher< T >" tooltip="soar_ros::Publisher< T >" fillcolor="#BFBFBF"]
"2" -> "3" [dir=forward tooltip="public-inheritance"]
"1" -> "2" [dir=forward tooltip="public-inheritance"]
"1" -> "4" [dir=forward tooltip="public-inheritance"]
}](../_images/graphviz-00f3f9383b9e7d25a14c433838b9ad45ec820382.png)
![digraph {
graph [bgcolor="#00000000"]
node [shape=rectangle style=filled fillcolor="#FFFFFF" font=Helvetica padding=2]
edge [color="#1414CE"]
"2" [label="soar_ros::Output< T >" tooltip="soar_ros::Output< T >"]
"5" [label="rclcpp::Publisher< T >" tooltip="rclcpp::Publisher< T >"]
"3" [label="soar_ros::OutputBase" tooltip="soar_ros::OutputBase"]
"6" [label="rclcpp::PublisherBase" tooltip="rclcpp::PublisherBase"]
"4" [label="soar_ros::Interface" tooltip="soar_ros::Interface"]
"1" [label="soar_ros::Publisher< T >" tooltip="soar_ros::Publisher< T >" fillcolor="#BFBFBF"]
"7" [label="rclcpp::PublisherEventCallbacks" tooltip="rclcpp::PublisherEventCallbacks"]
"2" -> "3" [dir=forward tooltip="public-inheritance"]
"5" -> "6" [dir=forward tooltip="public-inheritance"]
"6" -> "7" [dir=forward tooltip="usage"]
"1" -> "2" [dir=forward tooltip="public-inheritance"]
"1" -> "4" [dir=forward tooltip="public-inheritance"]
"1" -> "5" [dir=forward tooltip="usage"]
}](../_images/graphviz-986d253af01ed9eeb5aa1891087e09c9d63271dd.png)
![digraph {
graph [bgcolor="#00000000"]
node [shape=rectangle style=filled fillcolor="#FFFFFF" font=Helvetica padding=2]
edge [color="#1414CE"]
"1" [label="soar_ros::Subscriber< T >" tooltip="soar_ros::Subscriber< T >" fillcolor="#BFBFBF"]
"2" [label="soar_ros::Input< T >" tooltip="soar_ros::Input< T >"]
"3" [label="soar_ros::InputBase" tooltip="soar_ros::InputBase"]
"4" [label="soar_ros::Interface" tooltip="soar_ros::Interface"]
"1" -> "2" [dir=forward tooltip="public-inheritance"]
"1" -> "4" [dir=forward tooltip="public-inheritance"]
"2" -> "3" [dir=forward tooltip="public-inheritance"]
}](../_images/graphviz-44a7eba15294653fcc0833cb6d01e2d58f731de8.png)
![digraph {
graph [bgcolor="#00000000"]
node [shape=rectangle style=filled fillcolor="#FFFFFF" font=Helvetica padding=2]
edge [color="#1414CE"]
"5" [label="rclcpp::Subscription< T >" tooltip="rclcpp::Subscription< T >"]
"1" [label="soar_ros::Subscriber< T >" tooltip="soar_ros::Subscriber< T >" fillcolor="#BFBFBF"]
"8" [label="rclcpp::SubscriptionEventCallbacks" tooltip="rclcpp::SubscriptionEventCallbacks"]
"2" [label="soar_ros::Input< T >" tooltip="soar_ros::Input< T >"]
"3" [label="soar_ros::InputBase" tooltip="soar_ros::InputBase"]
"6" [label="rclcpp::SubscriptionBase" tooltip="rclcpp::SubscriptionBase"]
"9" [label="rclcpp::Logger" tooltip="rclcpp::Logger"]
"4" [label="soar_ros::Interface" tooltip="soar_ros::Interface"]
"7" [label="rclcpp::node_interfaces::NodeBaseInterface" tooltip="rclcpp::node_interfaces::NodeBaseInterface"]
"5" -> "6" [dir=forward tooltip="public-inheritance"]
"1" -> "2" [dir=forward tooltip="public-inheritance"]
"1" -> "4" [dir=forward tooltip="public-inheritance"]
"1" -> "5" [dir=forward tooltip="usage"]
"2" -> "3" [dir=forward tooltip="public-inheritance"]
"6" -> "7" [dir=forward tooltip="usage"]
"6" -> "8" [dir=forward tooltip="usage"]
"6" -> "9" [dir=forward tooltip="usage"]
}](../_images/graphviz-5043cd8bfbb1e076776f14b3b98ddfe32e1fe761.png)