diff --git a/wrappers/README.md b/wrappers/README.md
index 7f657d0..350983d 100644
--- a/wrappers/README.md
+++ b/wrappers/README.md
@@ -12,4 +12,13 @@ make ros
### Run
```bash
+source wrappers/ros/devel/setup.bash
+roslaunch mynt_eye_ros_wrapper mynteye.launch
+```
+
+With RViz to preview,
+
+```bash
+source wrappers/ros/devel/setup.bash
+roslaunch mynt_eye_ros_wrapper display.launch
```
diff --git a/wrappers/ros/src/mynt_eye_ros_wrapper/CMakeLists.txt b/wrappers/ros/src/mynt_eye_ros_wrapper/CMakeLists.txt
index 441e183..e925dc6 100644
--- a/wrappers/ros/src/mynt_eye_ros_wrapper/CMakeLists.txt
+++ b/wrappers/ros/src/mynt_eye_ros_wrapper/CMakeLists.txt
@@ -1,10 +1,15 @@
cmake_minimum_required(VERSION 2.8.3)
project(mynt_eye_ros_wrapper)
+
+get_filename_component(SDK_DIR "${PROJECT_SOURCE_DIR}/../../../.." ABSOLUTE)
+
if(NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE Release)
endif()
+# packages
+
function(checkPackage package customMessage)
set(varName "${package}_FOUND")
if (NOT "${${varName}}")
@@ -19,34 +24,71 @@ endfunction(checkPackage)
find_package(catkin REQUIRED COMPONENTS
cv_bridge
+ geometry_msgs
image_transport
nodelet
roscpp
sensor_msgs
std_msgs
+ tf
)
checkPackage("cv_bridge" "")
+checkPackage("geometry_msgs" "")
checkPackage("image_transport" "")
checkPackage("nodelet" "")
checkPackage("roscpp" "")
checkPackage("sensor_msgs" "")
checkPackage("std_msgs" "")
+checkPackage("tf" "")
catkin_package(
- CATKIN_DEPENDS cv_bridge image_transport nodelet roscpp sensor_msgs std_msgs
+ CATKIN_DEPENDS cv_bridge geometry_msgs image_transport nodelet roscpp sensor_msgs std_msgs tf
)
-# Build
+get_filename_component(SDK_DIR "${PROJECT_SOURCE_DIR}/../../../.." ABSOLUTE)
+
+LIST(APPEND CMAKE_PREFIX_PATH ${SDK_DIR}/third_party/glog/_build)
+find_package(glog REQUIRED)
+message(STATUS "Found glog: ${glog_VERSION}")
+
+LIST(APPEND CMAKE_PREFIX_PATH ${SDK_DIR}/_install/lib/cmake)
+find_package(mynteye REQUIRED)
+message(STATUS "Found mynteye: ${mynteye_VERSION}")
+
+# targets
add_compile_options(-std=c++11)
include_directories(
-# include
${catkin_INCLUDE_DIRS}
+ ${SDK_DIR}/src # for device layer interface
)
-# Install
+set(LINK_LIBS
+ ${catkin_LIBRARIES}
+ mynteye
+)
+
+add_library(mynteye_wrapper src/wrapper_nodelet.cc)
+target_link_libraries(mynteye_wrapper ${LINK_LIBS})
+
+add_executable(mynteye_wrapper_node src/wrapper_node.cc)
+target_link_libraries(mynteye_wrapper_node mynteye_wrapper ${LINK_LIBS})
+
+if(MSVC OR MSYS OR MINGW)
+ target_compile_definitions(mynteye_wrapper_node
+ PUBLIC GLOG_NO_ABBREVIATED_SEVERITIES
+ )
+endif()
+
+# install
+
+install(TARGETS mynteye_wrapper mynteye_wrapper_node
+ ARCHIVE DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}
+ LIBRARY DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}
+ RUNTIME DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION}
+)
install(DIRECTORY launch
DESTINATION ${CATKIN_PACKAGE_INCLUDE_DESTINATION}
@@ -55,3 +97,7 @@ install(DIRECTORY launch
install(DIRECTORY rviz
DESTINATION ${CATKIN_PACKAGE_INCLUDE_DESTINATION}
)
+
+install(FILES nodelet_plugins.xml
+ DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION}
+)
diff --git a/wrappers/ros/src/mynt_eye_ros_wrapper/launch/display.launch b/wrappers/ros/src/mynt_eye_ros_wrapper/launch/display.launch
new file mode 100644
index 0000000..0cc7c0a
--- /dev/null
+++ b/wrappers/ros/src/mynt_eye_ros_wrapper/launch/display.launch
@@ -0,0 +1,8 @@
+
+
+
+
+
+
+
+
diff --git a/wrappers/ros/src/mynt_eye_ros_wrapper/launch/mynteye.launch b/wrappers/ros/src/mynt_eye_ros_wrapper/launch/mynteye.launch
new file mode 100644
index 0000000..6eeef94
--- /dev/null
+++ b/wrappers/ros/src/mynt_eye_ros_wrapper/launch/mynteye.launch
@@ -0,0 +1,96 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/wrappers/ros/src/mynt_eye_ros_wrapper/nodelet_plugins.xml b/wrappers/ros/src/mynt_eye_ros_wrapper/nodelet_plugins.xml
new file mode 100644
index 0000000..ab31cd8
--- /dev/null
+++ b/wrappers/ros/src/mynt_eye_ros_wrapper/nodelet_plugins.xml
@@ -0,0 +1,7 @@
+
+
+ This is the nodelet of ROS interface for MYNT EYE camera.
+
+
diff --git a/wrappers/ros/src/mynt_eye_ros_wrapper/package.xml b/wrappers/ros/src/mynt_eye_ros_wrapper/package.xml
index 63cd33d..68c3326 100644
--- a/wrappers/ros/src/mynt_eye_ros_wrapper/package.xml
+++ b/wrappers/ros/src/mynt_eye_ros_wrapper/package.xml
@@ -14,28 +14,35 @@
catkin
cv_bridge
+ geometry_msgs
image_transport
nodelet
roscpp
sensor_msgs
std_msgs
+ tf
cv_bridge
+ geometry_msgs
image_transport
nodelet
roscpp
sensor_msgs
std_msgs
+ tf
cv_bridge
+ geometry_msgs
image_transport
nodelet
roscpp
sensor_msgs
std_msgs
+ tf
+
diff --git a/wrappers/ros/src/mynt_eye_ros_wrapper/rviz/mynteye.rviz b/wrappers/ros/src/mynt_eye_ros_wrapper/rviz/mynteye.rviz
new file mode 100644
index 0000000..1f82404
--- /dev/null
+++ b/wrappers/ros/src/mynt_eye_ros_wrapper/rviz/mynteye.rviz
@@ -0,0 +1,150 @@
+Panels:
+ - Class: rviz/Displays
+ Help Height: 0
+ Name: Displays
+ Property Tree Widget:
+ Expanded:
+ - /Global Options1
+ - /Status1
+ Splitter Ratio: 0.5
+ Tree Height: 853
+ - Class: rviz/Selection
+ Name: Selection
+ - Class: rviz/Tool Properties
+ Expanded:
+ - /2D Pose Estimate1
+ - /2D Nav Goal1
+ - /Publish Point1
+ Name: Tool Properties
+ Splitter Ratio: 0.588679016
+ - Class: rviz/Views
+ Expanded:
+ - /Current View1
+ Name: Views
+ Splitter Ratio: 0.5
+ - Class: rviz/Time
+ Experimental: false
+ Name: Time
+ SyncMode: 0
+ SyncSource: Left
+Visualization Manager:
+ Class: ""
+ Displays:
+ - Alpha: 0.5
+ Cell Size: 1
+ Class: rviz/Grid
+ Color: 160; 160; 164
+ Enabled: true
+ Line Style:
+ Line Width: 0.0299999993
+ Value: Lines
+ Name: Grid
+ Normal Cell Count: 0
+ Offset:
+ X: 0
+ Y: 0
+ Z: 0
+ Plane: XY
+ Plane Cell Count: 10
+ Reference Frame:
+ Value: true
+ - Alpha: 1
+ Class: rviz_plugin_tutorials/Imu
+ Color: 204; 51; 204
+ Enabled: false
+ History Length: 1
+ Name: Imu
+ Topic: /mynteye/imu
+ Unreliable: false
+ Value: false
+ - Class: rviz/Image
+ Enabled: true
+ Image Topic: /mynteye/left
+ Max Value: 1
+ Median window: 5
+ Min Value: 0
+ Name: Left
+ Normalize Range: true
+ Queue Size: 2
+ Transport Hint: raw
+ Unreliable: false
+ Value: true
+ - Class: rviz/Image
+ Enabled: true
+ Image Topic: /mynteye/right
+ Max Value: 1
+ Median window: 5
+ Min Value: 0
+ Name: Right
+ Normalize Range: true
+ Queue Size: 2
+ Transport Hint: raw
+ Unreliable: false
+ Value: true
+ Enabled: true
+ Global Options:
+ Background Color: 48; 48; 48
+ Default Light: true
+ Fixed Frame: mynteye_link
+ Frame Rate: 30
+ Name: root
+ Tools:
+ - Class: rviz/Interact
+ Hide Inactive Objects: true
+ - Class: rviz/MoveCamera
+ - Class: rviz/Select
+ - Class: rviz/FocusCamera
+ - Class: rviz/Measure
+ - Class: rviz/SetInitialPose
+ Topic: /initialpose
+ - Class: rviz/SetGoal
+ Topic: /move_base_simple/goal
+ - Class: rviz/PublishPoint
+ Single click: true
+ Topic: /clicked_point
+ Value: true
+ Views:
+ Current:
+ Class: rviz/Orbit
+ Distance: 14.7952175
+ Enable Stereo Rendering:
+ Stereo Eye Separation: 0.0599999987
+ Stereo Focal Distance: 1
+ Swap Stereo Eyes: false
+ Value: false
+ Focal Point:
+ X: 0
+ Y: 0
+ Z: 0
+ Focal Shape Fixed Size: true
+ Focal Shape Size: 0.0500000007
+ Invert Z Axis: false
+ Name: Current View
+ Near Clip Distance: 0.00999999978
+ Pitch: 0.785398006
+ Target Frame:
+ Value: Orbit (rviz)
+ Yaw: 0.785398006
+ Saved: ~
+Window Geometry:
+ Displays:
+ collapsed: false
+ Height: 1056
+ Hide Left Dock: false
+ Hide Right Dock: false
+ Left:
+ collapsed: false
+ QMainWindow State: 000000ff00000000fd00000004000000000000016a00000396fc020000000afb0000001200530065006c0065006300740069006f006e00000001e10000009b0000006100fffffffb0000001e0054006f006f006c002000500072006f007000650072007400690065007302000001ed000001df00000185000000a3fb000000120056006900650077007300200054006f006f02000001df000002110000018500000122fb000000200054006f006f006c002000500072006f0070006500720074006900650073003203000002880000011d000002210000017afb000000100044006900730070006c006100790073010000002800000396000000d700fffffffb0000002000730065006c0065006300740069006f006e00200062007500660066006500720200000138000000aa0000023a00000294fb00000014005700690064006500530074006500720065006f02000000e6000000d2000003ee0000030bfb0000000c004b0069006e0065006300740200000186000001060000030c00000261fb00000008004c00650066007403000001bb0000011e0000024f00000191fb0000000a00520069006700680074030000040c0000011e0000025000000190000000010000010f00000396fc0200000003fb0000001e0054006f006f006c002000500072006f00700065007200740069006500730100000041000000780000000000000000fb0000000a00560069006500770073010000002800000396000000ad00fffffffb0000001200530065006c0065006300740069006f006e010000025a000000b200000000000000000000000200000490000000a9fc0100000001fb0000000a00560069006500770073030000004e00000080000002e100000197000000030000073f0000003efc0100000002fb0000000800540069006d006501000000000000073f0000030000fffffffb0000000800540069006d00650100000000000004500000000000000000000004ba0000039600000004000000040000000800000008fc0000000100000002000000010000000a0054006f006f006c00730100000000ffffffff0000000000000000
+ Right:
+ collapsed: false
+ Selection:
+ collapsed: false
+ Time:
+ collapsed: false
+ Tool Properties:
+ collapsed: false
+ Views:
+ collapsed: false
+ Width: 1855
+ X: 65
+ Y: 24
diff --git a/wrappers/ros/src/mynt_eye_ros_wrapper/src/wrapper_node.cc b/wrappers/ros/src/mynt_eye_ros_wrapper/src/wrapper_node.cc
new file mode 100644
index 0000000..3a729df
--- /dev/null
+++ b/wrappers/ros/src/mynt_eye_ros_wrapper/src/wrapper_node.cc
@@ -0,0 +1,22 @@
+#include
+#include
+
+#include "mynteye/glog_init.h"
+
+int main(int argc, char *argv[]) {
+ glog_init _(argc, argv);
+
+ ros::init(argc, argv, "mynteye_wrapper_node");
+ ros::console::set_logger_level(
+ ROSCONSOLE_DEFAULT_NAME, ros::console::levels::Info);
+
+ nodelet::Loader nodelet;
+ nodelet::M_string remap(ros::names::getRemappings());
+ nodelet::V_string nargv;
+ nodelet.load(
+ ros::this_node::getName(), "mynteye/ROSWrapperNodelet", remap, nargv);
+
+ ros::spin();
+
+ return 0;
+}
diff --git a/wrappers/ros/src/mynt_eye_ros_wrapper/src/wrapper_nodelet.cc b/wrappers/ros/src/mynt_eye_ros_wrapper/src/wrapper_nodelet.cc
new file mode 100644
index 0000000..2076bee
--- /dev/null
+++ b/wrappers/ros/src/mynt_eye_ros_wrapper/src/wrapper_nodelet.cc
@@ -0,0 +1,354 @@
+#include // NOLINT
+#include
+
+#include
+#include
+#include
+#include
+#include
+
+#include
+
+#include