32 #include <geometry_msgs/TransformStamped.h> 33 #include <sensor_msgs/JointState.h> 38 #include <sys/types.h> 50 std::map<std::string, ros::Subscriber>
subs_;
53 void cbJoint(
const sensor_msgs::JointState::ConstPtr& msg)
55 for (
size_t i = 0; i < msg->name.size(); i++)
57 geometry_msgs::TransformStamped trans;
58 trans.header = msg->header;
59 trans.header.frame_id = msg->name[i] +
"_in";
60 trans.child_frame_id = msg->name[i] +
"_out";
77 int main(
int argc,
char* argv[])
79 ros::init(argc, argv,
"joint_tf_publisher");
int main(int argc, char *argv[])
tf::TransformBroadcaster tf_broadcaster_
ROSCPP_DECL void init(int &argc, char **argv, const std::string &name, uint32_t options=0)
std::map< std::string, ros::Subscriber > subs_
ROSCPP_DECL void spin(Spinner &spinner)
static geometry_msgs::Quaternion createQuaternionMsgFromYaw(double yaw)
void cbJoint(const sensor_msgs::JointState::ConstPtr &msg)
ros::Subscriber subscribe(ros::NodeHandle &nh_new, const std::string &topic_new, ros::NodeHandle &nh_old, const std::string &topic_old, uint32_t queue_size, void(T::*fp)(M) const, T *obj, const ros::TransportHints &transport_hints=ros::TransportHints())