Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[jetson_TX1] cannot build this repository #86

Open
tongtybj opened this issue Jun 16, 2016 · 19 comments
Open

[jetson_TX1] cannot build this repository #86

tongtybj opened this issue Jun 16, 2016 · 19 comments

Comments

@tongtybj
Copy link
Member

I heard from chen about the build failure:

Does anyone have any suggestions about this issue?
The options I suggest are:

  1. separate uav onboard porcessing packages from here
  2. use x86 or amd64 like brix or nuc
@cretaceous-creature
Copy link
Collaborator

Also the CPU in TX1 is too weak to run the heavy simulation in gazebo.
In my opinion, it is better to divide the packages into different part, one
is simulation related(run on other PCs), the other one doing visual
processing, planning and control which only depend on basic ros packages.

2016-06-16 4:01 GMT+00:00 趙 漠居 notifications@github.com:

I heard from chen about the build failure:

Does anyone have any suggestions about this issue?
The options I suggest are:

  1. separate uav onboard porcessing packages from here
  2. use x86 or amd64 like brix or nuc


You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
#86, or mute the thread
https://github.com/notifications/unsubscribe/AIjRmSR_nQeZF__jPoqUkYQK6QcNuy99ks5qMMqngaJpZM4I3AXA
.

@tongtybj
Copy link
Member Author

Also the CPU in TX1 is too weak to run the heavy simulation in gazebo.

We do not need to run gazbo in tx1.
Just add a flag in launch which can chose simulation hardware(laptop) or real hardware(tx1).

@cretaceous-creature
Copy link
Collaborator

Yeah, so in that case, I think we shall divide the packages.

2016-06-16 15:03 GMT+09:00 趙 漠居 notifications@github.com:

Also the CPU in TX1 is too weak to run the heavy simulation in gazebo.

We do not need to run gazbo in tx1.
Just add a flag in launch which can chose simulation hardware(laptop) or
real hardware(tx1).


You are receiving this because you commented.
Reply to this email directly, view it on GitHub
#86 (comment),
or mute the thread
https://github.com/notifications/unsubscribe/AIjRmVSkPNFE_31pSpZgQiLojdwQvc0Tks5qMOcegaJpZM4I3AXA
.

@k-okada
Copy link
Member

k-okada commented Jun 16, 2016

how about

execute_process( COMMAND uname -m COMMAND tr -d '\n' OUTPUT_VARIABLE
ARCHITECTURE )
if ( ${ARCHITECUTURE} STREQUAL "armhf" )
endif()

◉ Kei Okada

On Thu, Jun 16, 2016 at 3:10 PM, Chen notifications@github.com wrote:

Yeah, so in that case, I think we shall divide the packages.

2016-06-16 15:03 GMT+09:00 趙 漠居 notifications@github.com:

Also the CPU in TX1 is too weak to run the heavy simulation in gazebo.

We do not need to run gazbo in tx1.
Just add a flag in launch which can chose simulation hardware(laptop) or
real hardware(tx1).


You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<
https://github.com/start-jsk/jsk_mbzirc/issues/86#issuecomment-226395622>,
or mute the thread
<
https://github.com/notifications/unsubscribe/AIjRmVSkPNFE_31pSpZgQiLojdwQvc0Tks5qMOcegaJpZM4I3AXA

.


You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
#86 (comment),
or mute the thread
https://github.com/notifications/unsubscribe/AAeG3Kil3vf7Mgx96ikbXSOoR1evvBN8ks5qMOi-gaJpZM4I3AXA
.

@cretaceous-creature
Copy link
Collaborator

cretaceous-creature commented Jun 16, 2016

The problem happens in the compile, it seems jsk_mbzirc_common is not needed for TX1, and jsk_mbzirc_tasks depend on some other gazebo related packages which lead it fail to be compiled.
https://github.com/start-jsk/jsk_mbzirc/blob/master/jsk_mbzirc_tasks/package.xml#L23-L25

