fsrobo_r_robot_service_interface.h
Go to the documentation of this file.
1 /*********************************************************************
2 * FSRobo-R Package BSDL
3 * ---------
4 * Copyright (C) 2019 FUJISOFT. All rights reserved.
5 *
6 * Redistribution and use in source and binary forms, with or without modification,
7 * are permitted provided that the following conditions are met:
8 * 1. Redistributions of source code must retain the above copyright notice,
9 * this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright notice,
11 * this list of conditions and the following disclaimer in the documentation and/or
12 * other materials provided with the distribution.
13 * 3. Neither the name of the copyright holder nor the names of its contributors
14 * may be used to endorse or promote products derived from this software without
15 * specific prior written permission.
16 *
17 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
18 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
19 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
20 * IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
21 * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
22 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
23 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
24 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
25 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
26 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27 *********************************************************************/
28 #ifndef FSROBO_R_DRIVER_ROBOT_SERVICE_INTERFACE_H
29 #define FSROBO_R_DRIVER_ROBOT_SERVICE_INTERFACE_H
30 
31 #include <map>
32 #include <vector>
33 #include <string>
34 
35 #include "ros/ros.h"
38 #include "fsrobo_r_msgs/SetIO.h"
40 #include "fsrobo_r_msgs/SetPosture.h"
41 #include "fsrobo_r_msgs/GetPosture.h"
43 #include "fsrobo_r_msgs/SetToolOffset.h"
44 
45 namespace fsrobo_r_driver
46 {
47 namespace robot_service_interface
48 {
54 
62 {
63 
64 public:
70 
81  virtual bool init(std::string default_ip = "", int default_port = StandardSocketPorts::IO);
82 
90  virtual bool init(SmplMsgConnection *connection);
91 
92 
96  virtual void run() { ros::spin(); }
97 
98 protected:
99  ros::ServiceServer srv_set_io_; // handle for set_io service
103 
106 
114  bool setIOCB(fsrobo_r_msgs::SetIO::Request &req, fsrobo_r_msgs::SetIO::Response &res);
115 
123  bool setPostureCB(fsrobo_r_msgs::SetPosture::Request &req, fsrobo_r_msgs::SetPosture::Response &res);
124 
132  bool getPostureCB(fsrobo_r_msgs::GetPosture::Request &req, fsrobo_r_msgs::GetPosture::Response &res);
133 
141  bool setToolOffsetCB(fsrobo_r_msgs::SetToolOffset::Request &req, fsrobo_r_msgs::SetToolOffset::Response &res);
142 
144 
147 };
148 
149 } // namespace robot_service_interface
150 } // namespace fsrobo_r_driver
151 
152 #endif /* FSROBO_R_DRIVER_ROBOT_SERVICE_INTERFACE_H */
bool getPostureCB(fsrobo_r_msgs::GetPosture::Request &req, fsrobo_r_msgs::GetPosture::Response &res)
Callback function registered to ROS get_posture service. Transform message into SimpleMessage objects...
Message handler that relays robot service to the robot controller.
bool setIOCB(fsrobo_r_msgs::SetIO::Request &req, fsrobo_r_msgs::SetIO::Response &res)
Callback function registered to ROS set_io service. Transform message into SimpleMessage objects and ...
virtual void run()
Begin processing messages and publishing topics.
bool setPostureCB(fsrobo_r_msgs::SetPosture::Request &req, fsrobo_r_msgs::SetPosture::Response &res)
Callback function registered to ROS set_posture service. Transform message into SimpleMessage objects...
ROSCPP_DECL void spin(Spinner &spinner)
Wrapper class around FSRobo-R-specific io control commands.
Definition: io_control.h:48
Wrapper class around FSRobo-R-specific configuration commands.
virtual bool init(std::string default_ip="", int default_port=StandardSocketPorts::IO)
Initialize robot connection using default method.
bool setToolOffsetCB(fsrobo_r_msgs::SetToolOffset::Request &req, fsrobo_r_msgs::SetToolOffset::Response &res)
Callback function registered to ROS set_tool_offset service. Transform message into SimpleMessage obj...


fsrobo_r_driver
Author(s): F-ROSROBO
autogenerated on Sun Feb 9 2020 03:58:29