Carma-platform v4.2.0
CARMA Platform is built on robot operating system (ROS) and utilizes open source software (OSS) that enables Cooperative Driving Automation (CDA) features to allow Automated Driving Systems to interact and cooperate with infrastructure and other vehicles through communication.
|
Class which serves as an abstraction of a service framework. More...
#include <ROSComms.h>
Public Member Functions | |
std::string | getTopic () |
Returns the name string (topic) associated with the service. More... | |
CommTypes | getCommType () |
returns the comms type of this object More... | |
bool | callback (M req, T res) |
Callback function which is triggered to pass data into this comms abstraction. More... | |
M | getReqType () |
Returns an instance of the type this object is parameterized on. This is used for forwarding the data type. More... | |
T | getResType () |
Returns an instance of the type this object is parameterized on. This is used for forwarding the data type. More... | |
ROSComms () | |
Default constructor. More... | |
ROSComms (std::function< bool(M, T)> cbf, CommTypes ct, std::string t) | |
Service constructor. More... | |
Private Attributes | |
std::function< void(M, T)> | callback_function_ |
CommTypes | comm_type_ |
std::string | topic_ |
Class which serves as an abstraction of a service framework.
M | Request Type. This should be a base service request type |
T | Response Type. This should be the base service response type |
Definition at line 136 of file ROSComms.h.
mock_drivers::ROSComms< M, T >::ROSComms | ( | ) |
Default constructor.
mock_drivers::ROSComms< M, T >::ROSComms | ( | std::function< bool(M, T)> | cbf, |
CommTypes | ct, | ||
std::string | t | ||
) |
Service constructor.
This version of the ROSComms object is used for services.
cbf | Service callback function. First parameter is the service request. The second is the out parameter for the response. |
ct | The comms type. Should be srv |
t | The topic name |
Definition at line 65 of file ROSComms.ipp.
bool mock_drivers::ROSComms< M, T >::callback | ( | M | req, |
T | res | ||
) |
Callback function which is triggered to pass data into this comms abstraction.
Used to call the ROSComms callback function.
req | The request message to pass |
res | The response message to pass |
Definition at line 74 of file ROSComms.ipp.
|
inline |
returns the comms type of this object
Definition at line 158 of file ROSComms.h.
M mock_drivers::ROSComms< M, T >::getReqType |
Returns an instance of the type this object is parameterized on. This is used for forwarding the data type.
Used to get an object of the service request type that can then be decltyped.
Definition at line 90 of file ROSComms.ipp.
T mock_drivers::ROSComms< M, T >::getResType |
Returns an instance of the type this object is parameterized on. This is used for forwarding the data type.
Used to get an object of the service response type that can then be decltyped.
Definition at line 82 of file ROSComms.ipp.
|
inline |
Returns the name string (topic) associated with the service.
Definition at line 149 of file ROSComms.h.
|
private |
Definition at line 139 of file ROSComms.h.
|
private |
Definition at line 140 of file ROSComms.h.
|
private |
Definition at line 141 of file ROSComms.h.