Skip to content

Commit

Permalink
feat: Use numeric node IDs
Browse files Browse the repository at this point in the history
because the robot control uses them and they are
distinct from string IDs.
  • Loading branch information
philipp-caspers committed Sep 30, 2024
1 parent 049e512 commit acc23df
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion examples/opc_ua/rapid-clock.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ fn rapid_clock() {

fn add_timed_variable(server: &mut Server, namespace: u16) {
// These will be the node ids of the new variables
let ticks_since_launch_node_id = NodeId::new(namespace, "100111");
let ticks_since_launch_node_id = NodeId::new(namespace, 100111);

let address_space = server.address_space();

Expand Down
2 changes: 1 addition & 1 deletion examples/opc_ua/sine-joint-positions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ fn sine_joint_positions() {

fn add_timed_variable_array(server: &mut Server) {
// These will be the node id of the variable AxesMeasuredPosition
let axes_measured_position = NodeId::new(1, "100111");
let axes_measured_position = NodeId::new(1, 100111);

let address_space = server.address_space();

Expand Down
2 changes: 1 addition & 1 deletion src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ fn main() -> Result<(), RclrsError> {
opc_ua_client
.lock()
.unwrap()
.create_subscription(1, "100111", callback, 10)
.create_subscription(1, 100111, callback, 10)
.expect("ERROR: Got an error while subscribing to variables");
// Loops forever. The publish thread will call the callback with changes on the variables
info!("Starting OPC UA client");
Expand Down
2 changes: 1 addition & 1 deletion src/opc_ua_client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ impl OPCUAClient {
pub fn create_subscription<F>(
&self,
namespace: u16,
node_id: &'static str,
node_id: u32,
callback: F,
period_ms: u64,
) -> Result<(), StatusCode>
Expand Down
2 changes: 1 addition & 1 deletion tests/helpers/opc_ua_publisher_single_linear.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ fn rapid_clock() {

fn add_timed_variable(server: &mut Server, namespace: u16) {
// These will be the node ids of the new variables
let ticks_since_launch_node_id = NodeId::new(namespace, "100111");
let ticks_since_launch_node_id = NodeId::new(namespace, 100111);

let address_space = server.address_space();

Expand Down

0 comments on commit acc23df

Please sign in to comment.