Ask Your Question

Revision history [back]

Have a look at those:

name: tf::poseStampedTFToMsg
cmd: /^static inline void poseStampedTFToMsg(const Stamped<Pose>& bt, geometry_msgs::PoseStamped & msg)$/
namespace: tf
signature: (const Stamped<Pose>& bt, geometry_msgs::PoseStamped & msg)
filename: /opt/ros/diamondback/stacks/geometry/tf/include/tf/transform_datatypes.h

name: tf::poseStampedMsgToTF
cmd: /^static inline void poseStampedMsgToTF(const geometry_msgs::PoseStamped & msg, Stamped<Pose>& bt)$/
namespace: tf
signature: (const geometry_msgs::PoseStamped & msg, Stamped<Pose>& bt)
filename: /opt/ros/diamondback/stacks/geometry/tf/include/tf/transform_datatypes.h

Have a look at those:

name: tf::poseStampedTFToMsg
cmd: /^static inline void poseStampedTFToMsg(const Stamped<Pose>& bt, geometry_msgs::PoseStamped & msg)$/
namespace: tf
signature: (const Stamped<Pose>& bt, geometry_msgs::PoseStamped & msg)
filename: /opt/ros/diamondback/stacks/geometry/tf/include/tf/transform_datatypes.h

name: tf::poseStampedMsgToTF
cmd: /^static inline void poseStampedMsgToTF(const geometry_msgs::PoseStamped & msg, Stamped<Pose>& bt)$/
namespace: tf
signature: (const geometry_msgs::PoseStamped & msg, Stamped<Pose>& bt)
filename: /opt/ros/diamondback/stacks/geometry/tf/include/tf/transform_datatypes.h

This is code I used for the inverse transformation:

  tf::Transform grasp_tf(gripperRotation, gripperRotation);
  tf::Stamped<tf::Pose> grasp_tf_pose(grasp_tf);
  geometry_msgs::PoseStamped msg;
  tf::poseStampedTFToMsg    (grasp_tf_pose, msg);

Have a look at those:

name: tf::poseStampedTFToMsg
cmd: /^static inline void poseStampedTFToMsg(const Stamped<Pose>& bt, geometry_msgs::PoseStamped & msg)$/
namespace: tf
signature: (const Stamped<Pose>& bt, geometry_msgs::PoseStamped & msg)
filename: /opt/ros/diamondback/stacks/geometry/tf/include/tf/transform_datatypes.h

name: tf::poseStampedMsgToTF
cmd: /^static inline void poseStampedMsgToTF(const geometry_msgs::PoseStamped & msg, Stamped<Pose>& bt)$/
namespace: tf
signature: (const geometry_msgs::PoseStamped & msg, Stamped<Pose>& bt)
filename: /opt/ros/diamondback/stacks/geometry/tf/include/tf/transform_datatypes.h

This is code I used a while ago for the inverse transformation:

  tf::Transform grasp_tf(gripperRotation, gripperRotation);
gripperOrigin);
  tf::Stamped<tf::Pose> grasp_tf_pose(grasp_tf);
  geometry_msgs::PoseStamped msg;
  tf::poseStampedTFToMsg    (grasp_tf_pose, msg);

Have a look at those:

name: tf::poseStampedTFToMsg
cmd: /^static inline void poseStampedTFToMsg(const Stamped<Pose>& bt, geometry_msgs::PoseStamped & msg)$/
namespace: tf
signature: (const Stamped<Pose>& bt, geometry_msgs::PoseStamped & msg)
filename: /opt/ros/diamondback/stacks/geometry/tf/include/tf/transform_datatypes.h

name: tf::poseStampedMsgToTF
cmd: /^static inline void poseStampedMsgToTF(const geometry_msgs::PoseStamped & msg, Stamped<Pose>& bt)$/
namespace: tf
signature: (const geometry_msgs::PoseStamped & msg, Stamped<Pose>& bt)
filename: /opt/ros/diamondback/stacks/geometry/tf/include/tf/transform_datatypes.h

This is code I used a while ago for the inverse transformation:

  tf::Transform grasp_tf(gripperRotation, gripperOrigin);
  tf::Stamped<tf::Pose> grasp_tf_pose(grasp_tf);
  geometry_msgs::PoseStamped msg;
  tf::poseStampedTFToMsg    (grasp_tf_pose, msg);

Edit:

I just needed to to that exact thing, so I mixed tf::poseStampedMsgToTF and tf::TransformStampedMsgToTF

namespace //anonymous
{ 
using namespace tf;
inline void myPoseMsgToTF(const geometry_msgs::Pose& msg, Transform& bt)
{
  bt = Transform(Quaternion(msg.orientation.x,
                            msg.orientation.y,
                            msg.orientation.z,
                            msg.orientation.w),
                 Vector3(msg.position.x, msg.position.y, msg.position.z));
}

///Sets the child frame fixed to "camera"
inline void myPoseStampedMsgToTF(const geometry_msgs::PoseStamped & msg, StampedTransform& bt)
{
  myPoseMsgToTF(msg.pose, bt); 
  bt.stamp_ = msg.header.stamp;
  bt.frame_id_ = msg.header.frame_id;
  bt.child_frame_id_ = "camera";
  ROS_WARN_ONCE("You are using a path which does not carry the information about the "
                "name of the sensor frame. Using 'camera' as child_frame_id.\n"
                "Make sure the positions in your path are those of the 'camera' frame.");
}
}//anon namespace