Skip to content

Commit

Permalink
updated dep on modified opcua
Browse files Browse the repository at this point in the history
  • Loading branch information
kristoferB committed Nov 25, 2021
1 parent fcd65ca commit d613fc0
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 11 deletions.
14 changes: 6 additions & 8 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,5 @@ edition = "2018"
r2r = "0.5.3"
futures = "0.3.15"
tokio = { version = "1", features = ["full"] }
opcua-client = "0.8"
opcua-client = {git = "https://github.com/kristoferb/opcua", branch = "0.8.1"}
serde_json = "1.0"
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,8 @@ Or simply
```
cargo run -- --ros-args -p server_address:="opc.tcp://192.168.1.33:4840/" -p node_ids:=["ns=4;i=45","ns=4;i=46","ns=4;i=47","ns=4;i=94","ns=4;i=306"]
```

Another example
```
cargo run -- --ros-args -p server_address:="opc.tcp://192.168.100.10:4840/" -p node_ids:=["ns=4;s=|var|CODESYS CONTROL FOR Raspberry Pi MC SL.Application.IO.bool_from_plc_1","ns=4;s=|var|CODESYS CONTROL FOR Raspberry Pi MC SL.Application.IO.bool_to_plc_1"]
```
4 changes: 2 additions & 2 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -261,8 +261,8 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> {
let state = Arc::new(Mutex::new(HashMap::new()));
let (session, _kill) = setup_opc(&server_address, node_ids, state.clone()).expect("could not connect to opc server");

let sub = node.subscribe::<r2r::std_msgs::msg::String>("command")?;
let publisher = node.create_publisher::<r2r::std_msgs::msg::String>("measured")?;
let sub = node.subscribe::<r2r::std_msgs::msg::String>("opc_command")?;
let publisher = node.create_publisher::<r2r::std_msgs::msg::String>("opc_measured")?;

let state_task = state.clone();
let handle = tokio::task::spawn_blocking(move || loop {
Expand Down

0 comments on commit d613fc0

Please sign in to comment.