dusty-nv / ros_deep_learning

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

Changes to add CameraInfo publisher. #74

Open elgarbe opened 3 years ago

elgarbe commented 3 years ago

I add a sensor_msgs::CameraInfo publisher to manage calibration file It works on ROS1 only.

vnguyen13 commented 1 year ago

Thanks for posting this. The first time I tried to catkin build this I got:

jetbot@nano-4gb-jp45:~/workspace/catkin_ws$ catkin build
---------------------------------------------------------------------
Profile:                     default
Extending:          [cached] /opt/ros/melodic
Workspace:                   /home/jetbot/workspace/catkin_ws
---------------------------------------------------------------------
Build Space:        [exists] /home/jetbot/workspace/catkin_ws/build
Devel Space:        [exists] /home/jetbot/workspace/catkin_ws/devel
Install Space:      [unused] /home/jetbot/workspace/catkin_ws/install
Log Space:          [exists] /home/jetbot/workspace/catkin_ws/logs
Source Space:       [exists] /home/jetbot/workspace/catkin_ws/src
DESTDIR:            [unused] None
---------------------------------------------------------------------
Devel Space Layout:          linked
Install Space Layout:        None
--------------------Ç-------------------------------------------------
Additional CMake Args:       None
Additional Make Args:        None
Additional catkin Make Args: None
Internal Make Job Server:    True
Cache Job Environments:      False
---------------------------------------------------------------------
Whitelisted Packages:        None
Blacklisted Packages:        None
---------------------------------------------------------------------
Workspace configuration appears valid.
---------------------------------------------------------------------
[build] Found '5' packages in 0.0 seconds.                                     
[build] Package table is up to date.                                           
Starting  >>> apriltag                                                         
Starting  >>> gscam                                                            
Starting  >>> ros_deep_learning                                                
Finished  <<< gscam                            [ 1.0 seconds ]                 
Starting  >>> jetson_csi_cam                                                   
Finished  <<< apriltag                         [ 1.9 seconds ]                 
Starting  >>> apriltag_ros                                                     
Finished  <<< jetson_csi_cam                   [ 0.5 seconds ]                 
Finished  <<< apriltag_ros                     [ 2.0 seconds ]                 
_______________________________________________________________________________
Errors     << ros_deep_learning:make /home/jetbot/workspace/catkin_ws/logs/ros_deep_learning/build.make.009.log
CMakeFiles/video_source.dir/src/node_video_source.cpp.o: In function `main':
node_video_source.cpp:(.text+0xca4): undefined reference to `camera_info_manager::CameraInfoManager::CameraInfoManager(ros::NodeHandle, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)'
node_video_source.cpp:(.text+0xcb8): undefined reference to `camera_info_manager::CameraInfoManager::loadCameraInfo(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)'
node_video_source.cpp:(.text+0xe08): undefined reference to `camera_info_manager::CameraInfoManager::getCameraInfo()'
node_video_source.cpp:(.text+0xf70): undefined reference to `camera_info_manager::CameraInfoManager::loadCameraInfo(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)'
node_video_source.cpp:(.text+0x10d0): undefined reference to `camera_info_manager::CameraInfoManager::getCameraInfo()'
collect2: error: ld returned 1 exit status
make[2]: *** [/home/jetbot/workspace/catkin_ws/devel/.private/ros_deep_learning/lib/ros_deep_learning/video_source] Error 1
make[1]: *** [CMakeFiles/video_source.dir/all] Error 2
make: *** [all] Error 2
cd /home/jetbot/workspace/catkin_ws/build/ros_deep_learning; catkin build --get-env ros_deep_learning | catkin env -si  /usr/bin/make --jobserver-fds=6,7 -j; cd -
...............................................................................
Failed     << ros_deep_learning:make           [ Exited with code 2 ]          
Failed    <<< ros_deep_learning                [ 10.3 seconds ]                
[build] Summary: 4 of 5 packages succeeded.                                    
[build]   Ignored:   None.                                                     
[build]   Warnings:  None.                                                     
[build]   Abandoned: None.                                                     
[build]   Failed:    1 packages failed.                                        
[build] Runtime: 11.0 seconds total.                                           
jetbot@nano-4gb-jp45:~/workspace/catkin_ws$ 

