Ask Your Question
0

Filling geometry_msgs/Pose2D[] message

asked 2012-06-18 06:20:05 -0600

mapa17 gravatar image

updated 2014-01-28 17:12:42 -0600

ngrennan gravatar image

Hello,

i am failing to fill a ros message and google serves me no good.

The message is of the following format

Header header
string child_frame_id
geometry_msgs/Pose2D[] pose

Maybe i lack the needes C++ skills, but i just dont understand the automatic created class for this message. How do i fill Pose2D elements to a new message?

I tried something like the following without success:

pedestrianSim::pedestrians msg;
geometry_msgs::Pose2D_ singlePos;
singlePos.x = x;
singlePos.y = y;
singlePos.theta = omega;
msg.pose.push_back( singlePos );

Thank you for your help!

Regards, Manuel

edit retag flag offensive close merge delete

2 Answers

Sort by ยป oldest newest most voted
3

answered 2012-06-18 06:42:56 -0600

joq gravatar image

It would help to see your error messages.

Looking at what information you did provide, I suggest leaving off the trailing '_' from the message type name:

geometry_msgs::Pose2D singlePos;
edit flag offensive delete link more
0

answered 2012-06-19 01:56:03 -0600

mapa17 gravatar image

Hello,

thank you, you where right. Removing the trailing underscore was enough! I thought i was completely of track and only posted the code as an example.

Thank you!

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

Stats

Asked: 2012-06-18 06:20:05 -0600

Seen: 2,472 times

Last updated: Jun 19 '12