<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
<title></title>
</head>
<body text="#000000" bgcolor="#ffffff">
Josh,<br>
<br>
I found out what the problem is. But I do not have a solution to it
right now.<br>
<br>
#include <ros/ros.h><br>
#include <QtGui><br>
<br>
int main(int argc, char** argv)<br>
{<br>
QApplication app( argc, argv, false );<br>
<br>
ros::init(argc, argv, "params_test");<br>
<br>
ros::NodeHandle n;<br>
<br>
double a = 1.5;<br>
n.setParam( "a", a );<br>
<br>
double a_get;<br>
n.getParam( "a", a_get );<br>
<br>
ROS_INFO_STREAM( "a=" << a << " a_get=" <<
a_get );<br>
<br>
return 0;<br>
}<br>
<br>
Gives me<br>
[ INFO] [1288340780.906072159]: a=1.5 a_get=1<br>
<br>
Without QApplication it gives me<br>
[ INFO] [1288340754.462816012]: a=1.5 a_get=1.5<br>
<br>
So the problem is QApplication. I am using Ubuntu 9.04 with QT
4.5.0. I will now upgrade to Qt 4.6 hoping that this changes
something.<br>
<br>
Regards<br>
Christian<br>
<blockquote
cite="mid:AANLkTik_udKjQCVJTQ=0-0b3pXm3R-SXry6fbs2XBd8_@mail.gmail.com"
type="cite">Do you have a small test-case that fails that I could
try? We have a test-case for exactly this:
<div><br>
</div>
<div>
<div> double double_param = 0.0;</div>
<div> EXPECT_TRUE( param::get( "double", double_param ) );</div>
<div> EXPECT_DOUBLE_EQ( double_param, 10.5 );</div>
<div><br>
</div>
<div>Does the params test in test_roscpp also fail?</div>
<div><br>
</div>
<div>Josh</div>
<br>
<div class="gmail_quote">On Thu, Oct 28, 2010 at 5:09 AM,
Christian Verbeek <span dir="ltr"><<a
moz-do-not-send="true"
href="mailto:verbeek@servicerobotics.eu">verbeek@servicerobotics.eu</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;">getParam(const std::string &key,
double &d)<br>
<br>
returns only the integer part of the parameter.<br>
<br>
ros::NodeHandle nh( "~" );<br>
double dvalue;<br>
nh.getParam( "key", dvalue );<br>
<br>
dvalue=0 // in the launch file 0.2<br>
dvalue=1 // in the launch file 1.5<br>
...<br>
<br>
in /opt/ros/cturtle/ros/core/roscpp/src/libros/param.cpp<br>
I printed the XmlRpcValue and this gives me<br>
<br>
<value><double>0</double></value><br>
<value><double>1</double></value><br>
<br>
Whats going wrong? Any ideas?<br>
<br>
rosparam get key<br>
returns 0.200000000000000001 or 1.5<br>
<br>
so the values in the parameter server are correct.<br>
<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>
</div>
<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>
<pre class="moz-signature" cols="72">
</pre>
</body>
</html>