[ros-users] Enabling double precision and finding libraries in ODE

Soo-Hyun Yoo yoos117 at gmail.com
Tue Aug 17 01:21:41 UTC 2010


Awesome, robot_sim built successfully. Here are the steps taken, for
reference:

*opende/manifest.xml:*
-ldrawstuff added to lflags

*opende/Makefile.ode.tarball:*
--disable-demos switched to --enable-demos
--enable-double-precision uncommented

*opende/build/opende_1730_patched_with_damping/drawstuff/src/.libs/libdrawstuff.a
*copied to *opende/opende/lib/*
*
*
*opende/build/opende_1730_patched_with_damping/include/drawstuff *copied to
*opende/opende/include/*

Final CMakeLists.txt for atrias_sim attached.

Thanks again, everyone, for your help!

Soo-Hyun Yoo

On Mon, Aug 16, 2010 at 4:52 PM, John Hsu <johnhsu at willowgarage.com> wrote:

> Hi Soo-Hyun,
>
>
> On Mon, Aug 16, 2010 at 4:32 PM, Soo-Hyun Yoo <yoos117 at gmail.com> wrote:
>
>> Hi John,
>>
>> We used ODE in our non-ROS code by having the following in our Makefile: "-I
>> ${ODE_PATH}include/ -l ode -L ${ODE_PATH}drawstuff/src/.libs/ -l drawstuff
>> ".
>>
>> It may or may not be helpful for you to know that robot_sim.h has
>> "#include <drawstuff/drawstuff.h>" explicitly stated. Is this correct usage?
>> To remove Make's complaint that it could not find the header file, I copied
>> drawstuff.h and version.h to /path/to/opende/opende/include/drawstuff. Is
>> this what you meant by "installing them into the ros install directories
>> (opende/opende/*)" ?
>>
>
> yes, installing includes under opende/opende/include/drawstuff and
> libdrawstuff.* under opende/opende/lib
>
>
>>
>> Sorry, I missed one more flag,  *--disable-demos *should be replaced by *
>>> --enable-demos* in order for drawstuff library to be built.  It seems
>>> the two error logs you've sent are both failing at finding the drawstuff
>>> library, the above change should fix it (but again, you'll have to trigger a
>>> re-configure in opende by make clean or equivalent).
>>>
>>
>> I flipped that flag to --enable-demos as you described and saw that
>> libdrawstuff.la was built in
>> build/opende_1730_patched_with_damping/drawstuff/src/. However, even
>> after a full recompilation of opende, Make complains: "/usr/bin/ld:
>> cannot find -ldrawstuff". I have attached the output log.
>>
>> Also, the output of /path/to/opende/opende/bin/ode-config is the
>> following:
>>
>> -I/home/yoos/devel/ros/stacks/physics_ode/opende/opende/include -DdDOUBLE
>> -Wl,-rpath,/home/yoos/devel/ros/stacks/physics_ode/opende/opende/lib
>> -L/home/yoos/devel/ros/stacks/physics_ode/opende/opende/lib -lode
>>
>>
>> Shouldn't -ldrawstuff be in there somewhere?
>>
>
> you're right, ode-config needs additional modifications for this to work
> without the above exporting step.  Alternatively, you could use the flags
> exported by rospack (e.g. rospack cflags-only-I opende, etc.) if you've made
> the modifications to the opende manifest.xml as I suggested in the earlier
> email.
>
>
>>
>> Also I would like to note that drawstuff is considered to be part of ODE
>>> demo and not part of the dynamics engine library, so it's not officially
>>> exported into the ODE installation directories.  If it's extremely useful,
>>> we can consider exporting the c++ flags or simply installing them into the
>>> ros install directories (opende/opende/*) by default as well.  Please ticket
>>> me on it.
>>>
>>
>> I apologize for my lack of insight into our code, but I do not know what
>> drawstuff is actually used for in robot_sim, as I did not write it. I will,
>> however, look into it, and if it seems useful enough, submit a ticket.
>>
>
> great!  I'll wait to add these changes.
>
>
>>
>> As Brian mentioned, there's no plans to customize builds for  3rd party
>>> packages under ROS for now.   Would it be sufficient to make ODE compile
>>> with double precision by default?  I've been meaning to switch it over as
>>> the gains at keeping things float on most modern computers are less
>>> significant.  As for drawstuff, if its a dependency of atrias_sim, I can
>>> enable the demos build by default as well.  Please see changes in r31755.
>>> If there are no objections, the changes should be included in the next
>>> physics_ode release.
>>
>>
>> It would indeed be nice if double precision and the demos were enabled by
>> default---thank you!
>>
>
> changes in trunk awaiting release.
>
> thanks.
> John
>
>
>>
>> Soo-Hyun Yoo
>>
>> _______________________________________________
>> ros-users mailing list
>> ros-users at code.ros.org
>> https://code.ros.org/mailman/listinfo/ros-users
>>
>>
>
> _______________________________________________
> ros-users mailing list
> ros-users at code.ros.org
> https://code.ros.org/mailman/listinfo/ros-users
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.ros.org/pipermail/ros-users/attachments/20100816/f5023cca/attachment-0003.html>
-------------- next part --------------
cmake_minimum_required(VERSION 2.4.6)
include($ENV{ROS_ROOT}/core/rosbuild/rosbuild.cmake)

project(atrias_sim)

# Set the build type.  Options are:
#  Coverage       : w/ debug symbols, w/o optimization, w/ code-coverage
#  Debug          : w/ debug symbols, w/o optimization
#  Release        : w/o debug symbols, w/ optimization
#  RelWithDebInfo : w/ debug symbols, w/ optimization
#  MinSizeRel     : w/o debug symbols, w/ optimization, stripped binaries
#set(ROS_BUILD_TYPE RelWithDebInfo)

rosbuild_init()

#set the default path for built executables to the "bin" directory
set(EXECUTABLE_OUTPUT_PATH ${PROJECT_SOURCE_DIR}/bin)
#set the default path for built libraries to the "lib" directory
set(LIBRARY_OUTPUT_PATH ${PROJECT_SOURCE_DIR}/lib)

#uncomment if you have defined messages
#rosbuild_genmsg()
#uncomment if you have defined services
#rosbuild_gensrv()

#common commands for building c++ executables and libraries
#rosbuild_add_library(${PROJECT_NAME} src/example.cpp)
#target_link_libraries(${PROJECT_NAME} another_library)
#rosbuild_add_boost_directories()
#rosbuild_link_boost(${PROJECT_NAME} thread)
#rosbuild_add_executable(example examples/example.cpp)
#target_link_libraries(example ${PROJECT_NAME})


find_package(OpenGL)
if(OPENGL_FOUND)
    include_directories(${OPENGL_INCLUDE_DIR})
else(OPENGL_FOUND)
    message(FATAL_ERROR "OPENGL not found.")
endif(OPENGL_FOUND)


set(SIM_LIB
    src/communication.h
    src/config.h
    src/robot_sim.h
    src/robot_sim.cpp
    src/sem.h
    src/sem.cpp
    src/shared_vals.h
    src/shm.h
    src/shm.cpp
    src/sim_log.h
    src/sim_log.cpp
    src/sim_vis.h
    src/sim_vis.cpp
    src/texturepath.h
    src/vals.h)

rosbuild_add_library(${PROJECT_NAME} ${SIM_LIB})
rosbuild_add_executable(robot_sim src/robot_sim.cpp)
target_link_libraries(robot_sim ${PROJECT_NAME})
target_link_libraries(robot_sim m rt ${OPENGL_LIBRARIES})


More information about the ros-users mailing list