9 std::map<std::string, geometry_msgs::TransformStamped>
tf_map;
12 std::pair<std::map<std::string, geometry_msgs::TransformStamped>::iterator,
bool> ret;
13 for(
int i=0; i<msg->transforms.size(); i++){
14 geometry_msgs::TransformStamped tfs = msg->transforms[i];
15 ret =
tf_map.insert( std::map<std::string, geometry_msgs::TransformStamped>::value_type(tfs.child_frame_id, tfs) );
19 tf_map[tfs.child_frame_id] = tfs;
26 ros::init(argc, argv,
"transform_merger");
36 pnh_.
param(
"loop_hz", loop_hz, 1.0 );
42 std::vector< std::string > ignore_tf_vec;
46 pnh_.
param(
"transform_config", v, v);
50 for(
int i=0; i< ignore_v.
size(); i++){
51 ignore_tf_vec.push_back(ignore_v[i]);
60 std::map<std::string, geometry_msgs::TransformStamped>::iterator it =
tf_map.begin();
61 while( it !=
tf_map.end() )
64 std::vector< std::string >::iterator ignore_it = find( ignore_tf_vec.begin(), ignore_tf_vec.end(), it->second.child_frame_id );
65 if(ignore_it == ignore_tf_vec.end()){
66 tf_msg.transforms.push_back( it->second );
void publish(const boost::shared_ptr< M > &message) const
Subscriber subscribe(const std::string &topic, uint32_t queue_size, void(T::*fp)(M), T *obj, const TransportHints &transport_hints=TransportHints())
ROSCPP_DECL void init(int &argc, char **argv, const std::string &name, uint32_t options=0)
bool param(const std::string ¶m_name, T ¶m_val, const T &default_val) const
Publisher advertise(const std::string &topic, uint32_t queue_size, bool latch=false)
bool hasMember(const std::string &name) const
#define ROS_INFO_STREAM(args)
ROSCPP_DECL void spinOnce()