Linking Openvibe to Ros Noetic using vrpn_client_ros

About BCI and box tutorial/demo scenarios bundled with OpenViBE.
Post Reply
MrCow
Posts: 1
Joined: Wed Jul 26, 2023 1:03 pm

Linking Openvibe to Ros Noetic using vrpn_client_ros

Post by MrCow »

Hey there,

I’m working on a project linking Openvibe 3.5.0 with ROS Noetic on Ubuntu 20.04 using the vrpn_client_ros package however I’m running into some issues.

When I run the vrpn_client_ros using the sample.launch it creates the trackers for the senders from the openvibe-example-openvibe-to-vrpn VRPN tutorial however doesn’t create any topics?

I’ve pasted the output of the sample.launch below, I’m still fairly new to Ubuntu and ROS so any advice would be greatly appreciated!

SUMMARY
========

PARAMETERS
* /rosdistro: noetic
* /rosversion: 1.16.0
* /vrpn_client_node/broadcast_tf: True
* /vrpn_client_node/frame_id: world
* /vrpn_client_node/port: 3883
* /vrpn_client_node/refresh_tracker_frequency: 1.0
* /vrpn_client_node/server: localhost
* /vrpn_client_node/update_frequency: 100.0
* /vrpn_client_node/use_server_time: False

NODES
/
vrpn_client_node (vrpn_client_ros/vrpn_client_node)

ROS_MASTER_URI=http://localhost:11311

process[vrpn_client_node-1]: started with pid [34572]
[ INFO] [1693495353.763009568]: Connecting to VRPN server at localhost:3883
check_vrpn_cookie(): VRPN Note: minor version number doesn't match: (prefer 'vrpn: ver. 07.34', got 'vrpn: ver. 07.31 0'). This is not normally a problem.
[ INFO] [1693495353.767882635]: Connection established
[ INFO] [1693495353.769169870]: Creating new tracker openvibe_vrpn_analog
[ INFO] [1693495353.770333347]: Creating new tracker openvibe_vrpn_button

Thomas
Posts: 211
Joined: Wed Mar 04, 2020 3:38 pm

Re: Linking Openvibe to Ros Noetic using vrpn_client_ros

Post by Thomas »

Hi MrCow,

It's been a while I didn't play with ROS but I had a quick look at the vrpn_client_ros package.

In the file: https://github.com/ros-drivers/vrpn_cli ... nt_ros.cpp, the init code contains the following:

Code: Select all

ROS_INFO_STREAM("Creating new tracker " << tracker_name);

tracker_remote_->register_change_handler(this, &VrpnTrackerRos::handle_pose);
tracker_remote_->register_change_handler(this, &VrpnTrackerRos::handle_twist);
tracker_remote_->register_change_handler(this, &VrpnTrackerRos::handle_accel);
Taking the first one, VrpnTrackerRos::handle_pose is a VRPN_CALLBACK function defined in the same file.

When called for the first time, this callback will advertise the topic if not yet done:

Code: Select all

if (tracker->pose_pubs_.size() <= sensor_index)
{
  tracker->pose_pubs_.resize(sensor_index + 1);
}
pose_pub = &(tracker->pose_pubs_[sensor_index]);
if (pose_pub->getTopic().empty())
{
  *pose_pub = nh.advertise<geometry_msgs::PoseStamped>("pose", 1);
}
Could it be that you don't see any topics until one of the trackers have triggered their callbacks ?

Let me know what you think about it, I haven't tested or ran anything.

Cheers,
Thomas

Post Reply