@k-okada
Copy link
Member

k-okada commented Jun 16, 2016

package.xml is not used int compile phase and rosdep install -r option will
ignore errors, just to escape gazebo related stuff from CMakeLists.txt

◉ Kei Okada

On Thu, Jun 16, 2016 at 4:09 PM, Chen notifications@github.com wrote:

The problem happens in the compile, it seems jsk_mbzirc_common is not
needed for TX1, and jsk_mbzirc_tasks depend on some other gazebo related
packages which lead it fail to be compiled.

https://github.com/start-jsk/jsk_mbzirc/blob/master/jsk_mbzirc_tasks/package.xml#L23-L25
http://url


You are receiving this because you commented.
Reply to this email directly, view it on GitHub
#86 (comment),
or mute the thread
https://github.com/notifications/unsubscribe/AAeG3Gk2YUh3y44MqXkeYM2USvMf8hBUks5qMPaTgaJpZM4I3AXA
.

@cretaceous-creature
Copy link
Collaborator

cretaceous-creature commented Jun 16, 2016

there is no gazebo related stuff in the CMakeLists.txt of jsk_mbzirc_tasks, but full of gazebo stuff in jsk_mbzirc_common. remove this line https://github.com/start-jsk/jsk_mbzirc/blob/master/jsk_mbzirc_tasks/package.xml#L17 will let jsk_mbzirc_tasks build.
Did you mean add a condition check in the CMakeLists of jsk_mbzirc_common or directly just dont compile the jsk_mbzirc_common package.

@k-okada
Copy link
Member

k-okada commented Jun 16, 2016

so what was the compile error message?

◉ Kei Okada

On Thu, Jun 16, 2016 at 4:26 PM, Chen notifications@github.com wrote:

there is no gazebo related stuff in the CMakeLists.txt of
jsk_mbzirc_tasks, but full of gazebo stuff in jsk_mbzirc_common. remove
this line
https://github.com/start-jsk/jsk_mbzirc/blob/master/jsk_mbzirc_tasks/package.xml#L17
will let jsk_mbzirc_tasks build.
Did you add a condition check in the CMakeLists of jsk_mbzirc_common or
directly just dont compile the jsk_mbzirc_common package.


You are receiving this because you commented.
Reply to this email directly, view it on GitHub
#86 (comment),
or mute the thread
https://github.com/notifications/unsubscribe/AAeG3P4zpx_mEVRLtXpLxWNkFVGVFdb4ks5qMPqQgaJpZM4I3AXA
.

@cretaceous-creature
Copy link
Collaborator

111

I also tried to add a condition check to remove the gazebo stuff in jsk_mbzirc_common, now it is OK now.

@k-okada
Copy link
Member

k-okada commented Jun 16, 2016

try catkin_package() at CMakeLists.txt

◉ Kei Okada

On Thu, Jun 16, 2016 at 4:42 PM, Chen notifications@github.com wrote:

[image: 111]
https://cloud.githubusercontent.com/assets/8966553/16108954/c71d2af4-3395-11e6-8bd4-c9489b746c67.png

I also tried to add a condition check to remove the gazebo stuff in
jsk_mbzirc_common, now it is OK now.


You are receiving this because you commented.
Reply to this email directly, view it on GitHub
#86 (comment),
or mute the thread
https://github.com/notifications/unsubscribe/AAeG3CB71NbFVzyRFB8oF_Ir1HVvxPePks5qMP6BgaJpZM4I3AXA
.

@cretaceous-creature
Copy link
Collaborator

Do you mean change catkin_package(CATKIN_DEPENS) to catkin_package in the CMakeLists of jsk_mbzirc_common? Seems the same problem. As I add a condition check and ignore all the gazebo related things in jsk_mbzirc_common, it compiles.

