[ros-users] XmlRpcValue Array in launch file

Dejan Pangercic dejan.pangercic at gmail.com
Sun Apr 11 09:35:57 UTC 2010


Hi Bill,

according to the documentation here:
http://www.ros.org/wiki/roslaunch/XML/param, such construct is not
possible. I circumvent  that however with string cpp splitting:
<param name="pcd_name_position_param" type="string" value="1.5 0.0 0.5" />

And then in your node you'd want a simple parser:
.....
geometry_msgs::Point32 pcd_name_position_;
nh_.param ("pcd_name_position_param", pcd_name_position_param_,
std::string("1.0 1.0 1.0"));
std::istringstream iss(pcd_name_position_param_);
iss >> pcd_name_position_.x >> pcd_name_position_.y >> pcd_name_position_.z;
ROS_DEBUG("pcd_name_position_[0]: %f pcd_name_position_[1]: %f
pcd_name_position_[2]: %f;",
                   pcd_name_position_.x, pcd_name_position_.y,
pcd_name_position_.z);
......
hope this helps, D.
On Sun, Apr 11, 2010 at 10:53 AM, Bill Morris <morris at ee.ccny.cuny.edu> wrote:
> I can't find documentation anywhere for formatting an array properly in
> the launch file.
>
> This does not work
> <param name="marker_center" value="[0.0, 0.0]"/>
>
> This works
> <rosparam command="load" file="marker.yaml"/>
>
> where marker.yaml is
>
> marker_center: [0.0,0.0]
>
> Any ideas as to what I'm doing wrong?
>
> Thanks,
> -Bill
>
> _______________________________________________
> ros-users mailing list
> ros-users at code.ros.org
> https://code.ros.org/mailman/listinfo/ros-users
>



-- 
MSc. Dejan Pangercic
PhD Student/Researcher
Computer Science IX
Technische Universität München
Telephone: +49 (89) 289-17780
E-Mail: dejan.pangercic at in.tum.de
WWW: http://ias.cs.tum.edu/people/pangercic



More information about the ros-users mailing list