Skip to content

ETH-PBL/vrpn_client_ros

 
 

Repository files navigation

rolling jazzy iron humble foxy

vrpn_client_ros

This fork aims to add velocity and acceleration support to ros2. It is forked from the original here.

Usage (Docker)

Connect to the switch used for the Nokov mocap system, and set your IP accordingly.

Then build with the following command:

docker compose build

And run with the following command:

docker compose up

you can also set a ROS_DOMAIN_ID with the following command:

ROS_DOMAIN_ID=67 docker compose up

Usage

sudo apt install -y \
     ros-$ROS_DISTRO-geometry-msgs \
     ros-$ROS_DISTRO-tf2 \
     ros-$ROS_DISTRO-tf2-ros \
     ros-$ROS_DISTRO-vrpn 
source /opt/ros/$ROS_DISTRO/setup.bash
cd ~/ros2_ws/src
git clone -b foxy-devel https://github.com/NOKOV-MOCAP/vrpn_client_ros
cd ~/ros2_ws
colcon build --packages-select vrpn_client_ros  --symlink-install
source install/setup.bash

nokov@ubuntu:~/ros2_ws/src/vrpn_client_ros/config$ gedit sample.params.yaml

vrpn_client_node:
  ros__parameters:
    server: 192.168.2.148
    port: 3883
    frame_id: "world"
    use_server_time: false
    refresh_tracker_frequency: 0.2
    update_frequency: 60.0
    broadcast_tf: true

This is a ROS parameter configuration file for vrpn_client_node. Here is a description of each parameter:

  • server : indicates the IP address of the VRPN server. In this example, the server's IP address is' 192.168.2.148 ', which you can change to 10.1.1.198
  • port : indicates the port number of the VRPN server. In this example, the port number is' 3883 '.
  • frame_id : name of the frame on which to publish VRPN data. In this example, the name of the coordinate system is' world '.
  • use_server_time : a Boolean value that indicates whether the server timestamp is used. If set to true, vrpn_client_node will use the timestamp received from the server. If set to false, vrpn_client_node will use its own timestamp. In this example, the parameter is set to 'false'.
  • refresh_tracker_frequency : This is a frequency value indicating how often vrpn_client_node refreshes the status of the tracker. In this example, the frequency is refreshed every 5 seconds (0.2 Hz).
  • update_frequency : This is a frequency value indicating how often vrpn_client_node updates data and publishes it to ROS. In this example, this frequency is 60 times per second (60 Hz).
  • broadcast_tf : a Boolean value that indicates whether the tf broadcast is enabled. If set to true, vrpn_client_node will broadcast the trackers pose to tf topic. If set to false, vrpn_client_node will not boradcast trackers pose. in this example, the parameter is set to 'false'.

Launch Default Configuration from Command Line

Run the following command,

ros2 launch vrpn_client_ros sample.launch.py

Then with ros2 topic list, you should be able to see the following topics

/vrpn_client_node/<tracker_name>/pose
/vrpn_client_node/<tracker_name>/twist # optional when mocap reports velocity data
/vrpn_client_node/<tracker_name>/accel # optional when mocap reports acceleration data
/tf                                    # optional when broadcast_tf is set to true

where <tracker_name> is usually the name of your tracked objects.

About

VRPN ROS2 Client with velocity and acceleration support

Resources

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages

  • C++ 89.8%
  • CMake 7.8%
  • Python 2.4%