<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
On 4/22/10 8:19 PM, Patrick Mihelich wrote:<br>
<blockquote
cite="mid:m2y62051ad91004221819kbd2f12b7kd02558a2d4bf4a27@mail.gmail.com"
type="cite">What is the type of the data in your cvMat? I assume it's
either float or double?<br>
</blockquote>
I probably should have included the line where the cvMat was declared.<br>
CvMat _h = cvMat(3, 3, CV_64F, h);
<blockquote
cite="mid:m2y62051ad91004221819kbd2f12b7kd02558a2d4bf4a27@mail.gmail.com"
type="cite"><br>
Are the publisher and subscriber on the same machine?<br>
</blockquote>
They are<br>
<blockquote
cite="mid:m2y62051ad91004221819kbd2f12b7kd02558a2d4bf4a27@mail.gmail.com"
type="cite"><br>
I suspect you meant h_m.mat[j*3+k], but that doesn't explain the
totally wrong numbers.<br>
<br>
Right before your publish() call, can you print out the contents of
h_m.mat and check that they're correct.<br>
</blockquote>
If I print out the numbers before publishing, they are indeed correct.
<blockquote
cite="mid:m2y62051ad91004221819kbd2f12b7kd02558a2d4bf4a27@mail.gmail.com"
type="cite"><br>
As an aside, the new <a moz-do-not-send="true"
href="http://opencv.willowgarage.com/documentation/cpp/introduction.html">C++
interface</a> to OpenCV is a big improvement over cvMat/IplImage if you
like niceties like type safety, automatic freeing of memory and more
succinct code.<br>
</blockquote>
Awesome, I didn't know about that!<br>
<blockquote
cite="mid:m2y62051ad91004221819kbd2f12b7kd02558a2d4bf4a27@mail.gmail.com"
type="cite"><br>
-Patrick<br>
<br>
<div class="gmail_quote">On Thu, Apr 22, 2010 at 5:52 PM, Dan
Lazewatsky <span dir="ltr"><<a moz-do-not-send="true"
href="mailto:lazewatskyd@cse.wustl.edu">lazewatskyd@cse.wustl.edu</a>></span>
wrote:<br>
<blockquote class="gmail_quote"
style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">Hi
all -<br>
I have a cvMat that I'm trying to send out in a ROS message, but I'm<br>
having some issues getting it to work right.<br>
<br>
My message definition is: float64[9] mat<br>
I'm loading data into the message as follows:<br>
myMessage h_m;<br>
for(int j=0; j<3;++j){<br>
for(int k=0; k<3; ++k){<br>
h_m.mat[j+k*3] = cvmGet(&_h, j, k);<br>
}<br>
}<br>
<br>
No errors here, but when I look at the data from a subscriber (or using<br>
rostopic echo), but numbers are wrong. Numbers that should be in the<br>
range of 0-10 end up in 10^6-10^-5. I've tried creating a<br>
std_msgs::Float64 and casting to a Float64 first, neither of which<br>
worked. I'm at a bit of a loss as to what's going on. Any help would be<br>
appreciated.<br>
<br>
Thanks,<br>
-Dan<br>
_______________________________________________<br>
ros-users mailing list<br>
<a moz-do-not-send="true" href="mailto:ros-users@code.ros.org">ros-users@code.ros.org</a><br>
<a moz-do-not-send="true"
href="https://code.ros.org/mailman/listinfo/ros-users" target="_blank">https://code.ros.org/mailman/listinfo/ros-users</a><br>
</blockquote>
</div>
<br>
<pre wrap="">
<fieldset class="mimeAttachmentHeader"></fieldset>
_______________________________________________
ros-users mailing list
<a class="moz-txt-link-abbreviated" href="mailto:ros-users@code.ros.org">ros-users@code.ros.org</a>
<a class="moz-txt-link-freetext" href="https://code.ros.org/mailman/listinfo/ros-users">https://code.ros.org/mailman/listinfo/ros-users</a>
</pre>
</blockquote>
</body>
</html>