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

Soo-Hyun Yoo yoos117 at gmail.com
Mon Aug 16 00:19:26 UTC 2010


Hello,

I am running ROS Box Turtle on a 64-bit Arch Linux installation. We are
currently in the process of restructuring our code to run with ROS.

I am now porting over our robot simulator, which uses ODE. For several days
I have been trying to get the simulator (a package I have named "atrias_sim"
under the stack "ros_atrias") to compile using the "opende" package provided
by ROS. I am running into two problems:

   1. The 64-bit architecture requires us to use double precision math, but
   I have not found an effective way of passing "--enable-double-precision" to
   the configure script of ODE when ROS builds it.
   2. Rosmake outputs the following error when building atrias_sim: "fatal
   error: drawstuff/drawstuff.h: No such file or directory"

First, how do I customize how ROS packages are built? ODE builds
successfully in single precision, but this will be problematic later on. I
tried uncommenting "--enable-double-precision" in the "Makefile.ode.tarball"
file in the opende package directory to no effect.

Second, what is the proper way to include packages such as ODE? For
reference, I have attached some of my config files, which I modeled after
those of other packages that use opende (e.g., collision_space, gazebo, and
pr2_gazebo_plugins). What do I have to do for rosmake to automatically find
drawstuff.h? I can manually specify the include path in
/path/to/atrias_sim/CMakeLists.txt, but I hope there is a better solution,
since none of the three aforementioned packages do this.

Third, I should mention that I am new to CMake and suspect that my
CMakeLists.txt is incorrect. I get make errors the first time I build
atrias_sim but they disappear on the second build. This makes me suspect
that I am incorrectly specifying the libraries for the atrias_sim
executable. Could someone more experienced with CMake please verify this?

Thank you!

Soo-Hyun Yoo
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osuosl.org/pipermail/ros-users/attachments/20100815/627d12d3/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(GLUT)
if(GLUT_FOUND)
    include_directories(${GLUT_INCLUDE_DIR})
else(GLUT_FOUND)
    message(FATAL_ERROR "GLUT not found.")
endif(GLUT_FOUND)

#find_package(ODE)
#if(ODE_FOUND)
#    include_directories(${ODE_INCLUDE_DIR})
#else(ODE_FOUND)
#    message(FATAL_ERROR "ODE not found.")
#endif(ODE_FOUND)

include_directories(/home/yoos/devel/drlsim/ode-0.11.1/include)

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)

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)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: stack.xml
Type: text/xml
Size: 435 bytes
Desc: not available
URL: <http://lists.osuosl.org/pipermail/ros-users/attachments/20100815/627d12d3/attachment-0004.xml>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: manifest.xml
Type: text/xml
Size: 269 bytes
Desc: not available
URL: <http://lists.osuosl.org/pipermail/ros-users/attachments/20100815/627d12d3/attachment-0005.xml>


More information about the ros-users mailing list