This file implements OpcUa client based on FreeOpcUa implementation. More...
#include <ros/ros.h>
#include <signal.h>
#include <opcua_helpers.h>
#include "ros_opcua_msgs/Address.h"
#include "ros_opcua_msgs/TypeValue.h"
#include "ros_opcua_srvs/CallMethod.h"
#include "ros_opcua_srvs/Connect.h"
#include "ros_opcua_srvs/Disconnect.h"
#include "ros_opcua_srvs/ListNode.h"
#include "ros_opcua_srvs/Read.h"
#include "ros_opcua_srvs/Subscribe.h"
#include "ros_opcua_srvs/Write.h"
#include "ros_opcua_srvs/Unsubscribe.h"
#include <opc/ua/client/client.h>
#include <opc/ua/subscription.h>
Go to the source code of this file.
Classes | |
class | SubClient |
Subscription client class handles subscription callbacks. More... | |
Functions | |
bool | call_method (ros_opcua_srvs::CallMethod::Request &req, ros_opcua_srvs::CallMethod::Response &res) |
bool | connect (ros_opcua_srvs::Connect::Request &req, ros_opcua_srvs::Connect::Response &res) |
bool | disconnect (ros_opcua_srvs::Disconnect::Request &req, ros_opcua_srvs::Disconnect::Response &res) |
bool | list_node (ros_opcua_srvs::ListNode::Request &req, ros_opcua_srvs::ListNode::Response &res) |
int | main (int argc, char **argv) |
void | on_shutdown (int sig) |
bool | read (ros_opcua_srvs::Read::Request &req, ros_opcua_srvs::Read::Response &res) |
bool | subscribe (ros_opcua_srvs::Subscribe::Request &req, ros_opcua_srvs::Subscribe::Response &res) |
bool | unsubscribe (ros_opcua_srvs::Unsubscribe::Request &req, ros_opcua_srvs::Unsubscribe::Response &res) |
bool | write (ros_opcua_srvs::Write::Request &req, ros_opcua_srvs::Write::Response &res) |
Variables | |
std::map< std::string, ros::Publisher > | _callback_publishers |
Callback publishers list. More... | |
OpcUa::UaClient | _client (false) |
Client variable. More... | |
bool | _connected = false |
Connected status variable. More... | |
SubClient | _sclt |
Subscription client store. More... | |
std::map< std::string, uint32_t > | _subscription_handles |
List of subscription handles. More... | |
std::map< std::string, std::shared_ptr< OpcUa::Subscription > > | _subscriptions |
Subscription list. More... | |
This file implements OpcUa client based on FreeOpcUa implementation.
This file is part of SkillPro-Framework. SkillPro-Framework is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. SkillPro-Framework is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with SkillPro-Framework. If not, see <http://www.gnu.org/licenses/>.
Definition in file opcua_client.cpp.
bool call_method | ( | ros_opcua_srvs::CallMethod::Request & | req, |
ros_opcua_srvs::CallMethod::Response & | res | ||
) |
Definition at line 191 of file opcua_client.cpp.
bool connect | ( | ros_opcua_srvs::Connect::Request & | req, |
ros_opcua_srvs::Connect::Response & | res | ||
) |
ROS-service call: Connect. Connects to OpcUa server.
req | service request |
res | service response |
Definition at line 90 of file opcua_client.cpp.
bool disconnect | ( | ros_opcua_srvs::Disconnect::Request & | req, |
ros_opcua_srvs::Disconnect::Response & | res | ||
) |
ROS-service call: Disconnect. Disconnects from OpcUa server.
req | service request |
res | service response |
Definition at line 123 of file opcua_client.cpp.
bool list_node | ( | ros_opcua_srvs::ListNode::Request & | req, |
ros_opcua_srvs::ListNode::Response & | res | ||
) |
ROS-service call: ListNode. Gets list of Node children from OpcUa server.
req | service request |
res | service response |
Definition at line 153 of file opcua_client.cpp.
int main | ( | int | argc, |
char ** | argv | ||
) |
Start function of ROS-Node with default name 'opcua_client_node'
argc | number of command line arguments |
argv | command line arguments |
Definition at line 426 of file opcua_client.cpp.
void on_shutdown | ( | int | sig | ) |
Handler for Shutdown of the node
Definition at line 413 of file opcua_client.cpp.
bool read | ( | ros_opcua_srvs::Read::Request & | req, |
ros_opcua_srvs::Read::Response & | res | ||
) |
ROS-service call: Read. Reads value from OpcUa server.
req | service request |
res | service response |
Definition at line 238 of file opcua_client.cpp.
bool subscribe | ( | ros_opcua_srvs::Subscribe::Request & | req, |
ros_opcua_srvs::Subscribe::Response & | res | ||
) |
ROS-service call: Subscribe. Subscribe to DataChange of Node on OpcUa server.
req | service request |
res | service response |
Definition at line 327 of file opcua_client.cpp.
bool unsubscribe | ( | ros_opcua_srvs::Unsubscribe::Request & | req, |
ros_opcua_srvs::Unsubscribe::Response & | res | ||
) |
ROS-service call: Unsubscribe. Unsubscribe from Node on OpcUa server.
req | service request |
res | service response |
Definition at line 370 of file opcua_client.cpp.
bool write | ( | ros_opcua_srvs::Write::Request & | req, |
ros_opcua_srvs::Write::Response & | res | ||
) |
ROS-service call: Write. Writes value to OpcUa server.
req | service request |
res | service response |
Definition at line 277 of file opcua_client.cpp.
std::map<std::string, ros::Publisher> _callback_publishers |
Callback publishers list.
Key is OpcUa string node identifier and value ROS publisher
Definition at line 52 of file opcua_client.cpp.
OpcUa::UaClient _client(false) |
Client variable.
bool _connected = false |
Connected status variable.
Definition at line 57 of file opcua_client.cpp.
SubClient _sclt |
Subscription client store.
Definition at line 82 of file opcua_client.cpp.
std::map<std::string, uint32_t> _subscription_handles |
List of subscription handles.
Key is OpcUa string node identifier and value is node handle. This is needed for deteting of subscriptions
Definition at line 55 of file opcua_client.cpp.
std::map<std::string, std::shared_ptr<OpcUa::Subscription> > _subscriptions |
Subscription list.
Key is OpcUa string node identifier and value subscription reference.
Definition at line 49 of file opcua_client.cpp.