I then ran a catkin clean then a catkin build again and got this:

jetbot@nano-4gb-jp45:~/workspace/catkin_ws$ catkin build

---------------------------------------------------------------------
Profile:                     default
Extending:          [cached] /opt/ros/melodic
Workspace:                   /home/jetbot/workspace/catkin_ws
---------------------------------------------------------------------
Build Space:        [exists] /home/jetbot/workspace/catkin_ws/build
Devel Space:        [exists] /home/jetbot/workspace/catkin_ws/devel
Install Space:      [unused] /home/jetbot/workspace/catkin_ws/install
Log Space:          [exists] /home/jetbot/workspace/catkin_ws/logs
Source Space:       [exists] /home/jetbot/workspace/catkin_ws/src
DESTDIR:            [unused] None
---------------------------------------------------------------------
Devel Space Layout:          linked
Install Space Layout:        None
---------------------------------------------------------------------
Additional CMake Args:       None
Additional Make Args:        None
Additional catkin Make Args: None
Internal Make Job Server:    True
Cache Job Environments:      False
---------------------------------------------------------------------
Whitelisted Packages:        None
Blacklisted Packages:        None
---------------------------------------------------------------------
Workspace configuration appears valid.
---------------------------------------------------------------------
[build] Found '5' packages in 0.0 seconds.                                     
[build] Package table is up to date.                                           
Starting  >>> apriltag                                                         
Starting  >>> gscam                                                            
Starting  >>> ros_deep_learning                                                
Finished  <<< gscam                            [ 0.7 seconds ]                 
Finished  <<< apriltag                         [ 2.2 seconds ]                 
Starting  >>> jetson_csi_cam                                                   
Starting  >>> apriltag_ros                                                     
Finished  <<< jetson_csi_cam                   [ 11.8 seconds ]                
_______________________________________________________________________________
Errors     << ros_deep_learning:make /home/jetbot/workspace/catkin_ws/logs/ros_deep_learning/build.make.001.log
/usr/bin/ld: cannot find -lnvbuf_utils
collect2: error: ld returned 1 exit status
make[2]: *** [/home/jetbot/workspace/catkin_ws/devel/.private/ros_deep_learning/lib/ros_deep_learning/video_source] Error 1
make[1]: *** [CMakeFiles/video_source.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....
/home/jetbot/workspace/catkin_ws/src/ros_deep_learning/src/node_segnet.cpp: In function ‘int main(int, char**)’:
/home/jetbot/workspace/catkin_ws/src/ros_deep_learning/src/node_segnet.cpp:232:11: error: ‘NetworkType’ is not a member of ‘segNet’
   segNet::NetworkType model = segNet::NetworkTypeFromStr(model_name.c_str());
           ^~~~~~~~~~~
/home/jetbot/workspace/catkin_ws/src/ros_deep_learning/src/node_segnet.cpp:234:7: error: ‘model’ was not declared in this scope
   if( model == segNet::SEGNET_CUSTOM )
       ^~~~~
/home/jetbot/workspace/catkin_ws/src/ros_deep_learning/src/node_segnet.cpp:234:7: note: suggested alternative: ‘modfl’
   if( model == segNet::SEGNET_CUSTOM )
       ^~~~~
       modfl
/home/jetbot/workspace/catkin_ws/src/ros_deep_learning/src/node_segnet.cpp:234:24: error: ‘SEGNET_CUSTOM’ is not a member of ‘segNet’
   if( model == segNet::SEGNET_CUSTOM )
                        ^~~~~~~~~~~~~
/home/jetbot/workspace/catkin_ws/src/ros_deep_learning/src/node_segnet.cpp:237:20: error: ‘FCN_RESNET18_CITYSCAPES_1024x512’ is not a member of ‘segNet’
    model = segNet::FCN_RESNET18_CITYSCAPES_1024x512;
                    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/jetbot/workspace/catkin_ws/src/ros_deep_learning/src/node_segnet.cpp:241:24: error: ‘model’ was not declared in this scope
   net = segNet::Create(model);
                        ^~~~~
/home/jetbot/workspace/catkin_ws/src/ros_deep_learning/src/node_segnet.cpp:241:24: note: suggested alternative: ‘modfl’
   net = segNet::Create(model);
                        ^~~~~
                        modfl
/home/jetbot/workspace/catkin_ws/src/ros_deep_learning/src/node_detectnet.cpp: In function ‘int main(int, char**)’:
/home/jetbot/workspace/catkin_ws/src/ros_deep_learning/src/node_detectnet.cpp:226:14: error: ‘NetworkType’ is not a member of ‘detectNet’
   detectNet::NetworkType model = detectNet::NetworkTypeFromStr(model_name.c_str());
              ^~~~~~~~~~~
/home/jetbot/workspace/catkin_ws/src/ros_deep_learning/src/node_detectnet.cpp:228:7: error: ‘model’ was not declared in this scope
   if( model == detectNet::CUSTOM )
       ^~~~~
/home/jetbot/workspace/catkin_ws/src/ros_deep_learning/src/node_detectnet.cpp:228:7: note: suggested alternative: ‘modfl’
   if( model == detectNet::CUSTOM )
       ^~~~~
       modfl
/home/jetbot/workspace/catkin_ws/src/ros_deep_learning/src/node_detectnet.cpp:228:27: error: ‘CUSTOM’ is not a member of ‘detectNet’
   if( model == detectNet::CUSTOM )
                           ^~~~~~
/home/jetbot/workspace/catkin_ws/src/ros_deep_learning/src/node_detectnet.cpp:231:23: error: ‘SSD_MOBILENET_V2’ is not a member of ‘detectNet’
    model = detectNet::SSD_MOBILENET_V2;
                       ^~~~~~~~~~~~~~~~
/home/jetbot/workspace/catkin_ws/src/ros_deep_learning/src/node_detectnet.cpp:235:27: error: ‘model’ was not declared in this scope
   net = detectNet::Create(model, threshold);
                           ^~~~~
/home/jetbot/workspace/catkin_ws/src/ros_deep_learning/src/node_detectnet.cpp:235:27: note: suggested alternative: ‘modfl’
   net = detectNet::Create(model, threshold);
                           ^~~~~
                           modfl
make[2]: *** [CMakeFiles/segnet.dir/src/node_segnet.cpp.o] Error 1
make[2]: *** Waiting for unfinished jobs....
make[1]: *** [CMakeFiles/segnet.dir/all] Error 2
make[2]: *** [CMakeFiles/detectnet.dir/src/node_detectnet.cpp.o] Error 1
make[2]: *** Waiting for unfinished jobs....
make[1]: *** [CMakeFiles/detectnet.dir/all] Error 2
make: *** [all] Error 2
cd /home/jetbot/workspace/catkin_ws/build/ros_deep_learning; catkin build --get-env ros_deep_learning | catkin env -si  /usr/bin/make --jobserver-fds=6,7 -j; cd -
...............................................................................
Failed     << ros_deep_learning:make           [ Exited with code 2 ]          
Failed    <<< ros_deep_learning                [ 15.9 seconds ]                
Finished  <<< apriltag_ros                     [ 1 minute and 33.7 seconds ]   
[build] Summary: 4 of 5 packages succeeded.                                    
[build]   Ignored:   None.                                                     
[build]   Warnings:  None.                                                     
[build]   Abandoned: None.                                                     
[build]   Failed:    1 packages failed.                                        
[build] Runtime: 1 minute and 43.5 seconds total.                              
[build] Note: Workspace packages have changed, please re-source setup files to use them.

Any ideas why these would come up?