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>
18
19namespace yarp::dev {
20class IFrameTransform;
21}
22
29{
30public:
31 enum
32 {
33 TRANSFORM_OK = 0,
34 TRANSFORM_GENERAL_ERROR = 1,
35 TRANSFORM_TIMEOUT = 2,
36 };
41
47 virtual yarp::dev::ReturnValue allFramesAsString(std::string &all_frames) = 0;
48
56 virtual yarp::dev::ReturnValue canTransform (const std::string &target_frame, const std::string &source_frame, bool& canTransform) = 0;
57
63
72 virtual yarp::dev::ReturnValue frameExists (const std::string &frame_id, bool& exists) = 0;
73
79 virtual yarp::dev::ReturnValue getAllFrameIds (std::vector< std::string > &ids) = 0;
80
87 virtual yarp::dev::ReturnValue getParent (const std::string &frame_id, std::string &parent_frame_id) = 0;
88
96 virtual yarp::dev::ReturnValue getTransform (const std::string &target_frame_id, const std::string &source_frame_id, yarp::sig::Matrix &transform) = 0;
97
105 virtual yarp::dev::ReturnValue setTransform (const std::string &target_frame_id, const std::string &source_frame_id, const yarp::sig::Matrix &transform) = 0;
106
114 virtual yarp::dev::ReturnValue setTransformStatic(const std::string &target_frame_id, const std::string &source_frame_id, const yarp::sig::Matrix &transform) = 0;
115
122 virtual yarp::dev::ReturnValue deleteTransform (const std::string &target_frame_id, const std::string &source_frame_id) = 0;
123
132 virtual yarp::dev::ReturnValue 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;
133
142 virtual yarp::dev::ReturnValue 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;
143
152 virtual yarp::dev::ReturnValue 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;
153
162 virtual yarp::dev::ReturnValue waitForTransform(const std::string &target_frame_id, const std::string &source_frame_id, const double &timeout) = 0;
163};
164
169
170#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 yarp::dev::ReturnValue 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 yarp::dev::ReturnValue 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 yarp::dev::ReturnValue frameExists(const std::string &frame_id, bool &exists)=0
Check if a frame exists.
virtual yarp::dev::ReturnValue 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 yarp::dev::ReturnValue 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.
virtual yarp::dev::ReturnValue deleteTransform(const std::string &target_frame_id, const std::string &source_frame_id)=0
Deletes a transform between two frames.
virtual yarp::dev::ReturnValue 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 ~IFrameTransform()
Destructor.
virtual yarp::dev::ReturnValue getAllFrameIds(std::vector< std::string > &ids)=0
Gets a vector containing all the registered frames.
virtual yarp::dev::ReturnValue clear()=0
Removes all the registered transforms.
virtual yarp::dev::ReturnValue canTransform(const std::string &target_frame, const std::string &source_frame, bool &canTransform)=0
Test if a transform exists.
virtual yarp::dev::ReturnValue 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 yarp::dev::ReturnValue 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 yarp::dev::ReturnValue allFramesAsString(std::string &all_frames)=0
Creates a debug string containing the list of all registered frames.
virtual yarp::dev::ReturnValue getParent(const std::string &frame_id, std::string &parent_frame_id)=0
Get the parent of a 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.
Definition jointData.cpp:13
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