-
Notifications
You must be signed in to change notification settings - Fork 79
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
10 changed files
with
381 additions
and
322 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,66 +1,77 @@ | ||
cmake_minimum_required(VERSION 2.8.3) | ||
cmake_minimum_required(VERSION 3.5) | ||
project(vrpn_client_ros) | ||
|
||
find_package(catkin REQUIRED COMPONENTS geometry_msgs roscpp tf2_ros) | ||
# Default to C99 | ||
if(NOT CMAKE_C_STANDARD) | ||
set(CMAKE_C_STANDARD 99) | ||
endif() | ||
|
||
# Default to C++14 | ||
if(NOT CMAKE_CXX_STANDARD) | ||
set(CMAKE_CXX_STANDARD 14) | ||
endif() | ||
|
||
if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang") | ||
add_compile_options(-Wall -Wextra -Wpedantic) | ||
endif() | ||
|
||
# find dependencies | ||
find_package(ament_cmake REQUIRED) | ||
# uncomment the following section in order to fill in | ||
# further dependencies manually. | ||
# find_package(<dependency> REQUIRED) | ||
# find_package(catkin REQUIRED COMPONENTS geometry_msgs tf2_ros) | ||
find_package(VRPN REQUIRED) | ||
find_package(rclcpp REQUIRED) | ||
find_package(std_msgs REQUIRED) | ||
find_package(geometry_msgs REQUIRED) | ||
|
||
catkin_package( | ||
INCLUDE_DIRS include | ||
LIBRARIES vrpn_client_ros | ||
CATKIN_DEPENDS geometry_msgs tf2_ros | ||
DEPENDS VRPN | ||
) | ||
if(BUILD_TESTING) | ||
find_package(ament_lint_auto REQUIRED) | ||
# the following line skips the linter which checks for copyrights | ||
# uncomment the line when a copyright and license is not present in all source files | ||
#set(ament_cmake_copyright_FOUND TRUE) | ||
# the following line skips cpplint (only works in a git repo) | ||
# uncomment the line when this package is not in a git repo | ||
#set(ament_cmake_cpplint_FOUND TRUE) | ||
ament_lint_auto_find_test_dependencies() | ||
endif() | ||
|
||
set_directory_properties(PROPERTIES COMPILE_OPTIONS "-std=c++11;-Wall") | ||
|
||
include_directories( | ||
include | ||
${catkin_INCLUDE_DIRS} | ||
SYSTEM ${VRPN_INCLUDE_DIR} | ||
) | ||
include_directories(include) | ||
|
||
add_library(vrpn_client_ros | ||
src/vrpn_client_ros.cpp | ||
) | ||
target_link_libraries(vrpn_client_ros | ||
${catkin_LIBRARIES} | ||
${VRPN_LIBRARIES} | ||
) | ||
src/vrpn_client_ros.cpp) | ||
ament_target_dependencies(vrpn_client_ros rclcpp std_msgs geometry_msgs VRPN) | ||
|
||
add_executable(vrpn_tracker_node | ||
src/vrpn_tracker_node.cpp) | ||
add_dependencies(vrpn_tracker_node vrpn_client_ros) | ||
target_link_libraries(vrpn_tracker_node | ||
vrpn_client_ros | ||
${catkin_LIBRARIES} | ||
) | ||
add_executable(vrpn_tracker_node src/vrpn_tracker_node.cpp) | ||
target_link_libraries(vrpn_tracker_node vrpn_client_ros) | ||
ament_target_dependencies(vrpn_tracker_node rclcpp std_msgs geometry_msgs VRPN) | ||
|
||
add_executable(vrpn_client_node | ||
src/vrpn_client_node.cpp) | ||
add_dependencies(vrpn_client_node vrpn_client_ros) | ||
target_link_libraries(vrpn_client_node | ||
vrpn_client_ros | ||
${catkin_LIBRARIES} | ||
) | ||
add_executable(vrpn_client_node src/vrpn_client_node.cpp) | ||
target_link_libraries(vrpn_client_node vrpn_client_ros) | ||
ament_target_dependencies(vrpn_client_node rclcpp std_msgs geometry_msgs VRPN) | ||
|
||
install(TARGETS vrpn_client_ros vrpn_tracker_node vrpn_client_node | ||
ARCHIVE DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION} | ||
LIBRARY DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION} | ||
RUNTIME DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION} | ||
install(DIRECTORY | ||
launch | ||
DESTINATION share/${PROJECT_NAME}/ | ||
) | ||
|
||
install(DIRECTORY include/${PROJECT_NAME}/ | ||
DESTINATION ${CATKIN_PACKAGE_INCLUDE_DESTINATION} | ||
install(DIRECTORY | ||
config | ||
DESTINATION share/${PROJECT_NAME}/ | ||
) | ||
|
||
install(DIRECTORY launch | ||
DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION} | ||
install(TARGETS | ||
vrpn_client_ros | ||
ARCHIVE DESTINATION lib | ||
LIBRARY DESTINATION lib | ||
RUNTIME DESTINATION bin) | ||
|
||
install(TARGETS | ||
vrpn_tracker_node | ||
vrpn_client_node | ||
DESTINATION lib/${PROJECT_NAME} | ||
) | ||
|
||
if(CATKIN_ENABLE_TESTING) | ||
find_package(roslaunch REQUIRED) | ||
find_package(roslint REQUIRED) | ||
roslint_cpp() | ||
roslint_add_test() | ||
roslaunch_add_file_check(launch) | ||
endif() | ||
ament_package() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
# vrpn_client_ros | ||
This fork aims at porting the original code from the kinetic-devel branch to ROS2. | ||
|
||
## Requirements | ||
|
||
The code requires VRPN to work. Unfortunately, currently the package is only | ||
available in melodic and older ROS releases and can be installed with: | ||
``` | ||
apt-get install ros-melodic-vrpn | ||
``` | ||
|
||
If you want to stick to ROS2 or do not have access to melodic packages you can | ||
clone the following repository to the src folder of your ros_overlay_ws: | ||
``` | ||
git clone --single-branch --branch debian/melodic/vrpn [email protected]:ros-drivers-gbp/vrpn-release.git | ||
``` | ||
|
||
## What works? | ||
|
||
I only use pose in my project, so I did not port anything else (TF, twist, accel). Also multiple sensors per tracker are not ported. | ||
If there is anyone who would like to use the other features and is willing to test them, I'd be happy to help. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
vrpn_client_node: | ||
ros__parameters: | ||
server: 192.168.0.107 | ||
port: 3883 | ||
frame_id: "world" | ||
use_server_time: false | ||
refresh_tracker_frequency: 0.2 | ||
update_frequency: 30.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
from pathlib import Path | ||
|
||
from ament_index_python.packages import get_package_share_directory | ||
import launch | ||
import launch.actions | ||
import launch.substitutions | ||
import launch_ros.actions | ||
|
||
|
||
parameters_file_path = Path( | ||
get_package_share_directory('vrpn_client_ros'), | ||
'config', | ||
'sample.params.yaml' | ||
) | ||
|
||
|
||
def generate_launch_description(): | ||
return launch.LaunchDescription([ | ||
launch_ros.actions.Node( | ||
package='vrpn_client_ros', | ||
node_executable='vrpn_client_node', | ||
output='screen', | ||
emulate_tty=True, | ||
parameters=[parameters_file_path], | ||
), | ||
]) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
<?xml version="1.0"?> | ||
<package format="2"> | ||
<?xml-model href="http://download.ros.org/schema/package_format3.xsd" schematypens="http://www.w3.org/2001/XMLSchema"?> | ||
<package format="3"> | ||
<name>vrpn_client_ros</name> | ||
<version>0.2.2</version> | ||
<description>ROS client nodes for the <a href="https://github.com/vrpn/vrpn/wiki">VRPN</a> library, compatible with VICON, OptiTrack, and other <a href="https://github.com/vrpn/vrpn/wiki/Supported-hardware-devices">hardware interfaces</a>.</description> | ||
|
@@ -8,16 +9,16 @@ | |
<maintainer email="[email protected]">Paul Bovbel</maintainer> | ||
|
||
<license>BSD</license> | ||
<buildtool_depend>catkin</buildtool_depend> | ||
<buildtool_depend>ament_cmake</buildtool_depend> | ||
|
||
<depend>geometry_msgs</depend> | ||
<depend>roscpp</depend> | ||
<depend>tf2_ros</depend> | ||
<depend>vrpn</depend> | ||
<depend>VRPN</depend> | ||
|
||
<test_depend>roslaunch</test_depend> | ||
<test_depend>roslint</test_depend> | ||
<test_depend>ament_lint_auto</test_depend> | ||
<test_depend>ament_lint_common</test_depend> | ||
|
||
<export> | ||
<build_type>ament_cmake</build_type> | ||
</export> | ||
</package> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.