[ros-users] Mutil-dimension-array
Josh Faust
jfaust at willowgarage.com
Wed Dec 29 04:13:11 UTC 2010
res.trajectory.resize(1);
On Tue, Dec 28, 2010 at 7:33 PM, Paul Heran Yang <heranyang at gmail.com>wrote:
> Hi all,
>
> When I tried to create a 2-dim array with ROS's srv, I had
> some troubles with the server side.
>
> from file "srv/Joints.srv":
> float32[] joints
>
> from file "srv/ImportPC.srv":
> float32[] jts
> ---
> Joints[] trajectory
>
> In server.cpp, I tried to push_back a new Joints to trajectory like this:
> res.trajectory[0].joints.push_back(sum);
>
> It compiles, but of course at runtime it fails because trajectory[0]
> doesn't exist.
>
> So I tried something like this:
> import_pc::Joints_<std::allocator<void> Jts ();
> Jts.joints.push_back(sum);
> res.trajectory.push_back(Jts);
>
> However the template for import_pc::Joints_ is not correct. Any suggestion
> would be really appreciated.
>
> Thank you so much,
> Paul
>
>
>
> ------------------------------------------------------------------------------
> Learn how Oracle Real Application Clusters (RAC) One Node allows customers
> to consolidate database storage, standardize their database environment,
> and,
> should the need arise, upgrade to a full multi-node Oracle RAC database
> without downtime or disruption
> http://p.sf.net/sfu/oracle-sfdevnl
> _______________________________________________
> ros-users mailing list
> ros-users at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/ros-users
>
> _______________________________________________
> ros-users mailing list
> ros-users at code.ros.org
> https://code.ros.org/mailman/listinfo/ros-users
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.ros.org/pipermail/ros-users/attachments/20101228/cd2e3da9/attachment-0003.html>
More information about the ros-users
mailing list