##in arm architecture, gazebo wont work
if(ISARMHF)
find_package(catkin REQUIRED COMPONENTS std_msgs geometry_msgs)
catkin_package(
CATKIN_DEPENDS
)
##in x86 architecture
else()
find_package(catkin REQUIRED COMPONENTS gazebo_ros std_msgs geometry_msgs)
...
...

@k-okada
Copy link
Member

k-okada commented Jun 16, 2016

btw, are you really

  • working on latest master branch
  • you have error only on CMakeLists.txt:16
    ??

for example, on my amd64 system and changed the source tree as

k-okada@kokada-t440s:~/catkin_ws/ws_jsk_mbzirc/src/jsk_mbzirc/jsk_mbzirc_tasks$
git diff
diff --git a/jsk_mbzirc_common/CMakeLists.txt
b/jsk_mbzirc_common/CMakeLists.txt
index 39b0d11..ce3e5d4 100644
--- a/jsk_mbzirc_common/CMakeLists.txt
+++ b/jsk_mbzirc_common/CMakeLists.txt
@@ -4,7 +4,7 @@ project(jsk_mbzirc_common)
 ## Find catkin macros and libraries
 ## if COMPONENTS list like find_package(catkin REQUIRED COMPONENTS xyz)
 ## is used, also find other catkin packages
-find_package(catkin REQUIRED COMPONENTS gazebo_ros std_msgs geometry_msgs)
+find_package(catkin REQUIRED COMPONENTS gazebo_rosa std_msgs geometry_msgs)


 # Depend on system install of Gazebo and SDFormat
diff --git a/jsk_mbzirc_common/package.xml b/jsk_mbzirc_common/package.xml
index fdfad22..5219920 100644
--- a/jsk_mbzirc_common/package.xml
+++ b/jsk_mbzirc_common/package.xml
@@ -14,11 +14,11 @@
   <buildtool_depend>catkin</buildtool_depend>

   <build_depend>geometry_msgs</build_depend>
-  <build_depend>gazebo_ros</build_depend>
+  <build_depend>gazebo_rosa</build_depend>

   <run_depend>geometry_msgs</run_depend>
   <run_depend>gazebo_plugins</run_depend>
-  <run_depend>gazebo_ros</run_depend>
+  <run_depend>gazebo_rosa</run_depend>

   <run_depend>robot_state_publisher</run_depend>
   <run_depend>fake_localization</run_depend>

we should have error like

[build] Found '20' packages in 0.0 seconds.

[build] Package table is up to date.

Starting  >>> husky_control

Starting  >>> husky_ur5_moveit_config

Starting  >>> jsk_mbzirc_common

Starting  >>> ur_description

Finished  <<< ur_description                         [ 0.6 seconds ]

Starting  >>> husky_description

Finished  <<< husky_control                          [ 0.7 seconds ]

Finished  <<< husky_ur5_moveit_config                [ 0.3 seconds ]

Finished  <<< husky_description                      [ 0.0 seconds ]

Starting  >>> husky_gazebo

____________________________________________________________________________________________________
Errors     << jsk_mbzirc_common:check
/home/k-okada/catkin_ws/ws_jsk_mbzirc/logs/jsk_mbzirc_common/build.check.004.log
CMake Warning at /opt/ros/indigo/share/catkin/cmake/catkinConfig.cmake:76
(find_package):
  Could not find a package configuration file provided by "gazebo_rosa" with
  any of the following names:

    gazebo_rosaConfig.cmake
    gazebo_rosa-config.cmake

  Add the installation prefix of "gazebo_rosa" to CMAKE_PREFIX_PATH or set
  "gazebo_rosa_DIR" to a directory containing one of the above files.  If
  "gazebo_rosa" provides a separate development package or SDK, be sure it
  has been installed.
Call Stack (most recent call first):
  CMakeLists.txt:7 (find_package)


