osrf / handsim

HAPTIX Simulation Utlities
2 stars 1 forks source link

building ServerFixture outside of Gazebo #80

Open osrf-migration opened 9 years ago

osrf-migration commented 9 years ago

Original report (archived issue) by John Hsu (Bitbucket: hsu, GitHub: hsu).


see branch reduce_torque_limits_debug_test

building yields error during linking:

Linking CXX executable INTEGRATION_physics
cd /home/hsu/projects/haptix/handsim/build_release/test/integration && /usr/bin/cmake -E cmake_link_script CMakeFiles/INTEGRATION_physics.dir/link.txt --verbose=1
/usr/bin/c++    -s -O3 -DNDEBUG -msse4.2 -msse4.1 -mssse3 -msse3 -mfpmath=sse -msse -msse2  -std=c++11 -Wall -Wextra -Wno-long-long -Wno-unused-value -Wno-unused-value -Wno-unused-value -Wno-unused-value -Wfloat-equal -Wshadow -Winit-self -Wswitch-default -Wmissing-include-dirs -pedantic  -s -O3 -DNDEBUG -msse4.2 -msse4.1 -mssse3 -msse3 -mfpmath=sse -msse -msse2     CMakeFiles/INTEGRATION_physics.dir/physics.cc.o  -o INTEGRATION_physics  -L/home/hsu/projects/haptix/handsim/build_release/test  -L/home/hsu/projects/haptix/handsim/build_release/src  -L/home/hsu/projects/haptix/gazebo_haptix/install_release/lib/x86_64-linux-gnu/gazebo-6.0/plugins -rdynamic -Wl,-Bstatic -lgtest -lgtest_main -Wl,-Bdynamic -lpthread ../libserver_fixture.a ../../src/libHaptixTracking.so -lboost_system -lignition-transport -lprotobuf -lpthread -lhaptix-comm -Wl,-Bstatic -lhaptix-msgs -Wl,-Bdynamic -lgazebo -lgazebo_common -lgazebo_gimpact -lgazebo_gui -lgazebo_gui_building -lgazebo_gui_viewers -lgazebo_math -lgazebo_msgs -lgazebo_ode -lgazebo_opcode -lgazebo_opende_ou -lgazebo_physics -lgazebo_physics_ode -lgazebo_rendering -lgazebo_selection_buffer -lgazebo_sensors -lgazebo_skyx -lgazebo_transport -lgazebo_util -lgazebo_player -lgazebo_physics_bullet -lgazebo_rendering_deferred -lprotobuf -lpthread -lsdformat -lOgreMain -lOgreTerrain -lOgrePaging -lboost_system -lboost_thread -lboost_filesystem -lusb-1.0 -lignition-transport -lgazebo -lgazebo_common -lgazebo_gimpact -lgazebo_gui -lgazebo_gui_building -lgazebo_gui_viewers -lgazebo_math -lgazebo_msgs -lgazebo_ode -lgazebo_opcode -lgazebo_opende_ou -lgazebo_physics -lgazebo_physics_ode -lgazebo_rendering -lgazebo_selection_buffer -lgazebo_sensors -lgazebo_skyx -lgazebo_transport -lgazebo_util -lgazebo_player -lgazebo_physics_bullet -lgazebo_rendering_deferred -lprotobuf -lpthread -lprotobuf -lpthread -lsdformat -lOgreMain -lOgreTerrain -lOgrePaging -Wl,-rpath,/home/hsu/projects/haptix/handsim/build_release/test:/home/hsu/projects/haptix/handsim/build_release/src:/home/hsu/projects/haptix/gazebo_haptix/install_release/lib/x86_64-linux-gnu/gazebo-6.0/plugins 
/home/hsu/projects/haptix/gazebo_haptix/install_release/lib/x86_64-linux-gnu/libgazebo_physics.so: undefined reference to `gazebo::sensors::SensorManager::~SensorManager()'
/home/hsu/projects/haptix/gazebo_haptix/install_release/lib/x86_64-linux-gnu/libgazebo_physics.so: undefined reference to `gazebo::sensors::get_sensor(std::string const&)'
/home/hsu/projects/haptix/gazebo_haptix/install_release/lib/x86_64-linux-gnu/libgazebo_physics.so: undefined reference to `gazebo::sensors::Sensor::FillMsg(gazebo::msgs::Sensor&)'
/home/hsu/projects/haptix/gazebo_haptix/install_release/lib/x86_64-linux-gnu/libgazebo_physics.so: undefined reference to `gazebo::sensors::SensorManager::SensorManager()'
/home/hsu/projects/haptix/gazebo_haptix/install_release/lib/x86_64-linux-gnu/libgazebo_physics.so: undefined reference to `gazebo::sensors::create_sensor(boost::shared_ptr<sdf::Element>, std::string const&, std::string const&, unsigned int)'
/home/hsu/projects/haptix/gazebo_haptix/install_release/lib/x86_64-linux-gnu/libgazebo_physics.so: undefined reference to `gazebo::sensors::SensorManager::ResetLastUpdateTimes()'
/home/hsu/projects/haptix/gazebo_haptix/install_release/lib/x86_64-linux-gnu/libgazebo_physics.so: undefined reference to `gazebo::sensors::remove_sensor(std::string const&)'
/home/hsu/projects/haptix/gazebo_haptix/install_release/lib/x86_64-linux-gnu/libgazebo_physics.so: undefined reference to `gazebo::sensors::SensorManager::SensorsInitialized()'
collect2: error: ld returned 1 exit status
make[2]: *** [test/integration/INTEGRATION_physics] Error 1
make[2]: Leaving directory `/home/hsu/projects/haptix/handsim/build_release'
make[1]: *** [test/integration/CMakeFiles/INTEGRATION_physics.dir/all] Error 2
make[1]: Leaving directory `/home/hsu/projects/haptix/handsim/build_release'
make: *** [all] Error 2

