ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
0

How to Subscribe vector<geometry_msgs::PoseStamped> type topic?

asked 2013-06-07 07:17:09 -0500

Mohsen Hk gravatar image

updated 2014-01-28 17:16:48 -0500

ngrennan gravatar image

hello :) i wanna publish and subscribe vector<geometry_msgs::posestamped> type topic, how can i do?

void exceptionPointsCallback(const  std::vector<geometry_msgs::PoseStamped::ConstPtr&> msg???????!!!!)

    {

        exceptions_points.clear();

        exceptions_points.swap(msg);

    }
edit retag flag offensive close merge delete

Comments

@Mohsen Hk did you manage to make this work? Im having problem accomplishing it, and would really appreciate some help

ctguell gravatar image ctguell  ( 2013-12-12 04:25:30 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted
0

answered 2013-06-07 15:49:29 -0500

updated 2013-06-07 23:21:23 -0500

Create msg file "geometry_msgs_vector.msg" in "msg" directory of ur package. In msg file write

geometry_msgs::PoseStamped [] msgs_vector

In ur code write the subscriber like this void callback(const package_name::geometry_msgs_vector::ConstPtr &msg) {

}

To access the vector use "msg.msgs_vector"

Hope this works

PS:Dont forget to include this msg header file "package_name/geometry_msgs_vector.h" and they might be some syntactical error in the code i have mentioned but the logic is correct

edit flag offensive delete link more

Comments

@ayush_dewan i cant manage to make it work could you be more specific in how can i make this work? I really appreciate your help

ctguell gravatar image ctguell  ( 2013-12-12 04:26:37 -0500 )edit

Question Tools

Stats

Asked: 2013-06-07 07:17:09 -0500

Seen: 2,722 times

Last updated: Jun 07 '13