ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question

how to recompile cv_bridge w/o optimization

asked 2011-10-20 15:55:54 -0600

HZ gravatar image

Hi All,

For some particular reason, I need to step into /opt/ros/electric/stacks/vision_opencv/cv_bridge/src/cv_bridge.cpp for debugging purpose, and I want to examine the value of int source_type in the function of toCvCopy. However, when I print source_type in gdb, it says "value optimized out". So how can I re-compile & build cv_bridge without optimization, so I can examine the value of source_type?


edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2011-10-21 03:31:46 -0600

I didn't actually try this, but I believe this should be the general procedure:

First, add a directory for svn-based installs, for example

mkdir ~/ros

Next, add it to your path, by editing /opt/ros/electric/ to say

export ROS_PACKAGE_PATH=/home/<username>/ros:/opt/ros/electric/stacks

Clone the svn version of vision_opencv

cd ~/ros
svn co

Edit the CMakeLists.txt in cv_bridge to say:


Finally, compile it:

rosmake cv_bridge
edit flag offensive delete link more

Question Tools


Asked: 2011-10-20 15:55:54 -0600

Seen: 569 times

Last updated: Oct 21 '11