fsrobo_r_robot_state_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 
29 #ifndef FSROBO_R_ROBOT_STATE_INTERFACE_H
30 #define FSROBO_R_ROBOT_STATE_INTERFACE_H
31 
32 #include <vector>
33 #include <string>
42 
43 namespace fsrobo_r_driver
44 {
45 namespace robot_state_interface
46 {
47 
57 
66 {
67 
68 public:
73 
84  bool init(std::string default_ip = "", int default_port = StandardSocketPorts::STATE);
85 
86 
94  bool init(SmplMsgConnection* connection);
95 
106  bool init(SmplMsgConnection* connection, std::vector<std::string>& joint_names);
107 
111  void run();
112 
119  {
120  return this->connection_;
121  }
122 
129  {
130  return &this->manager_;
131  }
132 
133  std::vector<std::string> get_joint_names()
134  {
135  return this->joint_names_;
136  }
137 
138 
145  void add_handler(MessageHandler* handler, bool allow_replace = true)
146  {
147  this->manager_.add(handler, allow_replace);
148  }
149 
150 protected:
156 
159  std::vector<std::string> joint_names_;
160 
161 };
162 
163 }
164 }
165 
166 #endif // FSROBO_R_ROBOT_STATE_INTERFACE_H
Message handler that relays joint positions (converts simple message types to ROS message types and p...
SmplMsgConnection * get_connection()
get current robot-connection instance.
bool add(industrial::message_handler::MessageHandler *handler, bool allow_replace=false)
void add_handler(MessageHandler *handler, bool allow_replace=true)
Add a new handler.
bool init(std::string default_ip="", int default_port=StandardSocketPorts::STATE)
Initialize robot connection using default method.
Message handler that relays joint positions (converts simple message types to ROS message types and p...
Generic template that reads state-data from a robot controller and publishes matching messages to var...


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