YARP
Yet Another Robot Platform
 
Loading...
Searching...
No Matches
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>
17
18namespace yarp::dev {
19class IFrameTransform;
20}
21
28{
29public:
30 enum
31 {
32 TRANSFORM_OK = 0,
33 TRANSFORM_GENERAL_ERROR = 1,
34 TRANSFORM_TIMEOUT = 2,
35 };
40
46 virtual bool allFramesAsString(std::string &all_frames) = 0;
47
54 virtual bool canTransform (const std::string &target_frame, const std::string &source_frame) = 0;
55
60 virtual bool clear () = 0;
61
69 virtual bool frameExists (const std::string &frame_id) = 0;
70
76 virtual bool getAllFrameIds (std::vector< std::string > &ids) = 0;
77
84 virtual bool getParent (const std::string &frame_id, std::string &parent_frame_id) = 0;
85
93 virtual bool getTransform (const std::string &target_frame_id, const std::string &source_frame_id, yarp::sig::Matrix &transform) = 0;
94
102 virtual bool setTransform (const std::string &target_frame_id, const std::string &source_frame_id, const yarp::sig::Matrix &transform) = 0;
103
111 virtual bool setTransformStatic(const std::string &target_frame_id, const std::string &source_frame_id, const yarp::sig::Matrix &transform) = 0;
112
119 virtual bool deleteTransform (const std::string &target_frame_id, const std::string &source_frame_id) = 0;
120
129 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;
130
139 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;
140
149 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;
150
159 virtual bool waitForTransform(const std::string &target_frame_id, const std::string &source_frame_id, const double &timeout) = 0;
160};
161
166
167#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:39
std::int32_t vocab32_t
Definition numeric.h:78
For streams capable of holding different kinds of content, check what they actually have.
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:27
The main, catch-all namespace for YARP.
Definition dirs.h:16
#define YARP_dev_API
Definition api.h:18