Re: [ros-users] Inserting data in a tfMessage

Top Page
Attachments:
Message as email
+ (text/plain)
Delete this message
Reply to this message
Author: Wim Meeussen
Date:  
To: ros-users
Subject: Re: [ros-users] Inserting data in a tfMessage
Steven,

In C++ an array in a message behaves just like a std::vector. So you
can do something like this:

TfMessage msg;
msg.transforms.resize(10);
msg.transforms[0].translation.x = 5;

Wim



On Fri, Aug 27, 2010 at 8:51 AM, Steven Bellens
<> wrote:
> Hi,
>
> I'd like to use the tfMessage - defined in the tf package. It contains
> an array of geometry_msgs/TransformStamped elements.
> How do I fill this in C++?
> I tried to make a new tf::tfMessage tfFrames, but I'm stuck on
> accessing the elements. I was wondering whether someone can provide me
> an example on how to work with messages containing arrays?
> The ROS wiki says I have to use the uint32 prefix and std::vector but
> I don't see how to do this.
>
> Steven
> _______________________________________________
> ros-users mailing list
>
> https://code.ros.org/mailman/listinfo/ros-users
>




--
--
Wim Meeussen
Willow Garage Inc.
<http://www.willowgarage.com)