rickstaa / realsense-ros-gazebo

Gazebo implementation of the realsense-ros repository
48 stars 9 forks source link

Error on catkin build #5

Closed PhilipAmadasun closed 1 year ago

PhilipAmadasun commented 2 years ago

I get an error in catkin_build:

--------------------------------------------------------------------------
[build] Found '3' packages in 0.0 seconds.                                     
[build] Package table is up to date.                                           
Starting  >>> realsense2_camera                                                
Starting  >>> realsense2_description                                           
Starting  >>> realsense_gazebo_plugin                                          
_______________________________________________________________________________
Errors     << realsense2_camera:cmake /home/philip/realsense_ws/logs/realsense2_camera/build.cmake.003.log
CMake Error: The source "/home/philip/realsense_ws/src/realsense-ros-gazebo/realsense-ros/realsense2_camera/CMakeLists.txt" does not match the source "/home/philip/realsense_ws/src/realsense-ros/realsense2_camera/CMakeLists.txt" used to generate cache.  Re-run cmake with a different source directory.
cd /home/philip/realsense_ws/build/realsense2_camera; catkin build --get-env realsense2_camera | catkin env -si  /usr/bin/cmake /home/philip/realsense_ws/src/realsense-ros-gazebo/realsense-ros/realsense2_camera --no-warn-unused-cli -DCATKIN_DEVEL_PREFIX=/home/philip/realsense_ws/devel/.private/realsense2_camera -DCMAKE_INSTALL_PREFIX=/home/philip/realsense_ws/install; cd -
...............................................................................
Failed     << realsense2_camera:cmake                [ Exited with code 1 ]    
Failed    <<< realsense2_camera                      [ 0.2 seconds ]           
_______________________________________________________________________________
Errors     << realsense2_description:check /home/philip/realsense_ws/logs/realsense2_description/build.check.001.log
CMake Error: The source directory "/home/philip/realsense_ws/src/realsense-ros/realsense2_description" does not exist.
Specify --help for usage, or press the help button on the CMake GUI.
make: *** [cmake_check_build_system] Error 1
cd /home/philip/realsense_ws/build/realsense2_description; catkin build --get-env realsense2_description | catkin env -si  /usr/bin/make cmake_check_build_system; cd -
...............................................................................
Failed     << realsense2_description:check           [ Exited with code 2 ]    
Failed    <<< realsense2_description                 [ 0.2 seconds ]           
_______________________________________________________________________________
Errors     << realsense_gazebo_plugin:make /home/philip/realsense_ws/logs/realsense_gazebo_plugin/build.make.001.log
/home/philip/realsense_ws/src/realsense-ros-gazebo/realsense_gazebo_plugin/src/RealSensePlugin.cpp: In member function ‘virtual void gazebo::RealSensePlugin::Load(gazebo::physics::ModelPtr, sdf::ElementPtr)’:
/home/philip/realsense_ws/src/realsense-ros-gazebo/realsense_gazebo_plugin/src/RealSensePlugin.cpp:183:42: error: ‘class gazebo::physics::World’ has no member named ‘Name’
   this->transportNode->Init(this->world->Name());
                                          ^
/home/philip/realsense_ws/src/realsense-ros-gazebo/realsense_gazebo_plugin/src/RealSensePlugin.cpp: In member function ‘virtual void gazebo::RealSensePlugin::OnNewFrame(gazebo::rendering::CameraPtr, gazebo::transport::PublisherPtr)’:
/home/philip/realsense_ws/src/realsense-ros-gazebo/realsense_gazebo_plugin/src/RealSensePlugin.cpp:221:46: error: ‘class gazebo::physics::World’ has no member named ‘SimTime’
   msgs::Set(msg.mutable_time(), this->world->SimTime());
                                              ^
/home/philip/realsense_ws/src/realsense-ros-gazebo/realsense_gazebo_plugin/src/RealSensePlugin.cpp: In member function ‘virtual void gazebo::RealSensePlugin::OnNewDepthFrame()’:
/home/philip/realsense_ws/src/realsense-ros-gazebo/realsense_gazebo_plugin/src/RealSensePlugin.cpp:265:46: error: ‘class gazebo::physics::World’ has no member named ‘SimTime’
   msgs::Set(msg.mutable_time(), this->world->SimTime());
                                              ^
/home/philip/realsense_ws/src/realsense-ros-gazebo/realsense_gazebo_plugin/src/gazebo_ros_realsense.cpp: In member function ‘virtual void gazebo::GazeboRosRealsense::OnNewFrame(gazebo::rendering::CameraPtr, gazebo::transport::PublisherPtr)’:
/home/philip/realsense_ws/src/realsense-ros-gazebo/realsense_gazebo_plugin/src/gazebo_ros_realsense.cpp:65:44: error: ‘class gazebo::physics::World’ has no member named ‘SimTime’
   common::Time current_time = this->world->SimTime();
                                            ^
/home/philip/realsense_ws/src/realsense-ros-gazebo/realsense_gazebo_plugin/src/gazebo_ros_realsense.cpp: In member function ‘virtual void gazebo::GazeboRosRealsense::OnNewDepthFrame()’:
/home/philip/realsense_ws/src/realsense-ros-gazebo/realsense_gazebo_plugin/src/gazebo_ros_realsense.cpp:212:44: error: ‘class gazebo::physics::World’ has no member named ‘SimTime’
   common::Time current_time = this->world->SimTime();
                                            ^
make[2]: *** [CMakeFiles/realsense_gazebo_plugin.dir/src/RealSensePlugin.cpp.o] Error 1
make[2]: *** Waiting for unfinished jobs....
make[2]: *** [CMakeFiles/realsense_gazebo_plugin.dir/src/gazebo_ros_realsense.cpp.o] Error 1
make[1]: *** [CMakeFiles/realsense_gazebo_plugin.dir/all] Error 2
make: *** [all] Error 2
cd /home/philip/realsense_ws/build/realsense_gazebo_plugin; catkin build --get-env realsense_gazebo_plugin | catkin env -si  /usr/bin/make --jobserver-fds=6,7 -j; cd -
...............................................................................
Failed     << realsense_gazebo_plugin:make           [ Exited with code 2 ]    
Failed    <<< realsense_gazebo_plugin                [ 24.1 seconds ]          
[build] Summary: 0 of 3 packages succeeded.                                    
[build]   Ignored:   None.                                                     
[build]   Warnings:  None.                                                     
[build]   Abandoned: None.                                                     
[build]   Failed:    3 packages failed.                                        
[build] Runtime: 24.2 seconds total.    
rickstaa commented 1 year ago

@PhilipAmadasun, sorry for not responding. Your issue got lost in my GitHub notifications. I tried the steps in the documentation on Ubuntu 20.04 and everything seems to work:

  1. Clone the repository in a catkin workspace under the src folder:
mkdir ~/catkin_ws
cd ~/catkin_ws
git clone --recurse-submodules https://github.com/rickstaa/realsense-ros-gazebo.git src
  1. Build the workspace using catkin_make or catkin build.

I will close this for now. Feel free to comment below if you still have any problems.