CMake Error at /opt/ros/indigo/share/catkin/cmake/catkinConfig.cmake:83
(find_package):
  Could not find a package configuration file provided by "gazebo_rosa" with
  any of the following names:

    gazebo_rosaConfig.cmake
    gazebo_rosa-config.cmake

  Add the installation prefix of "gazebo_rosa" to CMAKE_PREFIX_PATH or set
  "gazebo_rosa_DIR" to a directory containing one of the above files.  If
  "gazebo_rosa" provides a separate development package or SDK, be sure it
  has been installed.
Call Stack (most recent call first):
  CMakeLists.txt:7 (find_package)


make: *** [cmake_check_build_system] Error 1

and if you change find_pakcage as

k-okada@kokada-t440s:~/catkin_ws/ws_jsk_mbzirc/src/jsk_mbzirc/jsk_mbzirc_tasks$
git diff
diff --git a/jsk_mbzirc_common/CMakeLists.txt
b/jsk_mbzirc_common/CMakeLists.txt
index 39b0d11..00354a5 100644
--- a/jsk_mbzirc_common/CMakeLists.txt
+++ b/jsk_mbzirc_common/CMakeLists.txt
@@ -4,7 +4,8 @@ project(jsk_mbzirc_common)
 ## Find catkin macros and libraries
 ## if COMPONENTS list like find_package(catkin REQUIRED COMPONENTS xyz)
 ## is used, also find other catkin packages
-find_package(catkin REQUIRED COMPONENTS gazebo_ros std_msgs geometry_msgs)
+#find_package(catkin REQUIRED COMPONENTS gazebo_rosa std_msgs
geometry_msgs)
+find_package(catkin REQUIRED COMPONENT_S std_msgs geometry_msgs)


 # Depend on system install of Gazebo and SDFormat

then it should be able to compile, so i think you can write code someting
like



--- a/jsk_mbzirc_common/CMakeLists.txt
+++ b/jsk_mbzirc_common/CMakeLists.txt
@@ -4,9 +4,12 @@ project(jsk_mbzirc_common)
 ## Find catkin macros and libraries
 ## if COMPONENTS list like find_package(catkin REQUIRED COMPONENTS xyz)
 ## is used, also find other catkin packages
-find_package(catkin REQUIRED COMPONENTS gazebo_ros std_msgs geometry_msgs)
-
-
+#find_package(catkin REQUIRED COMPONENTS gazebo_rosa std_msgs
geometry_msgs)
+find_package(catkin REQUIRED COMPONENTS std_msgs geometry_msgs)
+find_package(gazebo_ros QUIET)
+if(NOT gazebo_ros_FOUND)
+  message(WARNING "gazebo_ros IS NOT FOUND, so copmile ${PROJECT_NAME}
without gazebo")
+endif()
 # Depend on system install of Gazebo and SDFormat
 find_package(gazebo REQUIRED)
 find_package(Boost REQUIRED COMPONENTS thread random)
@@ -21,8 +24,10 @@ catkin_package(
 # build plugins
 include_directories(include ${Boost_INCLUDE_DIRS} ${catkin_INCLUDE_DIRS}
${GAZEBO_INCLUDE_DIRS})

+if(gazebo_ros_FOUND)
 add_library(mbzirc_gazebo_truck_plugin src/mbzirc_gazebo_truck_plugin.cpp)
 target_link_libraries(mbzirc_gazebo_truck_plugin ${GAZEBO_LIBRARIES}
${catkin_LIBRARIES} ${Boost_LIBRARIES})
+endif()

 add_library(mbzirc_gazebo_panel_plugin src/mbzirc_gazebo_panel_plugin.cpp)
 target_link_libraries(mbzirc_gazebo_panel_plugin ${GAZEBO_LIBRARIES}
${catkin_LIBRARIES} ${Boost_LIBRARIES})
@@ -33,11 +38,19 @@ target_link_libraries(mbzirc_gazebo_treasure_plugin
${GAZEBO_LIBRARIES} ${catkin
 #############
 ## Install ##
 #############
+if(gazebo_ros_FOUND)
 install(TARGETS
-  mbzirc_gazebo_truck_plugin mbzirc_gazebo_panel_plugin
mbzirc_gazebo_treasure_plugin
+  mbzirc_gazebo_truck_plugin
   DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION}
   LIBRARY DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}
   )
+else()
+install(TARGETS
+  mbzirc_gazebo_panel_plugin mbzirc_gazebo_treasure_plugin
+  DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION}
+  LIBRARY DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}
+  )
+endif()

 install(DIRECTORY launch gazebo_model
   DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION}

