dusty-nv / ros_deep_learning

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

erro in nodelet_imagenet.cpp #107

Open ivory4u opened 2 years ago

ivory4u commented 2 years ago

I just get below error. How can I fix it?

[ 3%] Building CXX object ros_deep_learning/CMakeFiles/ros_deep_learning_nodelets.dir/src/nodelet_imagenet.cpp.o /home/nvidia/catkin_ws/src/ros_deep_learning/src/nodelet_imagenet.cpp: In member function ‘void ros_deep_learning::ros_imagenet::callback(const ImageConstPtr&)’: /home/nvidia/catkin_ws/src/ros_deep_learning/src/nodelet_imagenet.cpp:88:121: error: no matching function for call to ‘imageNet::Classify(imageConverter::PixelType, uint32_t, uint32_t, float)’ g_class = net->Classify(imgCvt->ImageGPU(), imgCvt->GetWidth(), imgCvt->GetHeight(), &confidence); ^ In file included from /home/nvidia/catkin_ws/src/ros_deep_learning/src/nodelet_imagenet.cpp:2:0: /usr/local/include/jetson-inference/imageNet.h:154:6: note: candidate: int imageNet::Classify(float, uint32_t, uint32_t, float) int Classify( float rgba, uint32_t width, uint32_t height, float confidence=NULL ); ^ /usr/local/include/jetson-inference/imageNet.h:154:6: note: no known conversion for argument 1 from ‘imageConverter::PixelType {aka uchar3}’ to ‘float’ /usr/local/include/jetson-inference/imageNet.h:162:6: note: candidate: int imageNet::Classify(float) int Classify( float* confidence=NULL ); ^ /usr/local/include/jetson-inference/imageNet.h:162:6: note: candidate expects 1 argument, 4 provided ros_deep_learning/CMakeFiles/ros_deep_learning_nodelets.dir/build.make:62: recipe for target 'ros_deep_learning/CMakeFiles/ros_deep_learning_nodelets.dir/src/nodelet_imagenet.cpp.o' failed make[2]: [ros_deep_learning/CMakeFiles/ros_deep_learning_nodelets.dir/src/nodelet_imagenet.cpp.o] Error 1 CMakeFiles/Makefile2:3624: recipe for target 'ros_deep_learning/CMakeFiles/ros_deep_learning_nodelets.dir/all' failed make[1]: [ros_deep_learning/CMakeFiles/ros_deep_learning_nodelets.dir/all] Error 2 Makefile:138: recipe for target 'all' failed make: *** [all] Error 2

dusty-nv commented 2 years ago

Hi @ivory4u, I haven't been maintaining this nodelet, so I would just recommend commenting out lines 85-90 of CMakeLists.txt : https://github.com/dusty-nv/ros_deep_learning/blob/a58d6961b06e380f7bd0f2b5379d7f249f7da590/CMakeLists.txt#L85

ivory4u commented 2 years ago

Hi @dusty-nv I just comment out lines 85-90 of CMkaeLists.txt. but I just get other issue like below. Could help it?

CMakeFiles/video_source.dir/src/node_video_source.cpp.o: In function main': node_video_source.cpp:(.text+0x7cc): undefined reference tovideoOptions::videoOptions()' node_video_source.cpp:(.text+0xd40): undefined reference to videoOptions::CodecFromStr(char const*)' node_video_source.cpp:(.text+0xd6c): undefined reference tovideoOptions::FlipMethodFromStr(char const)' node_video_source.cpp:(.text+0xee4): undefined reference to `videoSource::Create(char const, videoOptions const&)' CMakeFiles/video_source.dir/src/image_converter.cpp.o: In function imageConverter::Convert(boost::shared_ptr<sensor_msgs::Image_<std::allocator<void> > const> const&)': image_converter.cpp:(.text+0x924): undefined reference tocudaConvertColor(void, imageFormat, void, imageFormat, unsigned long, unsigned long, float2 const&)' CMakeFiles/video_source.dir/src/image_converter.cpp.o: In function imageConverter::Convert(sensor_msgs::Image_<std::allocator<void> >&, imageFormat, uchar3*)': image_converter.cpp:(.text+0xcc0): undefined reference tocudaConvertColor(void, imageFormat, void, imageFormat, unsigned long, unsigned long, float2 const&)' collect2: error: ld returned 1 exit status ros_deep_learning/CMakeFiles/video_source.dir/build.make:180: recipe for target '/home/nvidia/catkin_ws/devel/lib/ros_deep_learning/video_source' failed make[2]: [/home/nvidia/catkin_ws/devel/lib/ros_deep_learning/video_source] Error 1 CMakeFiles/Makefile2:3819: recipe for target 'ros_deep_learning/CMakeFiles/video_source.dir/all' failed make[1]: [ros_deep_learning/CMakeFiles/video_source.dir/all] Error 2 CMakeFiles/video_output.dir/src/node_video_output.cpp.o: In function main': node_video_output.cpp:(.text+0x44c): undefined reference tovideoOptions::videoOptions()' node_video_output.cpp:(.text+0x740): undefined reference to videoOptions::CodecFromStr(char const*)' node_video_output.cpp:(.text+0x8a8): undefined reference tovideoOutput::Create(char const, videoOptions const&)' CMakeFiles/video_output.dir/src/image_converter.cpp.o: In function imageConverter::Convert(boost::shared_ptr<sensor_msgs::Image_<std::allocator<void> > const> const&)': image_converter.cpp:(.text+0x924): undefined reference tocudaConvertColor(void, imageFormat, void, imageFormat, unsigned long, unsigned long, float2 const&)' CMakeFiles/video_output.dir/src/image_converter.cpp.o: In function `imageConverter::Convert(sensormsgs::Image<std::allocator >&, imageFormat, uchar3)': image_converter.cpp:(.text+0xcc0): undefined reference to `cudaConvertColor(void, imageFormat, void, imageFormat, unsigned long, unsigned long, float2 const&)' collect2: error: ld returned 1 exit status ros_deep_learning/CMakeFiles/video_output.dir/build.make:180: recipe for target '/home/nvidia/catkin_ws/devel/lib/ros_deep_learning/video_output' failed make[2]: [/home/nvidia/catkin_ws/devel/lib/ros_deep_learning/video_output] Error 1 CMakeFiles/Makefile2:3750: recipe for target 'ros_deep_learning/CMakeFiles/video_output.dir/all' failed make[1]: [ros_deep_learning/CMakeFiles/video_output.dir/all] Error 2 Makefile:138: recipe for target 'all' failed make: *** [all] Error 2

dusty-nv commented 2 years ago

Hmm...can you try adding jetson-utils to this line: https://github.com/dusty-nv/ros_deep_learning/blob/a58d6961b06e380f7bd0f2b5379d7f249f7da590/CMakeLists.txt#L79

ivory4u commented 2 years ago

Hi @dusty-nv Yes, It already added that line.

I use TX1 board and Kinetic of ros version. Is it not working on Kinetic version?

dusty-nv commented 2 years ago

It's been a long time since I tested against Kinetic.

Can you also try adding jetson-utils to this line: https://github.com/dusty-nv/ros_deep_learning/blob/a58d6961b06e380f7bd0f2b5379d7f249f7da590/CMakeLists.txt#L82