reading xyz form tf/tfMessage
hello, I am trying to read xyz from tfMessage which publishes the kinect's translation from the pi_tracker or the openni_launch and i want it sent to tum_simulator..
where is the code
geometry_msgs::Twist command;
ros::Publisher pub_takeoff, pub_land, pub_toggle_state, pub_vel;
geometry_msgs::TransformStamped transforms;
geometry_msgs::Transform transform;
geometry_msgs::Vector3 translation;
using namespace ros;
void chatterCallback(const tf::tfMessage::ConstPtr& mes)
{
//command.linear=mes;
command.linear.x = mes->transforms.transform.translation.x;
//command.linear.y = mes->y;
//command.linear.z = mes->z;
//command.angular.z= mes->z;
ROS_INFO("I received %f %f %f %f/n", command.linear.x, command.linear.y, command.linear.z, command.angular.z);
}
int main(int argc, char **argv) {
//init subscr node
ros::init(argc, argv, "simkin");
// Create a node handle
ros::NodeHandle n;
// Initialize the node
ros::Subscriber sub = n.subscribe("/tf", 1000, chatterCallback);
//ros::spin();
// A publisher for the movement data
Publisher pub = n.advertise<geometry_msgs::Twist>("/cmd_vel", 10);
// Drive forward at a given speed. The robot points up the x-axis.
//geometry_msgs::Twist command;
Rate rate(10);
while (ok()) {
pub.publish(command);
rate.sleep();
ros::spinOnce();
}
return 0;
}
What is the question? What goes wrong?
it doesn't work,the error is that"transform does not name a type"...I need to read the xyz from the /tf...OR I could you the pi_tracker topic /skeleton which is not so compact but is I put in chatterCallback pi_tracker::skeleton (this is the error:error: ‘pi_tracker’ does not name a type /home/ssr )
@Silimon Sorin@ngrennan Did you understand how we should do it for kinect? We get transforms of all the skeletal coordinate frames separately. Guess we should receive them separately! Please help