[ros-users] Mutil-dimension-array

Paul Heran Yang heranyang at gmail.com
Wed Dec 29 03:33:58 UTC 2010


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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osuosl.org/pipermail/ros-users/attachments/20101228/682de77d/attachment-0002.html>
-------------- next part --------------
------------------------------------------------------------------------------
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
-------------- next part --------------
_______________________________________________
ros-users mailing list
ros-users at lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ros-users


More information about the ros-users mailing list