◉ Kei Okada

On Thu, Jun 16, 2016 at 5:00 PM, Chen notifications@github.com wrote:

Do you mean change catkin_package(CATKIN_DEPENS) to catkin_package in the
CMakeLists of jsk_mbzirc_common? Seems the same problem. As I add a
condition check and ignore all the gazebo related things in
jsk_mbzirc_common, it compiles.

##in arm architecture, gazebo wont work

if(ISARMHF)
find_package(catkin REQUIRED COMPONENTS std_msgs geometry_msgs)
catkin_package(
CATKIN_DEPENDS
)
##in x86 architecture

else()
find_package(catkin REQUIRED COMPONENTS gazebo_ros std_msgs geometry_msgs)
...
...


You are receiving this because you commented.
Reply to this email directly, view it on GitHub
#86 (comment),
or mute the thread
https://github.com/notifications/unsubscribe/AAeG3GqsD2rkcPAkiled0_TeemQXE38fks5qMQKUgaJpZM4I3AXA
.

@cretaceous-creature
Copy link
Collaborator

Yes I am using the latest master branch. and I only get 1 error

Finished <<< husky_description [ 0.1 seconds ]
Starting >>> husky_gazebo
Finished <<< husky_gazebo [ 0.1 seconds ]


Errors << jsk_mbzirc_common:check /home/ubuntu/ros/indigo/logs/jsk_mbzirc_common/build.check.004.log
CMake Error at /opt/ros/indigo/share/catkin/cmake/catkinConfig.cmake:75 (find_package):
Could not find a package configuration file provided by "gazebo_ros" with
any of the following names:

gazebo_rosConfig.cmake
gazebo_ros-config.cmake

Add the installation prefix of "gazebo_ros" to CMAKE_PREFIX_PATH or set
"gazebo_ros_DIR" to a directory containing one of the above files. If
"gazebo_ros" provides a separate development package or SDK, be sure it has
been installed.
Call Stack (most recent call first):
CMakeLists.txt:16 (find_package)

make: *** [cmake_check_build_system] Error 1
cd /home/ubuntu/ros/indigo/build/jsk_mbzirc_common; catkin build --get-env jsk_mbzirc_common | catkin env -si /usr/bin/make cmake_check_build_system; cd -
...............................................................................
Failed << jsk_mbzirc_common:check [ Exited with code 2 ]
Failed <<< jsk_mbzirc_common [ 2.1 seconds ]
Abandoned <<< jsk_mbzirc_tasks [ Unrelated job failed ]
[build] Summary: 5 of 7 packages succeeded.
[build] Ignored: 18 packages were skipped or are blacklisted.
[build] Warnings: None.
[build] Abandoned: 1 packages were abandoned.
[build] Failed: 1 packages failed.
[build] Runtime: 3.5 seconds total.

@k-okada
Copy link
Member

k-okada commented Jun 16, 2016

line 16 of CMakeLists.txt is comment, and we have catkin_package in line
17, I think ->
https://github.com/start-jsk/jsk_mbzirc/blob/master/jsk_mbzirc_common/CMakeLists.txt#L16
what is the output of
less -N ../jsk_mbzirc_common/CMakeLists.txt

◉ Kei Okada

On Thu, Jun 16, 2016 at 5:17 PM, Chen notifications@github.com wrote:

Yes I am using the latest master branch. and I only get 1 error

