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

Revision history [back]

click to hide/show revision 1
initial version

tf::TransformListener frame_listener;

ros::Rate rate(10.0);

while (node.ok()){ tf::StampedTransform right_hand_transform; try{ frame_listener.waitForTransform("/right_hand_1", "/openni_depth_frame", ros::Time(0), ros::Duration(3.0)); frame_listener.lookupTransform("/right_hand_1", "/openni_depth_frame", ros::Time(0), right_hand_transform); } catch (tf::TransformException &ex) { ROS_ERROR("%s",ex.what()); ros::Duration(1.0).sleep(); continue; }

right_hand_x = right_hand_transform.getOrigin().x() * 10; right_hand_y = right_hand_transform.getOrigin().y() * 10; right_hand_z = right_hand_transform.getOrigin().z() * 10;

ROS_INFO_STREAM("right_hand_x: " << right_hand_x); ROS_INFO_STREAM("right_hand_y: " << right_hand_y); ROS_INFO_STREAM("right_hand_z: " << right_hand_z);

tf::TransformListener frame_listener;

 ros::Rate rate(10.0);

rate(10.0);

while (node.ok()){ tf::StampedTransform right_hand_transform; try{ frame_listener.waitForTransform("/right_hand_1", "/openni_depth_frame", ros::Time(0), ros::Duration(3.0)); frame_listener.lookupTransform("/right_hand_1", "/openni_depth_frame", ros::Time(0), right_hand_transform); } catch (tf::TransformException &ex) { ROS_ERROR("%s",ex.what()); ros::Duration(1.0).sleep(); continue; }

}

right_hand_x = right_hand_transform.getOrigin().x() * 10; right_hand_y = right_hand_transform.getOrigin().y() * 10; right_hand_z = right_hand_transform.getOrigin().z() * 10;

10;

ROS_INFO_STREAM("right_hand_x: " << right_hand_x); ROS_INFO_STREAM("right_hand_y: " << right_hand_y); ROS_INFO_STREAM("right_hand_z: " << right_hand_z);

right_hand_z);

tf::TransformListener frame_listener;.

tf::TransformListener frame_listener;

  ros::Rate rate(10.0);

  while (node.ok()){
    tf::StampedTransform right_hand_transform;
    try{
      frame_listener.waitForTransform("/right_hand_1", "/openni_depth_frame", ros::Time(0), ros::Duration(3.0));
      frame_listener.lookupTransform("/right_hand_1", "/openni_depth_frame", ros::Time(0), right_hand_transform);
    }
    catch (tf::TransformException &ex) {
      ROS_ERROR("%s",ex.what());
      ros::Duration(1.0).sleep();
      continue;
    }

  right_hand_x = right_hand_transform.getOrigin().x() * 10;
  right_hand_y = right_hand_transform.getOrigin().y() * 10;
  right_hand_z = right_hand_transform.getOrigin().z() * 10;

  ROS_INFO_STREAM("right_hand_x: " << right_hand_x);
  ROS_INFO_STREAM("right_hand_y: " << right_hand_y);
  ROS_INFO_STREAM("right_hand_z: " << right_hand_z);