ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange |
1 | initial version |
Service call back function can be overloaded like this
void handleSrv(
const std::shared_ptr<rmw_request_id_t> requestHeader,
const std::shared_ptr<example_interfaces::srv::AddTwoInts::Request> request,
std::shared_ptr<example_interfaces::srv::AddTwoInts::Response> response);
requestHeader
variable has all the information needed. Similarly for subscriber
void handleSub(const std_msgs::msg::String::SharedPtr msg,
const rclcpp::MessageInfo& message_info);
message_info
variable has all the information needed.