Finished <<< husky_description [ 0.1 seconds ]

Starting >>> husky_gazebo

Finished <<< husky_gazebo [ 0.1 seconds ]

Errors << jsk_mbzirc_common:check
/home/ubuntu/ros/indigo/logs/jsk_mbzirc_common/build.check.004.log
CMake Error at /opt/ros/indigo/share/catkin/cmake/catkinConfig.cmake:75
(find_package):
Could not find a package configuration file provided by "gazebo_ros" with
any of the following names:

gazebo_rosConfig.cmake
gazebo_ros-config.cmake

Add the installation prefix of "gazebo_ros" to CMAKE_PREFIX_PATH or set
"gazebo_ros_DIR" to a directory containing one of the above files. If
"gazebo_ros" provides a separate development package or SDK, be sure it has
been installed.
Call Stack (most recent call first):
CMakeLists.txt:16 (find_package)

make: *** [cmake_check_build_system] Error 1
cd /home/ubuntu/ros/indigo/build/jsk_mbzirc_common; catkin build --get-env
jsk_mbzirc_common | catkin env -si /usr/bin/make cmake_check_build_system;
cd -

...............................................................................
Failed << jsk_mbzirc_common:check [ Exited with code 2 ]

Failed <<< jsk_mbzirc_common [ 2.1 seconds ]

Abandoned <<< jsk_mbzirc_tasks [ Unrelated job failed ]

[build] Summary: 5 of 7 packages succeeded.

[build] Ignored: 18 packages were skipped or are blacklisted.

[build] Warnings: None.

[build] Abandoned: 1 packages were abandoned.

[build] Failed: 1 packages failed.

[build] Runtime: 3.5 seconds total.


You are receiving this because you commented.
Reply to this email directly, view it on GitHub
#86 (comment),
or mute the thread
https://github.com/notifications/unsubscribe/AAeG3CZ3FKm9BrvQxx0DmGkrGuHwy0vmks5qMQaSgaJpZM4I3AXA
.

@cretaceous-creature
Copy link
Collaborator

Ah, I got what you mean, I add the condition check in the CMakeLists file.... as I pasted above, so the line has changed...
CMakeLists.txt

@k-okada
Copy link
Member

k-okada commented Jun 16, 2016

oh, please revert everything and read
#86 (comment)
super very carefully and follow step by step

◉ Kei Okada

On Thu, Jun 16, 2016 at 5:22 PM, Chen notifications@github.com wrote:

Ah, I got what you mean, I add the condition check in the CMakeLists
file.... as I pasted above, so the line has changed...
CMakeLists.txt
https://github.com/start-jsk/jsk_mbzirc/files/317938/CMakeLists.txt


You are receiving this because you commented.
Reply to this email directly, view it on GitHub
#86 (comment),
or mute the thread
https://github.com/notifications/unsubscribe/AAeG3AZfqC3phfluhpkJzpVT1MYpbk0Mks5qMQesgaJpZM4I3AXA
.

@cretaceous-creature
Copy link
Collaborator

Ok, I revert everything and change to gazebo_rosa, then the error is:

Starting >>> husky_gazebo
Finished <<< husky_gazebo [ 0.1 seconds ]


Errors << jsk_mbzirc_common:check /home/ubuntu/ros/indigo/logs/jsk_mbzirc_common/build.check.006.log
CMake Error at /opt/ros/indigo/share/catkin/cmake/catkinConfig.cmake:75 (find_package):
Could not find a package configuration file provided by "gazebo_rosa" with
any of the following names:

gazebo_rosaConfig.cmake
gazebo_rosa-config.cmake

Add the installation prefix of "gazebo_rosa" to CMAKE_PREFIX_PATH or set
"gazebo_rosa_DIR" to a directory containing one of the above files. If
"gazebo_rosa" provides a separate development package or SDK, be sure it
has been installed.
Call Stack (most recent call first):
CMakeLists.txt:7 (find_package)

