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

Does ros_vrpn_client use a left handed coordinate system?

asked 2012-04-11 08:10:54 -0500

Dustin gravatar image

updated 2014-01-28 17:11:56 -0500

ngrennan gravatar image

I'm using the NaturalPoint OptiTrack motion capture system and the ros_vrpn_client to get the position of an object. I am using code that is functionally equivalent to the example below. However the values that are being printed imply a left handed coordinate system. Can anyone confirm whether this is accurate?

tf::StampedTransform trackable;
btVector3 diff;
while (true) {
  tf_listener.waitForTransform("/trackable", "/optitrak", ros::Time(0),ros::Duration(2));
  tf_listener.lookupTransform("/trackable", "/optitrak",  ros::Time(0), trackable);   

  std::cout << "transform: " << trackable.child_frame_id_ << "\t" << trackable.frame_id_ << "\t" << trackable.stamp_ << std::endl;

  diff = trackable.getOrigin();

  std::cout << "Origin: " << std::endl;
  std::cout << "\tx: " << diff.getX() << std::endl;
  std::cout << "\ty: " << diff.getY() << std::endl;
  std::cout << "\tz: " << diff.getZ() << std::endl;
}
edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2012-04-11 08:45:01 -0500

Dustin gravatar image

updated 2012-04-11 08:46:21 -0500

It turns out ros_vrpn_node and the NaturalPoint OptiTrack system use a right handed coordinate system. My apologies, I am still learning how ROS transformations work. It turns out I had the parent and child frames backwards. The waitForTransform and loopkupTransform calls should be as follows:

tf_listener.waitForTransform("/trackable", "/optitrak", ros::Time(0),ros::Duration(2));
tf_listener.lookupTransform("/trackable", "/optitrak",  ros::Time(0), trackable);
edit flag offensive delete link more

Question Tools

Stats

Asked: 2012-04-11 08:10:54 -0500

Seen: 457 times

Last updated: Apr 11 '12