this can be circumvented by compiling tests directly against ServerFixture.cc (see reduce_torque_limits_debug_test_temp_fix branch), but it would be nice to figure out why linking against libserver_fixture.a fails to work.

osrf-migration commented 9 years ago

Original comment by John Hsu (Bitbucket: hsu, GitHub: hsu).


osrf-migration commented 9 years ago

Original comment by Jackie K (Bitbucket: jacquelinekay).


This was ticketed in Gazebo as issue 1559

osrf-migration commented 9 years ago

Original comment by Jackie K (Bitbucket: jacquelinekay).


osrf-migration commented 9 years ago

Original comment by Jackie K (Bitbucket: jacquelinekay).


osrf-migration commented 9 years ago

Original comment by Jackie K (Bitbucket: jacquelinekay).


PR 107 has a workaround

osrf-migration commented 9 years ago

Original comment by John Hsu (Bitbucket: hsu, GitHub: hsu).


very similar approaches, fwiw, by adding following lines,

diff -r b0117d214d81449ccb034089468c38c9037b5ae5 cmake/TestUtils.cmake
--- a/cmake/TestUtils.cmake Mon Apr 13 16:54:12 2015 -0700
+++ b/cmake/TestUtils.cmake Mon Apr 13 17:15:37 2015 -0700
@@ -24,6 +24,8 @@
       pthread
       HaptixTracking
       ${CMAKE_BINARY_DIR}/test/libserver_fixture.a
+      gazebo_physics
+      gazebo_sensors
       ${Boost_FILESYSTEM_LIBRARIES}
       ${Boost_SYSTEM_LIBRARIES}
       ${GAZEBO_LIBRARIES}

I got reduce_torque_limits_debug_test branch to compile as well. The reason is somewhat interesting though. In my original broken approach, if you take a look at ${GAZEBO_LIBRARIES}, it is expanded to something like below:

