## page was renamed from tf/Overview/DataTypes <> <> == Data Types == These data types are defined in file `tf/transform_datatypes.h`. === Base data types (Quaternion, Vector, Point, Pose, Transform) === <> {{{#!wiki version cturtle diamondback electric All of these data types are typedefs of a [[bullet]] data type, so those are listed for reference. || '''Type''' || '''tf''' || '''Bullet''' || || Quaternion || `tf::Quaternion` || `btQuaternion`|| || Vector || `tf::Vector3` ||`btVector3` || || Point || `tf::Point` ||`btVector3` || || Pose || `tf::Pose` || `btTransform` || || Transform || `tf::Transform` || `btTransform` || }}} {{{#!wiki version fuerte_and_newer As of ROS [[Fuerte]], TF has defined its own datatypes. For more information on how to migrate pre-Fuerte code to newer distributions of ROS, see [[geometry/bullet_migration]]. || '''Type''' || '''tf''' || || Quaternion || `tf::Quaternion` || || Vector || `tf::Vector3` || || Point || `tf::Point` || || Pose || `tf::Pose` || || Transform || `tf::Transform` || }}} === tf::Stamped === `tf::Stamped` is templated on the above datatypes(except `tf::Transform`) with elements `frame_id_` and `stamp_` {{{#!cplusplus template class Stamped : public T{ public: ros::Time stamp_; std::string frame_id_; Stamped() :frame_id_ ("NO_ID_STAMPED_DEFAULT_CONSTRUCTION"){}; //Default constructor used only for preallocation Stamped(const T& input, const ros::Time& timestamp, const std::string & frame_id); void setData(const T& input); }; }}} === tf::StampedTransform === `tf::StampedTransform` is a special case of `tf::Transform`s which require both `frame_id` and `stamp` as well as `child_frame_id`. {{{#!cplusplus /** \brief The Stamped Transform datatype used by tf */ class StampedTransform : public tf::Transform { public: ros::Time stamp_; ///< The timestamp associated with this transform std::string frame_id_; ///< The frame_id of the coordinate frame in which this transform is defined std::string child_frame_id_; ///< The frame_id of the coordinate frame this transform defines StampedTransform(const tf::Transform& input, const ros::Time& timestamp, const std::string & frame_id, const std::string & child_frame_id): tf::Transform (input), stamp_ ( timestamp ), frame_id_ (frame_id), child_frame_id_(child_frame_id){ }; /** \brief Default constructor only to be used for preallocation */ StampedTransform() { }; /** \brief Set the inherited Traonsform data */ void setData(const tf::Transform& input){*static_cast(this) = input;}; }; }}} == Helper Functions == `tf::Quaternion createIdentityQuaternion()` Return an identity quaternion. `tf::Quaternion createQuaternionFromRPY(double roll,double pitch,double yaw)` Return a `tf::Quaternion` constructed from Fixed-Axis Roll, Pitch and Yaw `geometry_msgs::Quaternion createQuaternionMsgFromRollPitchYaw(double roll,double pitch,double yaw)` Return a `geometry_msgs::Quaternion` constructed from Fixed-Axis Roll, Pitch and Yaw. == Data type conversions == See the [[http://www.ros.org/doc/api/tf/html/c++/transform__datatypes_8h.html|conversions code API]].