ros-drivers / vrpn_client_ros

VRPN ROS Client
http://wiki.ros.org/vrpn_client_ros
60 stars 78 forks source link

Ros2 #20

Open AlexKaravaev opened 2 years ago

AlexKaravaev commented 2 years ago

Hi!

This is latest ros2 sync. I have tested it with ros2 rolling distribution and Optitrack setup with Motive with 2 distinct rigid bodies. Mostly it based on @zeroos PR #16 , but I've added also twist and accel publishing and also some changes described below.

Notable logical changes I made:

1) I added explicit calculation of twist and accel based on previous messages

2) Removed multiple sensor support. To be honest, I just don't know how it works and what are sensor id's and therefore I deleted it. If you can provide me some info about that, I can commit changes later.

Also, I think it should not be merged into foxy-devel branch, but instead we should create separate branch ros2 to track latest rolling version updates. But since I don't have the rights to create new branch I submitted PR to existing branch

paulbovbel commented 2 years ago

This is great, thanks. I'll circle back around to review this as soon as I can. Merging into foxy is fine, we can re-arrange branches once this is released anyways.

paulbovbel commented 2 years ago

Removed multiple sensor support. To be honest, I just don't know how it works and what are sensor id's and therefore I deleted it. If you can provide me some info about that, I can commit changes later.

I wish I could remember, but I imagine they existed for a reason. I haven't had access to a VICON system in years.

evbernardes commented 2 years ago

How can I install the VRPN dependency? I'm having this when I try to build with colcon:

Could NOT find VRPN (missing: VRPN_LIBRARY VRPN_INCLUDE_DIR QUATLIB_FOUND)

AlexKaravaev commented 2 years ago

@evbernardes You should install it from here https://github.com/vrpn/vrpn

evbernardes commented 2 years ago

@AlexKaravaev thanks for the reply! Is there a special way I have to install in order for colcon to be able to use the library to correctly compile using it?

AlexKaravaev commented 2 years ago

@evbernardes For me it was working with usual make && sudo make install

evbernardes commented 2 years ago

@AlexKaravaev I was definitely overthinking it, thanks! I managed to compile it, but I'll have to wait until my lab is open so I can test it with our mocap system.

Just a little thing though: I installed tf2 with apt get and I had too change two lines from vrpn_client_ros.cpp:

include "tf2_geometry_msgs/tf2_geometry_msgs.hpp" -> #include "tf2_geometry_msgs/tf2_geometry_msgs.h

include "tf2_kdl/tf2_kdl.hpp -> #include "tf2_kdl/tf2_kdl.h

And then it compiled!

AlexKaravaev commented 2 years ago

@evbernardes Which ros-version and ubuntu you are using? Because in rolling it seems like with latest tf2 it explicitly says, that .h are deprecated

/overlay_ws/install/tf2_geometry_msgs/include/tf2_geometry_msgs/tf2_geometry_msgs.h:35:2: warning: #warning This header is obsolete, please include tf2_geometry_msgs/tf2_geometry_msgs.hpp instead [-Wcpp]
   35 | #warning This header is obsolete, please include tf2_geometry_msgs/tf2_geometry_msgs.hpp instead
      |  ^~~~~~~
In file included from /overlay_ws/src/vrpn_client_ros/src/vrpn_client_ros.cpp:40:
/overlay_ws/install/tf2_kdl/include/tf2_kdl/tf2_kdl.h:35:2: warning: #warning is a GCC extension
   35 | #warning This header is obsolete, please include tf2_kdl/tf2_kdl.hpp instead
      |  ^~~~~~~
evbernardes commented 2 years ago

I see! I'm using galactic with Ubuntu 20.04, which is supposed to be the latest LTS release. I tried to install everything I can with apt to minimize these kinds of problems but I'm starting to think it wasn't the best option

Crowdedlight commented 1 year ago

Any updates on this one? I can see there is ros-foxy-vrpn-client-ros available, but none for Humble, the current LTS release. Is this PR meant to also work for humble?