iirob / ros_opcua_communication

GNU Lesser General Public License v3.0
37 stars 35 forks source link

How can I subscribe on OPC UA Node? #21

Closed hambabumba closed 4 years ago

hambabumba commented 4 years ago

Hey, I can't manage to get any data via the topic. I don't know if I haven't understood something fundamental. I followed the guide: https://github.com/iirob/ros_opcua_communication/tree/kinetic-devel/ros_opcua_impl_freeopcua everything worked fine.

Than I tried to subscribe to the node: rosservice call /opcua/own_opcua_client/subscribe "node: nodeId: 'ns=2;i=3' callback_topic: 'topic'"

The result on the server was: Monitored Item Node NumericNodeId(ns=2;i=3) was created

when I change the data with: rosservice call /opcua/own_opcua_client/write "node: nodeId: 'ns=2;i=3' qualifiedName: 'MyVariable' data: {type: 'float64', bool_d: false, int8_d: 0, uint8_d: 0, int16_d: 0, uint16_d: 0, int32_d: 0, uint32_d: 0, int64_d: 0, uint64_d: 0, float_d: 0.0, double_d: 8.5, string_d: ''}"

nothing happens. Can someone help me please :)

Edit: I tried listening on the topic: rostopic echo /opcua/own_opcua_client/topic

destogl commented 4 years ago

Hi @hambabumba,

thank you for your intererst in the library. I just tested this is ti works with example server. Please check my newest code in #22 where I added also code snippet how to test this.