[install prefix]/lib/x86_64-linux-gnu/libgazebo.so
[install prefix]/lib/x86_64-linux-gnu/libgazebo_common.so
[install prefix]/lib/x86_64-linux-gnu/libgazebo_gimpact.so
[install prefix]/lib/x86_64-linux-gnu/libgazebo_gui.so
[install prefix]/lib/x86_64-linux-gnu/libgazebo_gui_building.so
[install prefix]/lib/x86_64-linux-gnu/libgazebo_gui_viewers.so
[install prefix]/lib/x86_64-linux-gnu/libgazebo_math.so
[install prefix]/lib/x86_64-linux-gnu/libgazebo_msgs.so
[install prefix]/lib/x86_64-linux-gnu/libgazebo_ode.so
[install prefix]/lib/x86_64-linux-gnu/libgazebo_opcode.so
[install prefix]/lib/x86_64-linux-gnu/libgazebo_opende_ou.so
[install prefix]/lib/x86_64-linux-gnu/libgazebo_physics.so
[install prefix]/lib/x86_64-linux-gnu/libgazebo_physics_ode.so
[install prefix]/lib/x86_64-linux-gnu/libgazebo_rendering.so
[install prefix]/lib/x86_64-linux-gnu/libgazebo_selection_buffer.so
[install prefix]/lib/x86_64-linux-gnu/libgazebo_sensors.so
[install prefix]/lib/x86_64-linux-gnu/libgazebo_skyx.so
[install prefix]/lib/x86_64-linux-gnu/libgazebo_transport.so
[install prefix]/lib/x86_64-linux-gnu/libgazebo_util.so
[install prefix]/lib/x86_64-linux-gnu/libgazebo_player.so
[install prefix]/lib/x86_64-linux-gnu/libgazebo_physics_bullet.so
[install prefix]/lib/x86_64-linux-gnu/libgazebo_rendering_deferred.so
optimized
/usr/lib/x86_64-linux-gnu/libprotobuf.so
debug
/usr/lib/x86_64-linux-gnu/libprotobuf.so
-lpthread
[install_prefix]/lib/x86_64-linux-gnu/libsdformat.so
optimized
/usr/lib/x86_64-linux-gnu/libOgreMain.so
debug
/usr/lib/x86_64-linux-gnu/libOgreMain.so
optimized
/usr/lib/x86_64-linux-gnu/libOgreTerrain.so
debug
/usr/lib/x86_64-linux-gnu/libOgreTerrain.so
optimized
/usr/lib/x86_64-linux-gnu/libOgrePaging.so
debug
/usr/lib/x86_64-linux-gnu/libOgrePaging.so

and the problem is the very first line:

[install prefix]/lib/x86_64-linux-gnu/libgazebo.so

commenting it out will remove this error.

@_jrivero_

maybe we should construct ${GAZEBO_LIBRARIES} so that libgazebo.so is at the end of the list?

@gerkey thought you might want to know why this was not working :)

osrf-migration commented 9 years ago

Original comment by John Hsu (Bitbucket: hsu, GitHub: hsu).


created issue on gazebo issue tracker

osrf-migration commented 9 years ago

Original comment by Jose Luis Rivero (Bitbucket: Jose Luis Rivero, GitHub: j-rivero).


Interesting. Yes, we need to fix this problem.

Thanks for creating the issue in the Gazebo issue tracker John.

osrf-migration commented 9 years ago

Original comment by Jackie K (Bitbucket: jacquelinekay).


osrf-migration commented 9 years ago

Original comment by Jose Luis Rivero (Bitbucket: Jose Luis Rivero, GitHub: j-rivero).


Gazebo pull request #1666 partially address part of this problem although the real problem is the one described in gazebo issue 1516

osrf-migration commented 9 years ago

Original comment by Jackie K (Bitbucket: jacquelinekay).


I'm keeping this issue alive and downgrading the priority until gazebo issue 1516 is fixed.

osrf-migration commented 9 years ago

Original comment by Jackie K (Bitbucket: jacquelinekay).


Need to fix linking against physics and sensor once gazebo issue 1516 is resolved.