dusty-nv / ros_deep_learning

Deep learning inference nodes for ROS / ROS2 with support for NVIDIA Jetson and TensorRT
879 stars 257 forks source link

Using realsense node output for detecting object using detectnet #19

Closed inderpreetsingh01 closed 4 years ago

inderpreetsingh01 commented 4 years ago

Hi @dusty-nv I am using Realsense D415 camera along with jetson Tx2. I have launched the camera node using

roslaunch realsense2_camera rs_camera.launch

after that I ran detectnet node using

rosrun ros_deep_learning detectnet /detectnet/image_in:=camera/color/image_raw _model_name:=pednet

after this I am getting the error

failed to convert 640480 rgb8 image converting 640480 rgb8 image 640*480 image is in rgb8 format, expected bgr8

inderpreetsingh01 commented 4 years ago

I solved the issue by writing a separate node for converting raw_image from rgb8 to gbr8 format, by subscribing to the /camera/color/image_raw topic of realsense and publishing it to new topic to which detectnet node will subscribe.

vxgu86 commented 4 years ago

how did you solve this, could you share your solution? thanks @inderpreetsingh01

inderpreetsingh01 commented 4 years ago

Hi @vxgu86 below I am attaching a file which I am using as a ros node. I hope it helps rgb2bgr.txt

debackerj93 commented 4 years ago

@inderpreetsingh01 Thanks for sharing your solution. I'm having some trouble getting the include files to work.. can you share your insight to this catkin_make problem I get when I try to build the source file:

In file included from /home/lduser/catkin_ws/src/ros_deep_learning/src/rgb2bgr.cpp:3:0:
/opt/ros/melodic/include/cv_bridge/cv_bridge.h:43:10: fatal error: opencv2/core/core.hpp: No such file or directory
 #include <opencv2/core/core.hpp>

I've installed the ros package vision_opencv.. but it isn't finding any of the header files. Sorry, I'm very new to this.

Thanks!