YARP
Yet Another Robot Platform
IFrameTransform.h
Go to the documentation of this file.
1 /*
2  * SPDX-FileCopyrightText: 2006-2021 Istituto Italiano di Tecnologia (IIT)
3  * SPDX-License-Identifier: BSD-3-Clause
4  */
5 
6 #ifndef YARP_DEV_IFRAMETRANSFORM_H
7 #define YARP_DEV_IFRAMETRANSFORM_H
8 
9 #include <string>
10 #include <vector>
11 
12 #include <yarp/dev/api.h>
13 #include <yarp/os/Vocab.h>
14 #include <yarp/sig/Matrix.h>
15 #include <yarp/sig/Vector.h>
16 #include <yarp/math/Quaternion.h>
17 
18 namespace yarp {
19  namespace dev {
20  class IFrameTransform;
21  }
22 }
23 
30 {
31 public:
32  enum
33  {
34  TRANSFORM_OK = 0,
35  TRANSFORM_GENERAL_ERROR = 1,
36  TRANSFORM_TIMEOUT = 2,
37  };
41  virtual ~IFrameTransform();
42 
48  virtual bool allFramesAsString(std::string &all_frames) = 0;
49 
56  virtual bool canTransform (const std::string &target_frame, const std::string &source_frame) = 0;
57 
62  virtual bool clear () = 0;
63 
71  virtual bool frameExists (const std::string &frame_id) = 0;
72 
78  virtual bool getAllFrameIds (std::vector< std::string > &ids) = 0;
79 
86  virtual bool getParent (const std::string &frame_id, std::string &parent_frame_id) = 0;
87 
95  virtual bool getTransform (const std::string &target_frame_id, const std::string &source_frame_id, yarp::sig::Matrix &transform) = 0;
96 
104  virtual bool setTransform (const std::string &target_frame_id, const std::string &source_frame_id, const yarp::sig::Matrix &transform) = 0;
105 
113  virtual bool setTransformStatic(const std::string &target_frame_id, const std::string &source_frame_id, const yarp::sig::Matrix &transform) = 0;
114 
121  virtual bool deleteTransform (const std::string &target_frame_id, const std::string &source_frame_id) = 0;
122 
131  virtual bool transformPoint (const std::string &target_frame_id, const std::string &source_frame_id, const yarp::sig::Vector &input_point, yarp::sig::Vector &transformed_point) = 0;
132 
141  virtual bool transformPose(const std::string &target_frame_id, const std::string &source_frame_id, const yarp::sig::Vector &input_pose, yarp::sig::Vector &transformed_pose) = 0;
142 
151  virtual bool transformQuaternion(const std::string &target_frame_id, const std::string &source_frame_id, const yarp::math::Quaternion &input_quaternion, yarp::math::Quaternion &transformed_quaternion) = 0;
152 
161  virtual bool waitForTransform(const std::string &target_frame_id, const std::string &source_frame_id, const double &timeout) = 0;
162 };
163 
168 
169 #endif // YARP_DEV_IFRAMETRANSFORM_H
constexpr yarp::conf::vocab32_t VOCAB_TRANSFORM_DELETE
constexpr yarp::conf::vocab32_t VOCAB_TRANSFORM_SET
constexpr yarp::conf::vocab32_t VOCAB_TRANSFORM_DELETE_ALL
constexpr yarp::conf::vocab32_t VOCAB_ITRANSFORM
contains the definition of a Matrix type
contains the definition of a Vector type
Transform Interface.
virtual bool transformQuaternion(const std::string &target_frame_id, const std::string &source_frame_id, const yarp::math::Quaternion &input_quaternion, yarp::math::Quaternion &transformed_quaternion)=0
Transform a quaternion into the target frame.
virtual bool waitForTransform(const std::string &target_frame_id, const std::string &source_frame_id, const double &timeout)=0
Block until a transform from source_frame_id to target_frame_id is possible or it times out.
virtual bool allFramesAsString(std::string &all_frames)=0
Creates a debug string containing the list of all registered frames.
virtual bool setTransform(const std::string &target_frame_id, const std::string &source_frame_id, const yarp::sig::Matrix &transform)=0
Register a transform between two frames.
virtual bool getTransform(const std::string &target_frame_id, const std::string &source_frame_id, yarp::sig::Matrix &transform)=0
Get the transform between two frames.
virtual bool deleteTransform(const std::string &target_frame_id, const std::string &source_frame_id)=0
Deletes a transform between two frames.
virtual ~IFrameTransform()
Destructor.
virtual bool getAllFrameIds(std::vector< std::string > &ids)=0
Gets a vector containing all the registered frames.
virtual bool setTransformStatic(const std::string &target_frame_id, const std::string &source_frame_id, const yarp::sig::Matrix &transform)=0
Register a static transform between two frames.
virtual bool clear()=0
Removes all the registered transforms.
virtual bool getParent(const std::string &frame_id, std::string &parent_frame_id)=0
Get the parent of a frame.
virtual bool canTransform(const std::string &target_frame, const std::string &source_frame)=0
Test if a transform exists.
virtual bool frameExists(const std::string &frame_id)=0
Check if a frame exists.
virtual bool transformPose(const std::string &target_frame_id, const std::string &source_frame_id, const yarp::sig::Vector &input_pose, yarp::sig::Vector &transformed_pose)=0
Transform a Stamped Pose into the target frame.
virtual bool transformPoint(const std::string &target_frame_id, const std::string &source_frame_id, const yarp::sig::Vector &input_point, yarp::sig::Vector &transformed_point)=0
Transform a point into the target frame.
A class for a Matrix.
Definition: Matrix.h:43
std::int32_t vocab32_t
Definition: numeric.h:78
constexpr yarp::conf::vocab32_t createVocab32(char a, char b=0, char c=0, char d=0)
Create a vocab from chars.
Definition: Vocab.h:28
The main, catch-all namespace for YARP.
Definition: dirs.h:16
#define YARP_dev_API
Definition: api.h:18