ros-drivers / vrpn_client_ros Goto Github PK
View Code? Open in Web Editor NEWVRPN ROS Client
Home Page: http://wiki.ros.org/vrpn_client_ros
VRPN ROS Client
Home Page: http://wiki.ros.org/vrpn_client_ros
A VRPN "tracker" can have multiple tracked frames, each being a separate "sensor" in the VRPN API. In our project we have two sensors on one tracker and need to be able to read these off separately. The attached patch adds a parameter "append_sensor_id" that when set to true makes the client append the sensor id to the tracker name before submitting the pose to the tf topic.
parallels@ubuntu-linux-20-04-desktop:~/catkin_ws$ colcon build
Starting >>> vrpn_client_ros
--- stderr: vrpn_client_ros
CMake Error at CMakeLists.txt:4 (find_package):
By not providing "Findcatkin.cmake" in CMAKE_MODULE_PATH this project has
asked CMake to find a package configuration file provided by "catkin", but
CMake did not find one.
Could not find a package configuration file provided by "catkin" with any
of the following names:
catkinConfig.cmake
catkin-config.cmake
Add the installation prefix of "catkin" to CMAKE_PREFIX_PATH or set
"catkin_DIR" to a directory containing one of the above files. If "catkin"
provides a separate development package or SDK, be sure it has been
installed.
---
Failed <<< vrpn_client_ros [0.06s, exited with code 1]
Summary: 0 packages finished [0.17s]
1 package failed: vrpn_client_ros
1 package had stderr output: vrpn_client_ros
parallels@ubuntu-linux-20-04-desktop:~/catkin_ws$
On ROS wiki, you package describes that /twist and /accel are available in Vicon Tracker 3.3+. Does it mean I cannot subscribe those messages with motive?
Thx
I'm writing an issue here, since this is the repository listed on http://wiki.ros.org/vrpn_client_ros. https://github.com/usrl-uofsc/vrpn_client_ros should suffer from this as well.
When using Docker ROS core image for Noetic, there is a missing system dependency of netbase
. VRPN client ROS package will install and run, but then complains about connection VRPN connection is not 'doing okay'
, which does not explain the exact issue.
Steps to replicate the issue:
sudo docker run --network=host --rm -it ros:noetic-ros-core
# Inside container
apt update
apt install ros-noetic-vrpn-client-ros
source /opt/ros/noetic/setup.bash
# Run VRPN server with empty configuration
touch vrpn.cfg
vrpn_server &
# Launch ROS VRPN client
roslaunch vrpn_client_ros sample.launch
To solve this, install the netbase
package [inside the container]:
# apt install netbase
Then rerunning the sample.launch
will establish a connection and list the example tracker. This behaviour was confirmed on a motion capture system providing VPRN data.
I guess this VRPN implementation relies on some of the definitions from the package in /etc
: /etc/ethertypes
, /etc/protocols
, /etc/rpc
, /etc/services
.
This does not appear to be easily fixable by adding <exec_depend>netbase</exec_depend>
to package.xml
, since there is no key definition for netbase
.
netbase
ought to be present on most systems, so this might have gone undetected because of that. Bare bones containers are a nice way of verifying dependencies.
The data type for "vrpn_client_node/****/accel" is wrongly set to geometry_msgs::TwistStamped when it should be geometry_msgs::AccelStamped. Line 304 of vrpn_client_ros.cpp
Have observed angular velocities published by twist pub are too small by a factor of 100 in my case. This is while running the tracker at 100hz. I believe this driver is missing a division by dt
.
Looking in VrpnTrackerRos::handle_twist
, I see the vrpn_TRACKERVELCB
vel_quat
field is currently converted from quaternion to Euler then published without further modification.
Note in the the definition of the vrpn_TRACKERVELCB
struct:
typedef struct _vrpn_TRACKERVELCB {
struct timeval msg_time; // Time of the report
vrpn_int32 sensor; // Which sensor is reporting
vrpn_float64 vel[3]; // Velocity of the sensor
vrpn_float64 vel_quat[4]; // Rotation of the sensor per vel_quat_dt
vrpn_float64 vel_quat_dt; // delta time (in secs) for vel_quat
} vrpn_TRACKERVELCB;
The vel_quat
field provides change in rotation over a time interval, and the vel_quat_dt
provides the length of that time interval. Hence the user must divide vel_quat
by vel_quat_dt
to determine rotation rate per second. This driver does not perform that division, hence the scaling error on published angular velocity.
I'd suggest the following (untested!) change is appropriate:
diff --git a/src/vrpn_client_ros.cpp b/src/vrpn_client_ros.cpp
index 7a03870..899ee45 100644
--- a/src/vrpn_client_ros.cpp
+++ b/src/vrpn_client_ros.cpp
@@ -265,15 +265,15 @@ namespace vrpn_client_ros
tracker->twist_msg_.twist.linear.y = tracker_twist.vel[1];
tracker->twist_msg_.twist.linear.z = tracker_twist.vel[2];
- double roll, pitch, yaw;
+ double d_roll, d_pitch, d_yaw;
tf2::Matrix3x3 rot_mat(
tf2::Quaternion(tracker_twist.vel_quat[0], tracker_twist.vel_quat[1], tracker_twist.vel_quat[2],
tracker_twist.vel_quat[3]));
- rot_mat.getRPY(roll, pitch, yaw);
+ rot_mat.getRPY(d_roll, d_pitch, d_yaw);
- tracker->twist_msg_.twist.angular.x = roll;
- tracker->twist_msg_.twist.angular.y = pitch;
- tracker->twist_msg_.twist.angular.z = yaw;
+ tracker->twist_msg_.twist.angular.x = d_roll / tracker_twist.vel_quat_dt;
+ tracker->twist_msg_.twist.angular.y = d_pitch / tracker_twist.vel_quat_dt;
+ tracker->twist_msg_.twist.angular.z = d_yaw / tracker_twist.vel_quat_dt;
twist_pub->publish(tracker->twist_msg_);
}
Hi! Has anyone tried vprn_client_ros with ROS2, specifically Dashing Diademata? Are there any plans to port it over?
Thank you for your open source work on vrpn_client_ros. I would like to ask if there is a link to melodic version for reference, or how to learn to write a melodic version package as a beginner of vrpn.
Hello
Thanks for this nice package first. Do you have any plan to update it to ros-noetic? Thanks.
Thank you for this package.
I have a query about whether it is possible to get point cloud data of markers from motive software.
I want to send the data of posision of the cameras optitrack (windows pc) to ros (ubuntu pc). I was reading many forums and decided to choose the method vrpn_client_ros.
In Motive I have the vrpn broadcast option with ip (239.255.42.99) and a port: 3883. I made a LAN with a router where the windows pc has an ip (192.168.1.2) and the Ubuntu pc has an ip (192.168.1.1).
When I run the launch file (roslaunch vrpn_client_ros sample.launch server: = "239.255.42.99") on a terminal, I get the answers: "Connecting to VRPN server at 239.255.42.99" and "Connection established".
My problem is that the topics published do not appear, and therefore I can not get the position data in ros.
How can I solve this problem?
Do I have to modify the launch file?
Reagards!!
Thanks !
Hi There,
Is it possible to stream the position (no orientation) of single markers from Motive, via this package? If so what do I need to change to achieve that?
Cheers!
I succeeded to extract the data and everything seemed fine until I found out that the yaw of orientation works little bit weird.
So far what I found out is, the value of y(yaw) is sin of theta which is divided by 2 from the origin degree. This is okay, but when I flipped the object it went crazy. I kept trying to find a rule about how flipping affects y value whenever I flipped it, but, apparently, it seems like there is no rule.
I just want to know how the orientation works, especially for y(yaw), and what the w is for.
I am using Ubuntu 16.04 and ROS Kinetic. When I try to run "sudo apt-get install ros-kinetic-vrpn-client-ros", I get the error "unable to locate package". I have also tried cloning from the git-repository but when I try to do catkin_make it fails and
I have also tried to run "rosdep install --from-paths" but it gives an error saying "rosdep: error: no packages or stacks specified"
How can I resolve this issue?
Hello.
The reason why I am writing to you is to ask for your help, since when using the vrpn_client_ros package the topic does not appear, I am a beginner in ROS, but I think I have executed the basic steps correctly, since I have done the following:
1.-Install ros kinetic and ros-kinetic-vrpn
2.- I made the workspace.
mkdir -p ~/catkin_ws/src
cd ~/catkin_ws/
catkin_make
3.- clone the package
cd src/
git clone https://github.com/ros-drivers/vrpn_client_ros.git
sudo apt-get update
cd ..
catkin_make
5.- I configure Motive 1.9
โ Broadcast Frame Data
Local Interface ip 192.168.0.100
Stream Rigid Bodies: True
Transmission Type: Multicast
VRPN:
โ Broadcast Frame Data
VRPN Broadcast port: 3883
6.- I write roslaubch vrpn_clientros sample.launch server:=192.168.0.100
I'd appreciate your help.
My environment is MacBook Pro M1, Docker for M1. I pulled a docker image , ros:melodic,from docker hub, and installed ros-melodic-vrpn and this code. but this code can't working. It stoped at
"
connect established
"
for comparing, I running it at Jetson Nano Native OS and Docker in the Jetson Nano which the image was same with the MacBook, ros:melodic. The result showed it can connect the Movite when it running in the Jetson Nano Native OS and can not connect in the Docker in the Jetson Nano either.
then, the other software needed using network in the two docker containers could running normally, such as ssh, apt-get, curl and so on, and running "ping" to Movite's IP in the two docker containers could success.
Is this package going to be released for ROS Melodic any time soon?
I did compile and run it on Ubuntu 18.04 with ROS Melodic and it worked okay so I expect it to be easy!
Below is the command line prompt. I wanted to view the rqt_graph after running vrpn node. The vrpn node runs fine in ROS and I am able to view the rqt_graph if no data is being sent from Motive (optitrack). But, if data is being sent from motive, the rqt_graph aborts and shows the below error.
#############################
rospc@avl2:~/catkin_ws$ rqt_graph
PluginHandlerDirect._restore_settings() plugin "rqt_graph/RosGraph#0" raised an exception:
Traceback (most recent call last):
File "/opt/ros/melodic/lib/python2.7/dist-packages/qt_gui/plugin_handler_direct.py", line 116, in _restore_settings
self._plugin.restore_settings(plugin_settings_plugin, instance_settings_plugin)
File "/opt/ros/melodic/lib/python2.7/dist-packages/rqt_graph/ros_graph.py", line 217, in restore_settings
self._refresh_rosgraph()
File "/opt/ros/melodic/lib/python2.7/dist-packages/rqt_graph/ros_graph.py", line 246, in _refresh_rosgraph
self._update_graph_view(self._generate_dotcode())
File "/opt/ros/melodic/lib/python2.7/dist-packages/rqt_graph/ros_graph.py", line 280, in _generate_dotcode
hide_dynamic_reconfigure=hide_dynamic_reconfigure)
File "/opt/ros/melodic/lib/python2.7/dist-packages/rqt_graph/dotcode.py", line 876, in generate_dotcode
hide_dynamic_reconfigure=hide_dynamic_reconfigure)
File "/opt/ros/melodic/lib/python2.7/dist-packages/rqt_graph/dotcode.py", line 700, in generate_dotgraph
nt_nodes, edges, tf_connections = self._group_tf_nodes(nt_nodes, edges, node_connections)
File "/opt/ros/melodic/lib/python2.7/dist-packages/rqt_graph/dotcode.py", line 513, in _group_tf_nodes
tf_topic_edges_in.update([x for x in node_connections[n].incoming if x in edges and x.end in nodes])
KeyError: ' /tf'
########################
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.