Hi Soonhac, <br>Can you run your program in GDB and attach a backtrace?  <br><br>Tully<br><br><div class="gmail_quote">On Fri, Nov 19, 2010 at 12:49 PM, Soonhac Hong <span dir="ltr"><<a href="mailto:soonhac.hong@gmail.com">soonhac.hong@gmail.com</a>></span> wrote:<br>

<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">Hi all,<br>
<br>
I'm trying to convert sensor_msgs/Image to the opencv image. The<br>
sensor_msgs/Image is defined in the ros service as follows.<br>
<br>
<temp_srv.srv><br>
bool isColor<br>
----<br>
sensor_msgs/Image left_image<br>
<br>
<br>
The problem has happened at the following code.<br>
<br>
IplImage* left_image = bridge_.imgMsgToCv((const<br>
sensor_msgs::ImageConstPtr&) srv.response.left_image, "passthrough");<br>
<br>
Without the casting,(const sensor_msgs::ImageConstPtr&), there was an<br>
compile error. With the casting, there is a runtime error, segmentation<br>
fault. Is there anyone to know how to get the<br>
sensor_msgs::ImageConstPtr& of the sensor_msgs/Image which is defined in<br>
the ros service?<br>
<br>
I confirmed that there are the proper value of each pixel in the<br>
srv.response.left_image.data[] as well as srv.response.left_image.width<br>
and srv.response.left_image.hight.<br>
<br>
Thank you for any comments.<br>
<br>
Best,<br>
Soonhac<br>
<br>
_______________________________________________<br>
ros-users mailing list<br>
<a href="mailto:ros-users@code.ros.org">ros-users@code.ros.org</a><br>
<a href="https://code.ros.org/mailman/listinfo/ros-users" target="_blank">https://code.ros.org/mailman/listinfo/ros-users</a><br>
</blockquote></div><br><br clear="all"><br>-- <br>Tully Foote<br>Systems Engineer<br>Willow Garage, Inc.<br><a href="mailto:tfoote@willowgarage.com">tfoote@willowgarage.com</a><br>(650) 475-2827<br>