Ask Your Question
0

how to publish an Eigen::Vector3f& in ROS

asked 2013-10-22 09:16:22 -0500

this post is marked as community wiki

This post is a wiki. Anyone with karma >75 is welcome to improve it.

Im using a PCL code and the information I need is in a Eigen::Vector3f&, how to i publish this information in ROS. What is the type of the publisher? Thanks

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
2

answered 2013-10-22 22:26:53 -0500

BennyRe gravatar image

updated 2013-10-29 04:19:26 -0500

You could use geometry_msgs/Vector3Stamped

$ rosmsg show geometry_msgs/Vector3Stamped 
std_msgs/Header header
  uint32 seq
  time stamp
  string frame_id
geometry_msgs/Vector3 vector
  float64 x
  float64 y
  float64 z

You can browse messages with

rosmsg list

Publishing this as a topic is good described in the publisher and subscriber tutorial: http://wiki.ros.org/ROS/Tutorials/WritingPublisherSubscriber%28c%2B%2B%29

edit flag offensive delete link more

Comments

@BennyRe how do i publish such a topic, i can manage to make it work. i have a n.advertise<std_msgs::float32> how do i change it to the vector? thanks

ctguell gravatar image ctguell  ( 2013-10-29 04:09:58 -0500 )edit

@BennyRe thanks also is there any standard array message? thanks

ctguell gravatar image ctguell  ( 2013-10-29 04:21:52 -0500 )edit

Do you mean an array of Vector3s?

BennyRe gravatar image BennyRe  ( 2013-10-29 05:16:16 -0500 )edit

@BennyRe no just a 2x1 array of floats

ctguell gravatar image ctguell  ( 2013-10-29 05:23:48 -0500 )edit

A quick look at rosmsg list shows you the message std_msgs/Float32MultiArray

BennyRe gravatar image BennyRe  ( 2013-10-29 05:27:28 -0500 )edit

Your Answer

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

Add Answer

Question Tools

1 follower

Stats

Asked: 2013-10-22 09:16:22 -0500

Seen: 1,067 times

Last updated: Oct 29 '13