Skip to content

Commit

Permalink
Merge pull request #3162 from S-Dafarra/frame_transform_bindings
Browse files Browse the repository at this point in the history
Added compilation of bindings for iFrameTransform
  • Loading branch information
randaz81 authored Jan 21, 2025
2 parents ffb7a7e + f269a3b commit b37a9dc
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 0 deletions.
25 changes: 25 additions & 0 deletions bindings/yarp.i
Original file line number Diff line number Diff line change
Expand Up @@ -430,6 +430,7 @@ MAKE_COMMS(Bottle)
%include <yarp/dev/ISpeechTranscription.h>
%include <yarp/dev/ILLM.h>
%include <yarp/dev/MultipleAnalogSensorsInterfaces.h>
#include <yarp/dev/IFrameTransform.h>

#ifndef YARP_NO_DEPRECATED // Since YARP 3.5.0
%include <yarp/dev/IFrameGrabber.h>
Expand Down Expand Up @@ -825,6 +826,7 @@ typedef yarp::os::BufferedPort<ImageRgbFloat> BufferedPortImageRgbFloat;
CAST_POLYDRIVER_TO_INTERFACE(ISpeechSynthesizer)
CAST_POLYDRIVER_TO_INTERFACE(ISpeechTranscription)
CAST_POLYDRIVER_TO_INTERFACE(ILLM)
CAST_POLYDRIVER_TO_INTERFACE(IFrameTransform)

// These views are currently disabled in SWIG + java generator since they are
// useless without the EXTENDED_ANALOG_SENSOR_INTERFACE part.
Expand Down Expand Up @@ -1588,6 +1590,29 @@ typedef yarp::os::BufferedPort<ImageRgbFloat> BufferedPortImageRgbFloat;
}
}

%extend yarp::dev::IFrameTransform {
std::string allFramesAsString() {
std::string outputString;
bool ok = self->allFramesAsString(outputString);
if (!ok) return "";
return outputString;
}

std::vector<std::string> getAllFrameIds() {
std::vector<std::string> frameIds;
bool ok = self->getAllFrameIds(frameIds);
if (!ok) return std::vector<std::string>();
return frameIds;
}

std::string getParent(const std::string& frameId) {
std::string parent;
bool ok = self->getParent(frameId, parent);
if (!ok) return "unknown";
return parent;
}
}

// This is part is currently broken in SWIG + java generator since SWIG 3.0.3
// (last swig version tested: 3.0.12)
// See also https://github.com/robotology/yarp/issues/1770
Expand Down
4 changes: 4 additions & 0 deletions cmake/YarpFindDependencies.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -497,6 +497,10 @@ yarp_dependent_option(
)
yarp_renamed_option(CREATE_LIB_MATH YARP_COMPILE_libYARP_math) # Deprecated since YARP 3.2

if(NOT YARP_COMPILE_libYARP_math)
add_definitions(-DYARP_NO_MATH)
endif()

yarp_dependent_option(
YARP_COMPILE_libYARP_robotinterface "Do you want to compile the library YARP_robotinterface?" ON
"YARP_HAS_TinyXML" OFF
Expand Down
5 changes: 5 additions & 0 deletions src/libYARP_dev/src/yarp/dev/all.h
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,11 @@
#include <yarp/dev/ILLM.h>
#include <yarp/dev/IChatBot.h>

#ifndef YARP_NO_MATH
#include <yarp/dev/IFrameTransform.h>
#endif // YARP_NO_MATH


#ifndef YARP_NO_DEPRECATED // since YARP 3.5
#define YARP_INCLUDING_DEPRECATED_HEADER_YARP_DEV_FRAMEGRABBER_H_ON_PURPOSE
#include <yarp/dev/IFrameGrabber.h>
Expand Down

0 comments on commit b37a9dc

Please sign in to comment.