make: *** [cmake_check_build_system] Error 1
cd /home/ubuntu/ros/indigo/build/jsk_mbzirc_common; catkin build --get-env jsk_mbzirc_common | catkin env -si /usr/bin/make cmake_check_build_system; cd -
...............................................................................
Failed << jsk_mbzirc_common:check [ Exited with code 2 ]
Failed <<< jsk_mbzirc_common [ 2.5 seconds ]
Abandoned <<< jsk_mbzirc_tasks [ Unrelated job failed ]
[build] Summary: 5 of 7 packages succeeded.
[build] Ignored: 18 packages were skipped or are blacklisted.
[build] Warnings: None.
[build] Abandoned: 1 packages were abandoned.
[build] Failed: 1 packages failed.
[build] Runtime: 3.4 seconds total.

@k-okada
Copy link
Member

k-okada commented Jun 16, 2016

please read my comment #86 (comment) "CAREFULLY", the important informaitno is hidden within quatation


--- a/jsk_mbzirc_common/CMakeLists.txt
+++ b/jsk_mbzirc_common/CMakeLists.txt
@@ -4,9 +4,12 @@ project(jsk_mbzirc_common)
 ## Find catkin macros and libraries
 ## if COMPONENTS list like find_package(catkin REQUIRED COMPONENTS xyz)
 ## is used, also find other catkin packages
-find_package(catkin REQUIRED COMPONENTS gazebo_ros std_msgs geometry_msgs)
-
-
+#find_package(catkin REQUIRED COMPONENTS gazebo_rosa std_msgs
geometry_msgs)
+find_package(catkin REQUIRED COMPONENTS std_msgs geometry_msgs)
+find_package(gazebo_ros QUIET)
+if(NOT gazebo_ros_FOUND)
+  message(WARNING "gazebo_ros IS NOT FOUND, so copmile ${PROJECT_NAME}
without gazebo")
+endif()
 # Depend on system install of Gazebo and SDFormat
 find_package(gazebo REQUIRED)
 find_package(Boost REQUIRED COMPONENTS thread random)
@@ -21,8 +24,10 @@ catkin_package(
 # build plugins
 include_directories(include ${Boost_INCLUDE_DIRS} ${catkin_INCLUDE_DIRS}
${GAZEBO_INCLUDE_DIRS})

+if(gazebo_ros_FOUND)
 add_library(mbzirc_gazebo_truck_plugin src/mbzirc_gazebo_truck_plugin.cpp)
 target_link_libraries(mbzirc_gazebo_truck_plugin ${GAZEBO_LIBRARIES}
${catkin_LIBRARIES} ${Boost_LIBRARIES})
+endif()

 add_library(mbzirc_gazebo_panel_plugin src/mbzirc_gazebo_panel_plugin.cpp)
 target_link_libraries(mbzirc_gazebo_panel_plugin ${GAZEBO_LIBRARIES}
${catkin_LIBRARIES} ${Boost_LIBRARIES})
@@ -33,11 +38,19 @@ target_link_libraries(mbzirc_gazebo_treasure_plugin
${GAZEBO_LIBRARIES} ${catkin
 #############
 ## Install ##
 #############
+if(gazebo_ros_FOUND)
 install(TARGETS
-  mbzirc_gazebo_truck_plugin mbzirc_gazebo_panel_plugin
mbzirc_gazebo_treasure_plugin
+  mbzirc_gazebo_truck_plugin
   DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION}
   LIBRARY DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}
   )
+else()
+install(TARGETS
+  mbzirc_gazebo_panel_plugin mbzirc_gazebo_treasure_plugin
+  DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION}
+  LIBRARY DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}
+  )
+endif()

 install(DIRECTORY launch gazebo_model
   DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION}

@cretaceous-creature
Copy link
Collaborator

Sry for that not being careful enough to find your magic...
I think I understand what you mean now, Thank you very much.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants