Hello all, I want get joint coordinates of skeleton. I understand that I can get this information using tf listener as mentioned here. http://wiki.ros.org/tf/Tutorials/Writing%20a%20tf%20listener%20%28C%2B%2B%29
But I have problem in understanding how to mention each joint(from pi pose) in this section of code. while (node.ok()) { tf::StampedTransform transform; try{ listener.lookupTransform("/turtle2", "/turtle1", ros::Time(0), transform); }
is it possible for any one to guide me or provide an example code so that I can get all the joint coordinates.
EDIT
int main(int argc, char** argv) { ros::init(argc, argv, "my_tf_listener");
ros::NodeHandle node;
ros::service::waitForService("spawn");
ros::ServiceClient add_turtle = node.serviceClient<turtlesim::Spawn>("spawn");
turtlesim::Spawn srv;
add_turtle.call(srv);
tf::TransformListener listener;
ros::Rate rate(1.0);
while (node.ok())
{
tf::StampedTransform transform;
try
{
listener.lookupTransform("/head", "/neck","/torso",
"/left_shoulder","/left_elbow","/left_hand",
"/right_shoulder","/right_elbow","/right_hand",
"/left_hip","/left_knee","/left_foot",
"/right_hip","/right_knee","/right_foot",
ros::Time(0), transform);
}
catch (tf::TransformException &ex)
{
ROS_ERROR("%s",ex.what());
ros::Duration(1.0).sleep();
continue;
}
rate.sleep();
}
return 0;
};
I'm trying to do this, but I'm getting error during compilation.
error: no matching function for call to ‘tf::TransformListener::lookupTransform(const char [6], const char [6], const char [7], const char [15], const char [12], const char [11], const char [16], const char [13], const char [12], const char [10], const char [11], const char [11], const char [11], const char [12], const char [12], ros::Time, tf::StampedTransform&)’ ros::Time(0), transform); ^
Thanks, Regards, Prasanna
Originally posted by PKumars on ROS Answers with karma: 92 on 2016-03-28
Post score: 1